Logo: Claude Slim

Claude Slim

Communautéit
iops-leo
claude-slim

Analyze and reduce Claude Code token overhead. Scans skills, plugins, memory files, and CLAUDE.md for bloat — then cleans up with user approval. Use when: /claude-slim, token optimization, reduce tokens, slim down, cleanup skills, token diet, save tokens, context diet

Iwwersiicht

Editeuriops-leo
Repositoryclaude-slim
Skill-Nummclaude-slim
Stären
44
Forks
5
Matgeliwwert Dateien
1
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 1 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    iops-leo huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Claude Slim an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/iops-leo/claude-slim/tree/main/skills/claude-slim
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/iops-leo/claude-slim.git /tmp/claude-slim
mkdir -p .claude/skills
cp -r /tmp/claude-slim/skills/claude-slim .claude/skills/claude-slim
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Claude Slim an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Claude Slim automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Claude Slim net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

claude-slim — Token Overhead Reducer

Analyze the user's Claude Code environment for token waste and perform non-destructive cleanup.

Subcommands

  • /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 doctor → check scanner prerequisites and session-log signal quality
  • /claude-slim check-update → report whether a newer version is published
  • /claude-slim restore → restore previously disabled items

Running the CLI

Every command block below opens with a claude_slim() resolver. It is repeated in full each time on purpose: each Bash invocation is a fresh shell, so a function defined in one block does not survive into the next. It resolves in three tiers — the plugin's own dist/cli.js when CLAUDE_PLUGIN_ROOT is set, then a claude-slim on PATH, then npx. That last tier is what makes the skill work when it was installed by npx skills add rather than claude plugin install, where no plugin root exists.

The npx tier pins a minimum version, not just a major. claude-slim@^2 looks safer but is worse: npx reuses any cached _npx install that satisfies the range and never re-checks the registry, so a machine that once fetched an older 2.x keeps running it — a security fix would never arrive. --prefer-online does not override this. Pinning to the exact release changes the cache key every time, which forces a fresh fetch while still refusing an unreviewed next major. npm run check:versions keeps this pin equal to package.json, so bump them together.

Do not shorten the name. A two-letter cs collides with claude-squad's binary, and a shell function is invisible to timeout, env, and xargs — a wrapped call would silently run that other program instead. Call claude_slim directly, never through a wrapper.


Phase 0 — Version gate (run before every scan)

An outdated claude-slim does not merely lack features — it reports wrong numbers. Versions before 2.8.0 summed memory across every project on disk and inflated the startup estimate roughly 8×; versions before 2.15.0 summed every topic file in the current project, when only MEMORY.md loads at startup — a 20× inflation on a memory-heavy project. Presenting those figures as fact is worse than not running at all, so check first:

bash
claude_slim(){ if [ -n "${CLAUDE_PLUGIN_ROOT:-}" ] && [ -f "$CLAUDE_PLUGIN_ROOT/dist/cli.js" ]; then node "$CLAUDE_PLUGIN_ROOT/dist/cli.js" "$@"; elif command -v claude-slim >/dev/null 2>&1; then claude-slim "$@"; else npx -y 'claude-slim@^2.16.2' "$@"; fi; }
claude_slim check-update --json

The check is cached for 24h and fails open — if it errors, times out, or returns "latest": null, proceed silently. Never block the user because a version lookup failed.

The response carries installMethod. When it is "npx" the gate is structurally inert — the CLI was just fetched at the tag it is being compared against, so outdated can never be true. Note that the version was resolved at run time and move on; do not present the gate as a safeguard it is not.

If "outdated": true, stop and tell the user before scanning:

설치된 claude-slim이 {installed}이고 최신은 {latest}입니다. 2.8.0 이전 버전은 시작 토큰을 약 8배 부풀려 보고합니다 — 지금 스캔하면 그 숫자가 나옵니다.

{upgradeCommand}

업데이트 후 진행할까요, 아니면 현재 버전으로 계속할까요?

Then honour their answer. If they choose to continue, run the scan but label the numbers as coming from an outdated version in your report.

Plugin installs need a restart (only when installMethod is "plugin"). claude plugin update writes the new version to disk, but the running session keeps the loaded copy. Tell the user this explicitly — otherwise they update, re-run, and see the same stale numbers with no idea why.

If "outdated": false, say nothing and continue to Phase 1.


Phase 1 — Scan

Run the CLI to collect environment data:

bash
claude_slim(){ if [ -n "${CLAUDE_PLUGIN_ROOT:-}" ] && [ -f "$CLAUDE_PLUGIN_ROOT/dist/cli.js" ]; then node "$CLAUDE_PLUGIN_ROOT/dist/cli.js" "$@"; elif command -v claude-slim >/dev/null 2>&1; then claude-slim "$@"; else npx -y 'claude-slim@^2.16.2' "$@"; fi; }
claude_slim scan --json

If that command fails for any reason — node missing, or the npx tier unable to reach the npm registry because the machine is offline or behind a proxy — fall back to the legacy bash scanner. It needs neither node nor a network:

bash
for d in "${CLAUDE_PLUGIN_ROOT:+$CLAUDE_PLUGIN_ROOT/skills/claude-slim}" "$HOME/.claude/skills/claude-slim" "./.claude/skills/claude-slim"; do
  [ -n "$d" ] || continue
  if [ -f "$d/scripts/scan.sh" ]; then bash "$d/scripts/scan.sh" json; exit $?; fi
done
echo "claude-slim: no scan.sh found in any known skill directory" >&2
exit 1

If this fails too, tell the user the scan could not run and stop. Never continue to Phase 2 without data: an empty scan is indistinguishable from a clean environment, and reporting zeros as fact is the one outcome worse than reporting nothing.


Phase 2 — Interpret & Present

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.

2-0. Two numbers that are not interchangeable

The JSON reports token counts in two different units, and mixing them produces savings figures larger than the entire thing being saved:

  • listingTokens (and totalTokensBefore, recoverableStartupTokens) — what a session pays at startup for the catalog line.
  • tokens on a skill or an issue — the whole SKILL.md body, paid only when that skill is actually invoked.

Issue.tokens is the second kind. Never sum it and call the result savings. On a real machine that sum was 215,535 against a 13,434-token startup total — 16× the whole budget. Use recoverableStartupTokens, which the CLI already computes with duplicates collapsed and the right unit.

Quote body tokens only when explaining what one skill costs per invocation, and label them that way.

2-1. Environment Snapshot Table

Show a summary table:

ItemCountTokens
Local skillsN (XKB)X tok
PluginsN (M skills)~X tok
CLAUDE.mdXKBX tok (+ X tok @path imports)
RulesN filesX tok at launch (X tok path-scoped)
Memory indexMEMORY.md XKBX tok at startup (currentProjectMemoryTokens)
Session startup overhead~X tok (totalTokensBefore)

Check currentProjectKnown before presenting memory numbers. When it is false, Claude Code holds no state for that slug. The 0 is correct, but it may be answering the wrong question — the slug can point at a plugin cache or a git worktree rather than the project the user meant. Say that no project state backs this path and offer --project-dir <path>, instead of presenting the 0 as a clean result. Do not assert the memory was lost: a directory Claude has never opened really does have none.

2-2. Plugin Detail Table

List each plugin with skill count and a judgment:

PluginSkillsNotes
omc36Core plugin. Keep.
temp_local_...1Failed install remnant. Cleanup target.

Annotate each with status: actively used, possibly unused, or cleanup target. Flag temp_local_* entries as failed install remnants.

2-3. Issue Analysis by Tier

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:

  • What is it and why it's flagged
  • What happens if you remove it (safe? any side effects?)
  • How many tokens it saves

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:

  • Show size and token cost
  • Judge whether the user likely uses it (based on what it does)
  • Recommend: keep if active, disable if rarely used

2-4. Recommended Actions

End with a numbered action list, ordered by impact:

  1. What to do first (highest token savings, lowest risk)
  2. What to consider
  3. What to leave alone and why

For total savings, quote recoverableStartupTokens and state it against totalTokensBefore ("~2,700 of ~13,400 startup tokens"). Do not add up the per-issue numbers — see 2-0. A skill flagged three times is one cleanup, and its body size is not a startup cost.

If subcommand is scan, stop here. Ask a localized equivalent of "Proceed with cleanup?" only for the full pipeline.


Phase 3 — Clean (full pipeline only)

Run the interactive clean command:

bash
claude_slim(){ if [ -n "${CLAUDE_PLUGIN_ROOT:-}" ] && [ -f "$CLAUDE_PLUGIN_ROOT/dist/cli.js" ]; then node "$CLAUDE_PLUGIN_ROOT/dist/cli.js" "$@"; elif command -v claude-slim >/dev/null 2>&1; then claude-slim "$@"; else npx -y 'claude-slim@^2.16.2' "$@"; fi; }
claude_slim clean

Or with dry-run:

bash
claude_slim(){ if [ -n "${CLAUDE_PLUGIN_ROOT:-}" ] && [ -f "$CLAUDE_PLUGIN_ROOT/dist/cli.js" ]; then node "$CLAUDE_PLUGIN_ROOT/dist/cli.js" "$@"; elif command -v claude-slim >/dev/null 2>&1; then claude-slim "$@"; else npx -y 'claude-slim@^2.16.2' "$@"; fi; }
claude_slim clean --dry-run

After cleanup, re-run scan to get updated numbers, then show the savings report:

bash
claude_slim(){ if [ -n "${CLAUDE_PLUGIN_ROOT:-}" ] && [ -f "$CLAUDE_PLUGIN_ROOT/dist/cli.js" ]; then node "$CLAUDE_PLUGIN_ROOT/dist/cli.js" "$@"; elif command -v claude-slim >/dev/null 2>&1; then claude-slim "$@"; else npx -y 'claude-slim@^2.16.2' "$@"; fi; }
claude_slim report

Present the report box AND the before/after breakdown table to the user.


Phase 4 — Restore

When /claude-slim restore is invoked:

bash
claude_slim(){ if [ -n "${CLAUDE_PLUGIN_ROOT:-}" ] && [ -f "$CLAUDE_PLUGIN_ROOT/dist/cli.js" ]; then node "$CLAUDE_PLUGIN_ROOT/dist/cli.js" "$@"; elif command -v claude-slim >/dev/null 2>&1; then claude-slim "$@"; else npx -y 'claude-slim@^2.16.2' "$@"; fi; }
claude_slim restore

Doctor

When /claude-slim doctor is invoked:

bash
claude_slim(){ if [ -n "${CLAUDE_PLUGIN_ROOT:-}" ] && [ -f "$CLAUDE_PLUGIN_ROOT/dist/cli.js" ]; then node "$CLAUDE_PLUGIN_ROOT/dist/cli.js" "$@"; elif command -v claude-slim >/dev/null 2>&1; then claude-slim "$@"; else npx -y 'claude-slim@^2.16.2' "$@"; fi; }
claude_slim doctor

Explain warnings in the user's language. Pay special attention to session-log warnings because they explain why unused-skill detection may be suppressed.


Language

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.

Rules

  1. Never delete user data. Skill directories and project memory are moved to ~/.claude/skills.disabled/; dead symlink files and failed-install temp_local_* caches are permanent cleanups and should be described that way.
  2. Never modify CLAUDE.md or settings.json.
  3. Never disable plugin-managed skills. Report only.
  4. Always confirm before executing. Use --dry-run to preview changes.
  5. If nothing to clean: respond "Already slim!" and exit.
  6. Always interpret results. Never dump raw CLI output without analysis. You are the diagnostic layer — the CLI is the data layer.

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Claude Slim?

Analyze and reduce Claude Code token overhead. Scans skills, plugins, memory files, and CLAUDE.md for bloat — then cleans up with user approval. Use when: /claude-slim, token optimization, reduce tokens, slim down, cleanup skills, token diet, save tokens, context diet

Firwat Claude Slim op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Claude Slim besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Claude Slim an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/iops-leo/claude-slim/tree/main/skills/claude-slim an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Claude Slim benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Claude Slim benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Claude Slim domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Claude Slim gratis?

Jo. iops-leo huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇