Skip to main content

Audit your Claude Code installation and clear context-window bloat. Local-only.

Project description

unclog

PyPI

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

unclog scan output

Demo

unclog interactive fix flow

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. After the report, one sectioned picker opens with:

  • Apply — detector-driven fixes; conservative-safe findings start checked.
  • Curate agents / skills / MCPs — every local agent, skill, and remote MCP, sorted by token cost. Always starts unchecked; consent is per-item.

Picker keys: ↑↓ move · space toggle · a / A check section / all · n / N clear section / all · enter apply · q quit. 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 --verbose             # restore the full pre-picker chrome (scan-meta, tips, also-running)
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. The default mode trims chrome once you've seen it; pass -v/--verbose to bring it back.

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. unclog runs, 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

unclog-0.1.1.tar.gz (988.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unclog-0.1.1-py3-none-any.whl (131.5 kB view details)

Uploaded Python 3

File details

Details for the file unclog-0.1.1.tar.gz.

File metadata

  • Download URL: unclog-0.1.1.tar.gz
  • Upload date:
  • Size: 988.2 kB
  • 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

Hashes for unclog-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d348f9efc647c696dfb537a41adc06ef6ab0c484e6263d308c49fb5a2c44ff7d
MD5 2eb177d6510eb9925fea3bec0b599b6b
BLAKE2b-256 2efe5b3576436b259293df338a43161b91d3c7ee1ce90cda27eb64164a92c754

See more details on using hashes here.

File details

Details for the file unclog-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: unclog-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 131.5 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

Hashes for unclog-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dccaf959e09b8f3482f42218d6834e3e37ffdfdfcfe5f3426340be744695d7a6
MD5 8dc8b631bb8cc8e54172050f3a140323
BLAKE2b-256 d6f59ffc5813c71b813e8be2a6952aaa6aad72c0e85afdccf30bcea189583da4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page