The Context Budget Audit: Stop Paying Token Rent for Rules Your Agent Never Uses
19 October 2026 · Updated 28 November 2026 · 12 min read · by Yang Kai
Run a context budget audit on your Claude Code setup: list what loads every request, price it, and keep, move, or delete each rule with confidence.
Worksheet inside: Context-budget worksheet table
Contents
Your agent starts every session by re-reading instructions it may not need, and it pays for them again on every request. A deployment runbook for a migration that finished months ago. A brand-voice essay in a repo where the agent mostly fixes builds. Rules for a framework the project migrated away from. None of those lines are wrong — they are just always on, and always-on is the most expensive place an instruction can live.
A context budget audit is the discipline of pricing that rent. It lists everything that loads before you type, puts a token cost next to each item, and gives every block one of three verdicts: keep, move, or delete.
Below: what actually loads in current Claude Code (one layer changed recently, and it changes the maths), the worksheet to copy, the five steps of the audit, and the second, quieter cost that matters more than the bill.
The loading behaviour and figures here are checked against Anthropic’s Claude Code documentation, November 2026. The verdicts stay yours to make — the worksheet is built so a first pass takes under an hour.
The short version:
| Layer | Loads when | What the audit does with it |
|---|---|---|
| CLAUDE.md / AGENTS.md | Every session, in full | Price every block; keep, move, or delete |
| Auto memory (MEMORY.md) | First 200 lines or 25KB, every session | Skim for stale notes; promote or prune |
| Skill descriptions | Every session, roughly 100 tokens each | Remove dead skills; sharpen descriptions |
| MCP tools | Names and server instructions at start; schemas on demand | Check the load in /context; leave tool search on |
Rules in .claude/rules/ |
Only when matching files are touched | Move file-specific rules here |
What loads before you type
Instruction files load in full
Project instructions in CLAUDE.md load at the start of a session and stay in context for every request. User-level and managed-policy files load too, and files in parent directories load at launch while subdirectory files load on demand.
Since version 2.1.277, Claude Code can also read a repo’s AGENTS.md in place of CLAUDE.md. That makes the split in AGENTS.md vs CLAUDE.md worth deciding deliberately — the same rule written in both files is rent paid twice.
Run /context all in a session to see exactly which memory files loaded, listed under Memory files. Guessing is not necessary; the tool shows you the load.
Auto memory loads too — and nobody wrote it on purpose
Claude Code now keeps its own notes. Auto memory lives at ~/.claude/projects/<project>/memory/, and the first 200 lines or 25KB of its MEMORY.md index load at the start of every session, per Anthropic’s memory documentation.
Claude writes these notes itself, from your corrections and preferences. That makes the layer useful and unaudited by default: a note taken from one bad afternoon can steer sessions for months. The audit treats auto memory like any other standing context — open it with /memory, prune what is stale, and promote what has become a real rule into CLAUDE.md, where the team can see it. Agent memory patterns covers how the layers fit together.
Skills charge by the description
Skills behave differently from instruction files: only the name and description sit in context by default, and the body loads when a task matches. Anthropic’s skills documentation puts the always-loaded metadata at roughly 100 tokens per skill, with the body kept under 5,000 tokens and bundled files costing nothing until they are accessed.
That gap is the audit’s main lever. A 3,000-token procedure pasted into CLAUDE.md costs 3,000 tokens on every request. The same procedure as a skill costs about 100 tokens on requests that never use it.
MCP tools no longer load every schema
Older advice told you to count MCP servers carefully, because every tool schema loaded at startup. That changed: Claude Code now defers MCP tool definitions behind tool search. At session start, only tool names and each server’s instructions enter context — server instructions are capped at 4,096 characters — and a schema loads only when the agent searches for and uses that tool.
The old maths shows why the change matters. Anthropic’s advanced tool use write-up measured a five-server setup at 58 tools and roughly 55,000 tokens of definitions before the conversation even started. Under tool search, most of that cost is gone; what remains is the names, the server instructions, and the schemas of tools actually used. /context shows the current MCP load, and Claude Code with MCP workflows covers the setup side.
The window got bigger; the audit still matters
Current models have raised the ceiling. Per Anthropic’s model configuration documentation, Sonnet 5 and later, Opus 4.7 and later, and the Fable models run with a 1M-token window by default; older models offer 200K, or 1M through a [1m] variant, and CLAUDE_CODE_DISABLE_1M_CONTEXT=1 caps a session at 200K.
A bigger window changes the failure mode, not the need for the audit. Cost still scales with the context sent on each request, attention still gets divided among everything loaded, and auto-compaction now waits much longer before it cleans anything up — so bloat accumulates quietly for weeks instead of announcing itself. The rent is smaller per token of headroom. It is not zero, and the attention half of it did not change at all.
The conversation is the other half
Files the agent reads, command output, and your own long pasted briefs all accumulate inside the session. The audit focuses on the layers you control in advance, because those are the ones silently taxing every session — including the fresh one you start tomorrow.
The worksheet
Copy this table into a note or spreadsheet and fill in one row per instruction block in your setup. Estimates can be rough — paste the text into any token counter, or estimate from word count. The decision column is where the value is.
| Item | Loads when | Est. cost | Used in last 10 sessions? | Decision: keep / move / delete |
|---|---|---|---|---|
| Project purpose (3 lines) | Every request | Tiny | Yes, constantly | Keep in CLAUDE.md |
| Build / test / check commands | Every request | Small | Yes | Keep |
| Never-touch boundaries (.env, lockfile) | Every request | Small | Rarely triggered, but critical | Keep + enforce with hooks |
| Full article publishing checklist | Every request | Large | 2 of 10 sessions | Move to a skill |
| Deployment runbook | Every request | Large | 1 of 10 sessions | Move to a skill or docs |
| Brand voice essay | Every request | Medium | Only for content tasks | Move to content skill |
| Rules for the old framework | Every request | Medium | Never | Delete |
| Duplicated rules in AGENTS.md + CLAUDE.md | Every request, twice | Medium | Yes | Keep in one file only |
| Long example outputs | Every request | Large | Occasionally | Move one example into the skill |
| Auto memory notes from an old project phase | Every session (first 200 lines) | Medium | Partly stale | Prune; promote the durable rules |
| One chatty MCP server’s instructions | Every session | Small–medium | Server rarely used | Trim instructions or drop the server |
Two rows deserve comment. Boundaries are rarely “used,” but the cost of one failing once is high, so they stay always-loaded and get mechanical backup from 5 Claude Code hooks that catch the mistakes agents actually make. And “delete” is a legitimate outcome — instructions for tools, frameworks, or workflows you no longer use are pure rent.
Step 1: Inventory before you edit
Open CLAUDE.md, AGENTS.md, your auto memory file, and your skills folder, and list every block as a row. /context gives you the session-level breakdown by category, and the prompt audit built into /doctor covers your CLAUDE.md, CLAUDE.local.md, and AGENTS.md files plus the rules, skills, commands, and subagents under .claude/.
Do not edit yet. Editing during inventory turns into rewriting, and you lose the honest picture of what was loading.
Step 2: Price each row
A rough token estimate is enough. Paste each block into a token counter, or take the file sizes /context all reports and work from those.
You are looking for the two or three heavy items, not accounting precision. In most setups, a small number of long sections account for most of the always-on cost — the runbook, the checklist, the essay — while the lines the agent uses daily are short.
Step 3: Judge usage honestly
Think back over your recent sessions, or scroll your history, and mark how often each block actually influenced the work. The test is simple: did the agent need this in the last ten sessions?
Be strict about “it might be useful one day.” That is exactly what skills and docs are for — the instruction can exist without being always on.
Step 4: Keep, move, or delete
Keep means the block earns its rent weekly. It stays in CLAUDE.md, near the top, in plain language.
Move means the content is good but the placement is wrong. Procedures become skills, following the pattern in Claude Code skills, explained. Rules that only apply to one file type move to .claude/rules/ with paths frontmatter, so they load only when matching files are touched. Reference material becomes a doc the agent can be pointed to.
Delete means gone — not parked in a comment, not moved to a “someday” file. If the workflow returns, the instruction can be rewritten in minutes.
Step 5: Rebuild and compare
After the moves, start a fresh session and run /context again. Compare the grid with the one from Step 1: the standing load should be visibly smaller, and what remains should be the material the agent uses daily.
Then do a typical task. The setup should feel snappier and, more importantly, the agent’s attention should land on the rules that matter because there is less competition. The structure in the CLAUDE.md that actually works is what a post-audit file tends to look like.
The hidden cost: attention, not just tokens
Prompt caching softens the money side — standing context that repeats across requests is billed at cache rates, a fraction of the normal input price, and the Claude Code cost ladder has the current numbers. But caching does nothing for the second price: attention.
An agent juggling forty instructions weights each one less reliably than an agent holding twelve. Bloated setups show a recognisable failure mode — an obscure formatting rule followed perfectly while the build command two sections above it gets missed. Shorter, sharper instruction sets do not just cost less; they get followed more.
Session hygiene matters for the same reason. A long, wandering session accumulates its own context weight, which is part of the argument in subagents vs one long session and in the habits collected in Claude Code cost optimisation habits.
How often to re-audit
Run the full audit whenever you add a major workflow, migrate a tool, or notice yourself thinking “the agent used to follow instructions better.” That thought is usually context creep announcing itself.
Run a five-minute version monthly: skim CLAUDE.md, delete one dead rule, move one rare rule, glance at the top of MEMORY.md. Small, regular pruning beats an annual rewrite.
How we researched this
This article is desk research, checked November 2026. Loading behaviour, the auto memory limits, and the /context and /doctor behaviour come from Anthropic’s Claude Code documentation — the memory, context window, MCP, and skills pages. The 55,000-token MCP figure is Anthropic’s own measurement from its advanced tool use announcement. No setup was benchmarked for this article; the worksheet’s example costs are arithmetic illustrations, and your audit supplies the real numbers.
What to do next
Open your CLAUDE.md right now and build the worksheet for just the first ten blocks. Move the single largest rarely-used section into a skill, delete one dead rule, and start a fresh session to feel the difference.
For projects that run for months, context budgets for long projects adds the rolling handoff pattern that keeps old decisions available without paying for them daily. The audited files this approach produces — a lean CLAUDE.md, the skills, the worksheets — are bundled in the Claude Code Workflow Pack.
Learn more:
- Context budgets for long projects
- Claude Code cost optimisation habits
- Claude Code skills, explained
- Agent memory patterns
FAQ
What counts as standing context? Anything loaded before you type a word: instruction files, auto memory, skill descriptions, MCP tool names and server instructions, and system-level additions. It is re-sent on every request, so its cost multiplies by session length.
How do I measure what each piece costs?
Start with /context, which breaks the current session down by category and lists the memory files that loaded, and /context all for the expanded view. For a single block, any token counter gives a close enough figure; the worksheet turns the numbers into decisions.
What should move out of CLAUDE.md first?
Long reference material and task-specific procedures. Reference belongs in docs the agent opens when needed; procedures belong in skills, which load only on a matching task; file-specific rules belong in .claude/rules/.
My model has a 1M-token window. Is this still worth doing? Yes, for the two reasons that are not about space. Every request still carries the standing load, so the cost argument survives at any window size, and the attention argument is untouched — forty competing instructions are forty competing instructions in a million-token window too. The audit is cheaper to run than the bloat is to keep.
Does prompt caching make a big CLAUDE.md free?
No. Caching cuts the per-request price of repeated context, but the tokens still occupy the window and still compete for the agent’s attention. It is telling that /usage itself recommends trimming a large CLAUDE.md.
How often should I re-run the audit? Monthly, or whenever you add a tool or a file. Context creep is gradual — no single addition looks like the problem, which is why the audit is a habit, not a one-off fix.
Category: Claude Code & Context Engineering · Tags: #claude-code #context-engineering #claude-md #skills #checklist
Next step: this article is part of Claude Code guides, which covers the full topic from first setup to advanced use.