claude-slim
Health Pass
- License — License: MIT
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Community trust — 42 GitHub stars
Code Pass
- Code scan — Scanned 12 files during light audit, no dangerous patterns found
Permissions Pass
- Permissions — No dangerous permissions requested
No AI report is available for this listing yet.
Audit and shrink your Claude Code startup context. Measures what every skill, plugin, agent, and memory file costs in the system prompt, then reversibly disables the dead weight. No proxy, no compression.
claude-slim
Your Claude Code session burns thousands of tokens before you even say "hello."
Every session auto-loads every skill, agent, slash command, memory file, and plugin instruction into the system prompt — even the ones you never use. If you run OMC, marketplace plugins, or a custom skill stack, you're paying for context you'll never touch on every single turn. claude-slim measures that startup overhead and removes what you don't need.
No proxy, no compression, no changes to how Claude Code talks to the API — it reads ~/.claude/, tells you what each skill and plugin actually costs, and moves the dead weight aside reversibly.
/claude-slim
See it in action
Where the bloat hides:
| Source | Typical overhead |
|---|---|
| 60+ registered skills | ~3,000 tokens |
| CLAUDE.md (plugin instructions) | ~5,000 tokens |
| Memory files | ~2,500 tokens |
| Deferred tools list | ~1,500 tokens |
| Total | ~12,000 tokens |
That's slower responses. Hitting your usage cap faster. Paying for context you're not using.
One command. Five steps.
/claude-slim
┌────────┐ ┌──────────┐ ┌─────────┐ ┌─────────┐ ┌────────┐
│ Scan │ → │ Classify │ → │ Propose │ → │ Clean │ → │ Report │
│ │ │ │ │ │ │ │ │ │
│measure │ │ broken │ │ you │ │ move to │ │before │
│ every │ │ dupes │ │ choose │ │.disabled│ │ vs │
│source │ │ bloat │ │ what │ │ dir │ │ after │
└────────┘ └──────────┘ └─────────┘ └─────────┘ └────────┘
Scan — Measures everything: local skills, plugin skills, CLAUDE.md, memory files, MCP servers. Token counts are measured with js-tiktoken, not guessed.
Classify — Finds the waste automatically:
| What it catches | |
|---|---|
| Broken symlinks | Dead links from uninstalled skill packs |
| Duplicates | Same skill registered from multiple sources |
| Empty templates | Placeholder skills with no content |
| Oversized files | SKILL.md over 10KB |
| Unused skills | Local skills never invoked in your last N days of sessions (default 60d) |
| Agents & commands | ~/.claude/agents/ and ~/.claude/commands/ — measured and reported, never modified |
| Unused plugins | Plugins whose skill/mcp/cmd were never invoked in your last N days of sessions (default 60d). Tier 3, never auto-selected. |
| Stale memory | Large memory files loaded every session |
| Disabled plugins | Installed but disabled plugins still in cache |
| Stale projects | Project memory untouched for 90+ days |
| Temp caches | Failed plugin install remnants (temp_local_*) |
Propose — Three tiers, you decide:
| Tier | Action | Example |
|---|---|---|
| Auto | Pre-selected | Broken symlinks, empty templates, temp caches |
| Recommended | Suggested | Duplicates, stale memory, disabled plugins, stale projects |
| Optional | Your call | Oversized skills you might still use |
Clean — Moves selected skills and project memory to ~/.claude/skills.disabled/. Failed-install temp caches and dead symlink files are the only permanent cleanups, and they are labeled before selection.
Report — Shows exactly what changed:
╭──────────────────────────────────────────╮
│ claude-slim report │
│ │
│ Before: 14,510 tokens at startup │
│ After: 5,181 tokens at startup │
│ Saved: 9,329 tokens (64.3%) │
│ │
│ Top offenders removed: │
│ • office-hours 23,008 tok │
│ • harness 7,902 tok │
│ • manpower 4,764 tok │
│ │
│ Est. monthly savings: ~$1.68 │
│ (2 sessions/day × $0.003/1K tok) │
╰──────────────────────────────────────────╯
┌──────────────────┬──────────┬──────────┬────────────┐
│ │ Before │ After │ Saved │
├──────────────────┼──────────┼──────────┼────────────┤
│ Local skills │ 14 │ 4 │ -10 │
│ System prompt │ ~124 │ ~114 │ -10 │
│ Memory files │ 19.5KB │ 5.7KB │ -13.8KB │
│ Est. tokens │ ~14,510 │ ~5,181 │ ~9,329 │
└──────────────────┴──────────┴──────────┴────────────┘
Try it (10 seconds)
No install needed — run once and see what's in your ~/.claude/:
npx claude-slim scan
Happy with what you see? Make it part of your Claude Code workflow:
claude plugin marketplace add iops-leo/claude-slim
claude plugin install claude-slim
Then just type /claude-slim in any session.
Usage
/claude-slim # Full pipeline: scan → propose → clean → report
/claude-slim scan # Report only, no changes
/claude-slim scan --json # Machine-readable JSON output
/claude-slim scan --lookback-days 30 # Treat skills idle for 30+ days as unused
/claude-slim doctor # Check scanner prerequisites and data fidelity
/claude-slim restore # Bring back anything you disabled
CLI equivalents:
npx claude-slim clean # Full pipeline
npx claude-slim clean --dry-run # See what would happen (no changes)
npx claude-slim clean --auto # Non-interactive, Tier 1 only (CI/scripts)
npx claude-slim clean --lookback-days N # Tune the unused-skill detection window
npx claude-slim scan # Report only
npx claude-slim doctor # Diagnose Node/Claude/session-log readiness
npx claude-slim restore # Undo
npx claude-slim report # Show savings from last clean
Safety first
| Non-destructive for user data | Skills and project memory move to ~/.claude/skills.disabled/ |
| Reversible where state exists | /claude-slim restore brings moved skills and project memory back |
| User-controlled | Interactive runs ask before changes. --dry-run previews; --auto selects Tier 1 only. |
| Hands off | Never touches CLAUDE.md, settings.json, or plugin configs |
| Scoped | All operations are refused if the target path escapes ~/.claude/ |
What claude-slim never touches
~/.claude/CLAUDE.md— your system instructions, read-only.~/.claude/settings.json— MCP server config, hooks, and any other settings. Read-only.- Plugin internals (
~/.claude/plugins/config.json, individualplugin.jsonfiles) — left alone; useclaude pluginto manage plugins. - Git / project sources — claude-slim only looks inside
~/.claude/, never at your code. - Anything outside
~/.claude/— a path-containment guard refuses destructive ops anywhere else, even if a tampered manifest asked it to.
Only touched: entries under ~/.claude/skills/, ~/.claude/plugins/cache/temp_local_*, and ~/.claude/projects/*/memory/. Skill and memory entries are moved to skills.disabled/; broken symlink files are unlinked and temp_local_* failed-install caches are removed outright.
How it works
claude-slim scans these locations. No plugin-specific logic — pure filesystem analysis.
~/.claude/
├── skills/ ← user-installed skills
├── plugins/cache/ ← plugin skills, agents, commands, MCP servers
├── agents/ ← user agents (measured, read-only)
├── commands/ ← user slash commands (measured, read-only)
├── CLAUDE.md ← system instructions (read-only)
├── projects/*/memory/ ← auto-memory files (current project counts toward startup)
└── settings.json ← MCP server count (read-only)
Works with any setup: OMC, gstack, marketplace plugins, custom skills, or vanilla Claude Code.
Real-world results
From a real cleanup session:
| Metric | Before | After | |
|---|---|---|---|
| Local skills | 65 | 15 | -77% |
| System prompt skills | ~80 | ~48 | -40% |
| Memory files | 15KB | 2KB | -87% |
| Est. token savings | ~4,300/session |
v2.8.0 — What's new
Accuracy release. Three reported numbers were wrong; the largest was wrong by an order of magnitude. If your startup estimate drops sharply after upgrading, the old number was the inaccurate one.
- Startup estimate no longer sums memory across every project on disk. Claude Code loads
~/.claude/projects/<slug>/memory/for the project you're in — not the other 40 project directories in your~/.claude. The old total scaled with how many projects you'd ever opened: on the dev machine it reported 116,259 tokens where the real per-session cost was 14,399. Now scoped to the current project, with the cross-project total still shown and labelled as not a per-session cost. - Skill listing cost is measured, not assumed. Each skill adds a
- <name>: <description>line to the system prompt. The flat 30-tokens-per-skill estimate stood in for all of them; measured across 68 installed skills the real spread is 30 → 509 tokens (mean 51). The per-plugin cost gradient can now tell five terse skills apart from five verbose ones. ~/.claude/agents/and~/.claude/commands/are now scanned. Previously invisible despite loading into every session — 12 agents worth ~2,254 tokens on the dev machine. Reported only; never moved or deleted, because there's no restore path for them yet.- Fixed: plugin manifests were stuck at 2.7.0 for three releases, so
claude plugin installadvertised a stale version. CI now fails on version drift. - Fixed: the token cache grew without bound — 355 of 776 entries (46%) pointed at deleted files.
flushCache()now prunes them.
Tests: 206 → 241 (+35).
For older release notes, see CHANGELOG.md.
Requirements
- Node.js 20+
- macOS or Linux
- Claude Code CLI
License
MIT
Reviews (0)
Sign in to leave a review.
Leave a reviewNo results found