@ssthil/cc-lean
v0.4.0
Published
Static, offline audit of your Claude Code setup — flags never-used MCP connectors, oversized CLAUDE.md/memory, and missing context guardrails. Then lays down a lean default setup.
Maintainers
Readme
Keep your Claude Code setup lean. A static, offline audit of your ~/.claude config that finds the things quietly bloating every session — then lays down a lean default setup. No telemetry, no servers launched, no network calls — it only reads files already on your disk.
npx @ssthil/cc-lean audit # posture report
npx @ssthil/cc-lean init # install the lean default setupOr install globally — the command is cc-lean either way:
npm i -g @ssthil/cc-lean
cc-lean auditWhy
Claude Code defers MCP tool schemas — a connected server's tools don't enter context until you actually use one. That's good, but the deferred pool is real: a typical multi-connector setup carries 70k+ tokens of schemas waiting to load piecemeal, plus tool names and server instructions paid up front. Connected-but-never-used connectors are pure liability.
cc-lean answers the question no other tool does statically and offline: which of my connectors have I never actually used? — by reading your own session history, not by launching servers or guessing.
Honest scope: Claude Code only feeds live usage to the statusline, so real-time monitoring from an external process is impossible.
cc-leanis deliberately setup + static audit, not a live monitor. For live usage use the built-in/contextand/usage; for cost reporting useccusage.
cc-lean audit
Reads ~/.claude/projects/**/*.jsonl and reports:
- MCP connectors — which servers you actually use (with call counts + last-used), and which are connected but never used, derived from real
tool_usehistory. - CLAUDE.md size — global + project, flagged when over 200 lines (it loads every session start).
- Guardrails — whether the statusline advisor is configured; memory footprint.
- Posture score (0–100) + the top 3 highest-impact fixes.
See the screenshot above for the full framed report.
POSTURE 60/100 needs work
██████████████████░░░░░░░░░░░░
MCP CONNECTORS 152 transcripts
────────────────────────────────────────────────────────────
● Atlassian ▇▇▇▇▇▇ 28× today
● Figma ▇····· 5× 19d ago
○ Gmail never used ~14 tools deferred
○ Slack never used ~2 tools deferred
...
TOP FIXES
① Disconnect 16 never-used connectors (…) — shrinks the deferred MCP pool. Run /mcp.cc-lean init
Lays down the lean default setup, safely (existing files are backed up to *.bak, never silently clobbered):
~/.claude/statusline-advisor.sh— live context-%/cost gauge (green/yellow at 70%/red at 90%). Requiresjq.- A
statusLineentry merged into~/.claude/settings.json(other keys untouched). - The
/leanskill at~/.claude/skills/lean/SKILL.md— on-demand consumption audit + lean working mode.
cc-lean init --dry-run # preview without writingInstall as a Claude Code plugin
Prefer to manage it inside Claude Code? This repo is also a plugin marketplace, so you can install the /lean skill and a PreCompact nudge (reminds you to preserve state and prefer /clear at task boundaries) directly:
/plugin marketplace add ssthil/cc-lean
/plugin install cc-lean@ssthilThe plugin ships the /lean skill and the PreCompact hook. It can't set your statusLine (that's a user-only setting), so run the bundled /lean-setup command — or npx @ssthil/cc-lean init — to add the live context/cost gauge.
Requirements
- Node ≥ 18 (zero runtime dependencies)
jqfor the statusline (audit/init themselves don't need it)
License
MIT
