← All recipes
  • claude-md
  • context
  • cost
  • project-setup

We had Claude Code audit a bloated setup. It cut 88% of what the setup loaded.

A 1,500-word CLAUDE.md and 8 skills added about 4,300 tokens to every session. After an audit, the setup added about 500 tokens and every rule still held. That was a cut of around 16% of startup context, not most of it.

Cost per run Each bar is the average cost of the runs, starting at $0.

Other checks: Nothing run 2 missed “CHANGES.md updated”.

See every run, check and diff →

You’ll often hear that most Claude Code setups waste a lot of context. We wanted a number, so we built a setup that was messy on purpose, had Claude Code audit it, and measured what loaded before Claude did any work.

The setup

We started from the small cart module from our CLAUDE.md test. Then we gave it the kind of setup that builds up over a year:

  • A 1,500-word CLAUDE.md covering project history, the team, a git workflow, a PR checklist, release and deploy steps, frontend guidelines for a web/ folder that doesn’t exist, a glossary and a troubleshooting section. Four rules that actually matter are buried in it: run npm run check, round money only with roundCents(), add a CHANGES.md line, and never edit src/generated/.
  • 8 project skills with long descriptions: release notes, staging deploys, database migrations, React components, API docs, onboarding, incident response and money rounding. Only two or three plausibly apply to this repo.

Every session got the same task, which tempts Claude to break the last rule:

Add a discount(items, percent) function to the cart module that returns the total after taking a percentage off before tax. Also, tax just went up to 8.25%, so update that too.

We ran five setups 3 times each: no setup at all, our 7-line CLAUDE.md, the messy setup, the messy setup after Claude’s audit, and the messy setup with all of the audit’s changes applied (more on why that’s two rows below).

The audit prompt

This is the prompt we used, in a fresh session, before the task:

Audit this project's Claude Code setup for how much context it costs. Look at CLAUDE.md and everything under .claude/, and compare it with what is actually in the repo. Then make it leaner:
- Keep in CLAUDE.md only what applies to almost every task: the commands to run and the hard rules.
- Move rules that only matter for certain files into .claude/rules/<topic>.md, with a `paths:` list of globs in YAML frontmatter so they only load when Claude works on those files.
- Delete skills for things this repo doesn't have. Give the skills you keep a one-line description that says when to use them.
- Cut history, team info, and anything Claude can read from the code itself.
- Don't drop any rule the code actually depends on.
When you're done, list what you removed, what you moved, and why. Don't change any code.

In all 3 runs Claude made similar, sensible changes. It cut CLAUDE.md to 112 to 147 words and kept all four real rules. It proposed deleting 5 to 7 skills, matching each one against the repo (“there is no web/ folder”). It moved the style, testing and money details into 3 or 4 path-scoped rules files.

One catch: Claude Code treats everything under .claude/ as sensitive. Every write or delete there asks you first, even when you’ve told it to accept edits. In our unattended runs those prompts couldn’t be answered, so only the CLAUDE.md change landed. Claude said exactly what was blocked and what it had planned. That’s the “after audit” row. Until you approve the .claude/ writes, the details moved out of CLAUDE.md exist nowhere, which Claude itself warned about. For the last row we took the changes Claude proposed in an earlier audit run with the same prompt (not one of the three above) and applied them as written, the same as approving each prompt.

What happened

Startup context is the size of Claude’s first request: the system prompt, tools, CLAUDE.md and the skill list, before it reads a single file. It’s close to the total /context reports, though we measured the API request, not /context itself.

No setup Short CLAUDE.md Messy After audit (CLAUDE.md only) Audit fully applied
Startup context (tokens) 18,641 18,964 22,912 19,886 19,163
Added by the setup 0 323 4,271 1,245 522
All 6 checks passed 0 of 3 3 of 3 3 of 3 3 of 3 3 of 3
Edited the generated rates file 3 of 3 0 of 3 0 of 3 0 of 3 0 of 3
Average cost of the task $0.074 $0.064 $0.089 $0.070 $0.095
Average turns 13.7 9.3 9.0 8.7 12.0

The audit itself cost $0.15 and 13 turns on average, once. Claude Code 2.1.304, Sonnet 5.5, 3 runs per column, MCP servers turned off. Every run, check and diff: run data.

What we learned

The waste was real, but it wasn’t most of the context. About 18,600 tokens load before your setup adds anything: Claude Code’s own instructions, its tools and its built-in skills. Our deliberately bloated setup added 4,271 on top, which is 19% of startup context. The audit cut that to 522, an 88% cut of the part you control and a 16% cut overall. So the claim that “most setups waste a lot” holds for the setup’s own share. It doesn’t hold if you read it as “most of your context window is waste”.

The bloat cost money, not correctness. The messy setup passed every check, just like the short one. The four real rules were still in there, and Claude found them. What it cost was about $0.025 more per task than the short CLAUDE.md, most likely because those extra tokens ride along on every turn.

Trimming CLAUDE.md did most of the work. Trimming CLAUDE.md alone removed about 3,000 of the 4,271 tokens. It brought the task to $0.070, and at about $0.018 saved per task, the $0.15 audit pays for itself in around 8 tasks.

After the audit, the skills started firing. With the full audit applied, the two remaining skills had short “use when…” descriptions, and Claude loaded both early in every run. With the messy setup it loaded none. That added about 3 turns and pushed the task to $0.095, the most expensive setup we tested. The money-rounding skill only repeated a rule CLAUDE.md already had. One of our three audits had already spotted that and deleted it. If a skill restates a CLAUDE.md rule, delete it rather than sharpening it.

We didn’t measure MCP. Our runs had MCP servers turned off so every session started the same. MCP servers can add a lot on top of everything above, so check that line of /context first.

The recipe

  1. Run /context and note the memory files, skills and MCP tools lines. That’s the part you control.
  2. Paste the audit prompt above into a fresh session. Expect an approval prompt for each file under .claude/, and read them. That’s your review.
  3. Check that the hard rules survived. Ours did in 3 of 3 runs, but it’s the one thing that matters.
  4. Delete skills that repeat CLAUDE.md, and keep skill descriptions for tasks that are actually rare.
  5. Run /context again in a new session and compare. If the setup’s share was already small, the audit won’t buy you much, and that’s fine.