Token Diet: Audit What Claude Code Loads Every Session
You get: You know which always-loaded files cost context on every request, and you have a short list of documented trims to apply.
A free Claude Code kit that lists every CLAUDE.md, import, always-on rule and MCP server loaded at startup, flags files over 200 lines and suggests trims.
By Claudekit Team Editor Tran Quang Dong Published Checked 2 min read
Test level
Smoke tested Claude Code actually loaded the kit and ran one scripted task in a capped run, and the result passed our checks. How we test- Tested with
- Claude Code 2.1.290
- Tested on
- Setup time
- About 2 minutes
- For
- Developers
Latest lab run: · Smoke tested · Claude Code 2.1.290 · 19 of 19 checks passed
Show checks
- Passed: files (7 files, 15204 bytes)
- Passed: manifest (token-diet@0.1.0)
- Passed: manifest-paths (no custom paths)
- Passed: frontmatter (1 skills, agents and commands)
- Passed: hooks (no hooks)
- Passed: shell-syntax (3 scripts pass bash -n)
- Passed: secrets (11 Kiln Guard rules, no findings)
- Passed: network (every referenced host is allowlisted)
- Passed: destructive (4 command surfaces pass Kiln Guard)
- Passed: lab-spec (4 expectations, 2 scripts pass bash -n)
- Passed: marketplace (listed as token-diet)
- Passed: plugin-validate (1 files valid, 0 warnings)
- Passed: kit-tests (lab/test.sh passed)
- Passed: smoke-fixture (lab/fixture.sh ready)
- Passed: smoke-run (2 turns, $0.0682)
- Passed: expect:file-unchanged (CLAUDE.md unchanged)
- Passed: expect:result-matches (result matches 200)
- Passed: expect:result-matches (result matches (?i)skill)
- Passed: expect:result-matches (result matches /context)
Install
In a Claude Code session, add the Claudekit marketplace once, then install:
/plugin marketplace add claudekit-ai/kits
/plugin install token-diet@claudekit Or download the kit and start Claude Code in your project with it loaded for one session. No unzipping needed:
claude --plugin-dir ./token-diet.zip Or load it straight from our site:
claude --plugin-url https://claudekit.ai/kits/token-diet.zip A kit can run hooks with your permissions. Read its files before you install it.
Steps
- Download token-diet.zip and start Claude Code in your project with claude --plugin-dir ./token-diet.zip
- Run /token-diet:audit and approve the one Bash command it asks for
- Read the top three costs and the files flagged as over 200 lines
- Pick one suggested trim and let Claude show you the diff before it writes anything
- Run /context afterwards to see the real token counts
Token Diet is a free Claude Code kit that shows what loads into context at the start of every session, so you can see what to trim. Run /token-diet:audit and you get your always-loaded CLAUDE.md files with their sizes, the files they import, rules that load every time, skills and MCP servers, with any file over 200 lines flagged and a short list of fixes.
Every suggestion comes from Anthropic’s memory docs and costs guide, checked on 25 October 2026. The kit never guesses token counts; it points you to /context for those.
What it checks
| Loaded | What the audit lists |
|---|---|
| Every session | Your user CLAUDE.md, project CLAUDE.md, .claude/CLAUDE.md and CLAUDE.local.md in the project and every parent folder, the files they @import, and rules in .claude/rules/ without a paths: field |
| On demand | CLAUDE.md files in subfolders, path-scoped rules, skills |
| Tools | MCP servers in the project’s .mcp.json |
Then Claude suggests trims from a fixed list of documented levers: move workflow steps (release, migrations, PR review) into skills, which load only when invoked; move area-specific instructions into path-scoped rules; remove contradictions; disable unused MCP servers with /mcp; use /clear between unrelated tasks.
Setup, step by step
-
Download token-diet.zip.
-
Start Claude Code in your project with the kit loaded:
claude --plugin-dir ./token-diet.zipTo load it in every session, unzip it and move the
token-diet/folder into~/.claude/skills/. -
Run
/token-diet:audit. Claude can also start it on its own when you ask why usage is climbing.
Permissions it needs
- Bash, once, to run the bundled read-only audit script. Claude Code asks first.
- Reads instruction files in the project, its parent folders and your Claude config folder. Writes nothing and makes no network calls.
What we tested
- Static: 18 checks against a fixture project with a 247-line
CLAUDE.md, an import, one always-on rule, one path-scoped rule, a nestedCLAUDE.mdand three MCP servers. Every item was found and classified correctly, no token estimates were printed, and the files were unchanged afterwards. - Smoke: one real
claude -p "/token-diet:audit"run on Claude Code 2.1.290 with Sonnet, on 25 October 2026, on the same fixture. Claude flagged the file over 200 lines, suggested moving the release section into a skill and the migration rules into a path-scoped rule, pointed to/context, and changed nothing. - Not tested: MCP servers configured outside
.mcp.json(run/mcpfor those) and Windows.
Uninstall
Start Claude Code without --plugin-dir, or delete ~/.claude/skills/token-diet/.
Related
- How to reduce Claude token usage: every documented lever, in order of impact.
- CLAUDE.md guide: what belongs in the file and what does not.
- Claude Code context management:
/clear,/compactand/contextin practice.
Frequently asked questions
How long should CLAUDE.md be?
Anthropic's memory docs say to target under 200 lines per CLAUDE.md file, because longer files consume more context and reduce adherence. Move workflow steps into skills and area-specific rules into path-scoped files in .claude/rules/.
Do @imports reduce how much context CLAUDE.md uses?
No. Imported files load together with the CLAUDE.md that imports them, so they help organise a long file but do not reduce its context cost.
Does Token Diet show token counts?
No. It reports lines and bytes, because guessing tokens from file size would be an estimate. Run /context in Claude Code for real token counts, and /usage for what used your plan allowance.
Will it edit my CLAUDE.md?
Not on its own. The audit is read-only and ends with an offer to draft one change. Claude shows the diff and waits for your approval before writing anything.