The Janitor (Autonomous Maintenance)
The Janitor is an autonomous agent dedicated to codebase hygiene. It continuously monitors the project for "low-hanging fruit" — minor issues that accumulate over time but are tedious to fix manually.
Responsibilities
- Clippy Warnings: Identifies and fixes common Rust lints (style, correctness, complexity, perf).
- Unused Dependencies: Detects dependencies in
Cargo.tomlthat are not imported in any source file. - Compiler Warnings: Monitors standard compiler warnings.
Workflow
The Janitor operates on a Safe Proposal model. It never modifies your code without explicit confirmation.
Scan: usage
synapseed janitor- Runs
cargo clippy --message-format=json. - Scans
Cargo.tomland source files for unused dependencies. - Generates a list of Proposals.
- Runs
Review:
- Each proposal has a unique ID, a description (e.g., "Remove unused import"), and a severity.
- Proposals are stored in memory resource
synapseed://janitor/proposals.
Apply: usage
synapseed janitor-fix- You (or the LLM) invoke
janitor-fixwith a proposal ID. - Dry Run: By default, it shows a diff of what would happen.
- Confirm: Call with
confirm: trueto apply the change. - Verification: After applying, it runs
cargo check. If the check fails, it automatically reverts the change to ensure the codebase remains compiling.
- You (or the LLM) invoke
Integration
The Janitor is designed to run in the background or on-demand. In Claude Desktop or VS Code, the Janitor's findings can be presented as a list of actionable tasks.
Protocol
- Tool:
janitor(scan),janitor-fix(apply) - Resource:
synapseed://janitor/proposals(active proposals)