Audit your Claude Code installation and clear context-window bloat. Local-only.
Project description
unclog
Every MCP, skill, hook, and CLAUDE.md line you've installed is charging you on every turn. unclog scans your Claude Code install, measures the bloat, and offers a reversible fix.
# install
uv tool install unclog
# run
unclog
Demo
What it finds
| Category | What unclog surfaces |
|---|---|
| CLAUDE.md | oversized sections, cross-project duplicates, scope mismatches, dead file refs, broken @-import chains (depth ≤5) |
| Auto-memory | per-project MEMORY.md files auto-injected into every turn |
| Hooks | every-turn handlers whose stdout silently joins your context |
| MCP servers | configured-but-dead, loaded-but-never-called, and — by default — live tools-schema token counts from a local stdio probe |
| Skills / agents / commands | zero-invocation entries older than your unused_days threshold |
| Plugins | stale installs and disabled-but-still-on-disk residue |
| Project hygiene | missing .claudeignore in repos that bundle node_modules/, venv/, etc. |
| Baseline | total tokens consumed before you type a message |
Fixing things
unclog never writes without a confirmed prompt. Conservative-safe findings are pre-checked; everything else defaults unchecked. A full snapshot is written to ~/.claude/.unclog/snapshots/<id>/ before any change.
unclog restore # restore the most recent snapshot
unclog restore <id> # restore a specific one
unclog restore --list # enumerate every snapshot
Usage
unclog # scan global + every known project, report, fix
unclog --project <path> # narrow the audit to a single project
unclog --report # scan + report, skip the fix flow
unclog --json # structured output (schema unclog.v0.1)
unclog --no-probe-mcps # skip the live MCP probe (keeps the scan read-only)
unclog --list-claude-md # diagnostic: list every auto-injected context file with token counts
unclog --yes # apply every auto-checked finding
unclog --no-animation # disable the post-apply baseline countdown
unclog --plain # ASCII-only, CI-safe
NO_COLOR=1 or a non-TTY pipe auto-enables --plain.
Guarantees
- Local-only. Every measurement runs in-process via
tiktoken. No telemetry, no accounts, no network. - Reversible. Every apply pass writes a full snapshot first.
- No background processes.
unclogruns, prints, optionally applies, exits.
Requirements
Python 3.11+, Claude Code ≥ 2.1.90, macOS or Linux. (Windows: v0.2.)
Development
uv sync --all-extras --dev
uv run pytest
uv run ruff check src tests
uv run mypy src/unclog
License
MIT. See LICENSE.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file unclog-0.1.0.tar.gz.
File metadata
- Download URL: unclog-0.1.0.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2d35c5a9610d91e560ac8c593e53012136c337ac82ca03babb38a2eacdca503
|
|
| MD5 |
fdd992499570a73df9978820630cd49d
|
|
| BLAKE2b-256 |
aac944c7d37b2c3ae5366851d8df93f18b9dbbdd973bc1b17119c5ac5c7e6201
|
File details
Details for the file unclog-0.1.0-py3-none-any.whl.
File metadata
- Download URL: unclog-0.1.0-py3-none-any.whl
- Upload date:
- Size: 117.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8eb6ac8eaa3cdf69ccd99c422bdaa7f94b68a247f595ca168849c29b964fbff5
|
|
| MD5 |
31ab94504ebe942bb5cb64bf561b6a15
|
|
| BLAKE2b-256 |
60b1c08801fe991754d3f2df3f27dd050e9bc00694f2d01b575716de21d86c58
|