Show HN: Unclog – find and fix Claude Code context bloat

hackernews | | 💼 비즈니스
#claude #context window #tip
원문 출처: hackernews · Genesis Park에서 요약 및 분석

요약

Claude Code의 MCP, 스킬, 후크 등 컨텍스트 윈도우를 차지하는 불필요한 요소를 스캔하여 병목 현상을 해결하는 'unclog' 도구가 공개되었습니다. 이 도구는 중복 파일, 사용하지 않는 리소스, 메모리 누수 등을 구체적으로 식별하며, 변경 사항은 사용자 확인 후 적용되고 언제든지 스냅샷을 통해 되돌릴 수 있습니다. Python 3.11 이상과 macOS 또는 Linux 환경을 지원하며, 별도의 네트워크 연결 없이 로컬에서 안전하게 실행됩니다.

본문

Every MCP, skill, hook, and CLAUDE.md line you've installed occupies your context window on every turn. unclog scans your Claude Code install, measures the bloat, and offers a reversible fix. # install uv tool install unclog # run unclog | Category | What unclog surfaces | |---|---| | CLAUDE.md | cross-project duplicates, scope mismatches | | 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 | 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// before any change. unclog restore # restore the most recent snapshot unclog restore # restore a specific one unclog restore --list # enumerate every snapshot unclog # scan global + every known project, report, fix unclog --project # 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. - 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. Python 3.11+, Claude Code ≥ 2.1.90, macOS or Linux. (Windows: v0.2.) uv sync --all-extras --dev uv run pytest uv run ruff check src tests uv run mypy src/unclog MIT. See LICENSE.

Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.

공유

관련 저널 읽기

전체 보기 →