From claude-slim
Analyzes Claude Code environment for token waste in skills, plugins, memory files, and CLAUDE.md; proposes and performs safe cleanups with user approval. Invoke via /claude-slim for optimization.
npx claudepluginhub iops-leo/claude-slim --plugin claude-slimThis skill uses the workspace's default tool permissions.
Analyze the user's Claude Code environment for token waste and perform non-destructive cleanup.
Audits Claude Code or Codex setups to identify ghost tokens and context waste, runs parallel agent audits, generates optimization plans and dashboards, implements fixes. Use when context feels tight.
Audits Claude Code setups for token waste and context bloat, checking MCP servers, CLAUDE.md files, skills, and settings using /context output.
Audits Claude Code context window consumption across agents, skills, MCP servers, and rules. Identifies bloat, redundancies, and provides prioritized token-saving recommendations.
Share bugs, ideas, or general feedback.
Analyze the user's Claude Code environment for token waste and perform non-destructive cleanup.
/claude-slim or /claude-slim run → full pipeline (scan → propose → execute → report)/claude-slim scan → report only, no changes/claude-slim scan --json → raw JSON output/claude-slim restore → restore previously disabled itemsRun the CLI to collect environment data:
cd "${CLAUDE_PLUGIN_ROOT}" && node dist/cli.js scan --json
If CLAUDE_PLUGIN_ROOT is not set:
PLUGIN_DIR=$(find ~/.claude/plugins -path "*/claude-slim/dist/cli.js" -type f 2>/dev/null | head -1 | xargs dirname | xargs dirname)
cd "$PLUGIN_DIR" && node dist/cli.js scan --json
If node is not available, fall back to the legacy bash scanner:
bash "${CLAUDE_PLUGIN_ROOT}/skills/claude-slim/scripts/scan.sh"
After getting the scan JSON, YOU must interpret and present results to the user. Do NOT just dump raw CLI output. Present a full diagnostic report in the user's language.
Templates below are shown in English for readability. Always translate headers, labels, and prompts into the user's detected language when rendering.
Show a summary table:
| Item | Count | Tokens |
|---|---|---|
| Local skills | N (XKB) | X tok |
| Plugins | N (M skills) | ~X tok |
| CLAUDE.md | XKB | X tok |
| Memory files | N (XKB) | ~X tok |
| Session startup overhead | ~X tok |
List each plugin with skill count and a judgment:
| Plugin | Skills | Notes |
|---|---|---|
| omc | 36 | Core plugin. Keep. |
| temp_local_... | 1 | Failed install remnant. Cleanup target. |
Annotate each with status: actively used, possibly unused, or cleanup target. Flag temp_local_* entries as failed install remnants.
Group issues by tier and explain EACH one with context and recommendation:
Tier 1 — Immediate cleanup (zero risk): These are safe to remove with zero risk: broken symlinks, empty templates, .skill/ duplicates, temp_local_* cache. Pre-selected. Explain why each is safe.
Tier 2 — Recommended cleanup: These are recommended but need user judgment. For each issue, explain:
Example: "frontend-design exists both locally and in a plugin. Removing the local copy is safe because the plugin version remains. Saves ~823 tok."
Tier 3 — Optional (user judgment): These are large skills that cost tokens but might be in active use. For each:
End with a numbered action list, ordered by impact:
Show estimated total token savings if all recommended actions are taken.
If subcommand is scan, stop here. Ask a localized equivalent of "Proceed with cleanup?" only for the full pipeline.
Run the interactive clean command:
cd "${CLAUDE_PLUGIN_ROOT}" && node dist/cli.js clean
Or with dry-run:
cd "${CLAUDE_PLUGIN_ROOT}" && node dist/cli.js clean --dry-run
After cleanup, re-run scan to get updated numbers, then show the savings report:
cd "${CLAUDE_PLUGIN_ROOT}" && node dist/cli.js report
Present the report box AND the before/after breakdown table to the user.
When /claude-slim restore is invoked:
cd "${CLAUDE_PLUGIN_ROOT}" && node dist/cli.js restore
Detect the user's language from their most recent message. Present all reports, analysis, and explanations in that language — including table headers, tier labels, prompts, and every user-facing string. The CLI output is machine-readable (always English) and must not be echoed verbatim; translate its content into the user's language when you interpret it. The example tables above are written in English only for authoring clarity — do not treat them as a required output format.
~/.claude/skills.disabled/.--dry-run to preview changes.