Local-first diagnostics & cleanup CLI for AI coding agents.
AgentJanitor is a local-first diagnostics and cleanup tool built for the mess your AI coding agents leave behind. It finds orphaned background processes, bloated session history, broken MCP servers, stale caches, and exposed credentials across Claude Code, OpenAI Codex, and Gemini CLI — then safely cleans them up with backups and full undo.
$ agentjanitor scan
$ agentjanitor fix --dry-run
$ agentjanitor fix
$ agentjanitor undo
AI coding agents (Claude Code, Codex, Gemini CLI, and others) spawn background processes, MCP servers, and session/cache data that quietly accumulate — leaked helper processes eating RAM, gigabytes of stale session history, duplicated or broken MCP server definitions, and occasionally a plaintext credential that never got rotated. AgentJanitor understands agent-specific concepts (MCP servers, sessions, task workspaces, plugin caches) instead of treating your machine as a generic pile of files.
| Agent | Status |
|---|---|
| OpenAI Codex | Supported |
| Claude Code | Supported |
| Gemini CLI | Experimental |
pipx install agentjanitor
# or
uv tool install agentjanitor
No telemetry, no cloud account, no uploads, no AI API required. Runs entirely locally.