Jakob Christensen / Cases#001#002#003#004
7 Rules + 7 Habits to reduce Agent Usage
Relevant skills: /cheap-agents, /fresh, /lanes, /measure-ui, /lie-detector, /blindfold
Coding agents use up a subscription limit fast. To see where mine went, I had a script read every Claude Code session on my computer from 7 October to 1 December 2026, 2,649 of them. A session is one conversation with the agent, from the first message until I close it. These 7 rules and 7 habits are what I took from the results. By usage I mean how much of the limit a conversation eats up, which I estimated at API prices. The numbers show where usage went, not what a rule would save, because I did not measure savings. Under several rules you will find a skill: a file of instructions the agent follows when a task fits it, or when you type its name, for example /fresh.
Rule of thumbUsage ≈ number of requests × average conversation lengthbecause every request re-reads the whole conversation.
Example
A request is each time the agent sends the conversation to the model. That happens for every reply and every tool step, and each time the whole conversation so far (the context) goes along. Claude Code keeps a temporary copy of it (the cache) that makes re-reading cheaper, but only until the copy expires. Reading from the cache is cheap, writing the context into it again costs more. Here is how five requests in a row add up:
Why a long conversation costs so much
- read again: everything said so far
- new
Real conversations look the same, only longer. In my sessions the median request carried 139k tokens of context, and one in ten carried more than 329k. A token is a small piece of text, about three quarters of a word.
Rules for your agent (paste into CLAUDE.md or AGENTS.md)
CLAUDE.md or AGENTS.md is the file of standing instructions your agent reads at the start of every session. Paste the rules there, or download them.
-
Move long conversations to a fresh session
When I tell you the context is large (about 150k tokens), or when a long task reaches a natural break, write a handoff file and suggest continuing in a fresh session.
A handoff file is a short summary of the state, written so a fresh session can continue. You see the context size with /context in Claude Code, or in the status line, the bar at the bottom.
Skill: /fresh notices a long session, writes a handoff file and moves the work to a new session. Four of its summary rules come from Matt Pocock's fantastic /handoff skill.
Why
Every request re-reads the whole conversation, so the longer it gets, the more each request costs.
46 %of all usage in my sessions came from requests carrying more than 150k tokens.
-
Keep long output out of the conversation
Run only the tests that cover the changed files (for example `vitest related --run <files>`), and the project's full test and lint run before merging. Write long output to a log file and read only the relevant lines, not the whole file.
Why
Whatever the agent reads is sent again with every later request.
21 %of everything sent in my sessions was tool results: command output and file contents (an estimate). Test output was only about 1 % of those results.
-
Measure layouts, don't screenshot them
When working on a web page's layout, check it with measured element sizes and positions (for example getBoundingClientRect) and take one screenshot at the end.
Skill: /measure-ui checks a page's layout with measured element sizes and positions instead of screenshots.
Why
A screenshot is large and stays in the conversation. Once too many pile up, Claude Code drops the oldest ones, and the next request processes the conversation anew from that point instead of reading it from the cache.
5 %of everything sent in my sessions was images (an estimate).
-
Give every helper the cheapest model that does the job
When you start a helper agent, set its model explicitly: Haiku (small) for search and reading, Sonnet (mid-size) at medium effort for building from a clear brief, the largest model only for design and coordination. Say the model and the number of helpers before starting them: each helper has its own context.
A helper agent is a second agent the main one starts for a side job. Haiku, Sonnet and Opus are Claude models, from small to large. Effort is a setting for how long the model thinks before it answers.
Skill: /cheap-agents decides whether a helper is worth starting and picks the cheapest model that does its job.
Why
Each helper runs on its own model, so a big one costs on every request it makes. All helpers together made 12 % of my usage.
2.5×is about what a request by an Opus helper cost, compared with one by a Sonnet helper, across my sessions.
-
Search first, then call helpers
Search yourself first. Start helpers only for what your search did not find, and have them report paths and line numbers.
Why
Every helper adds requests of its own on top of the main conversation's.
13 to 20requests is what a typical Sonnet or Opus helper made in my sessions.
-
Never wait in a loop
Never poll (check again and again). Run long commands in the background, end your reply, and let the notification wake the session when the command finishes.
Why
Each time the agent checks whether a command is done, it sends a new request that carries the whole conversation. In my sessions this share was small.
0.6 %of my usage went to requests whose only action was a sleep command (a command that just waits). Other ways of waiting are not counted.
-
One worktree per parallel session
If you run several sessions on one repository at the same time, give each its own worktree and branch (`claude --worktree <name>`), and merge one branch at a time into the main branch.
A worktree is a second folder for the same project (repository), on its own branch (a separate line of changes).
Skill: /lanes gives each parallel session its own worktree and branch.
Why
Two sessions working in the same folder can overwrite each other's changes, and repairing that costs extra requests. I did not measure how many.
Habits for you (an agent cannot do these)
-
Pick the model before you start
Pick model and effort at the start of a session. A model switch mid-session loses the cache. An effort change does not on current models (see Claims checked).
The cache is the temporary copy of the context that makes re-reading cheap, until it expires (see the example at the top).
Why
A new model cannot use the old model's cache, so the whole context is written into the cache again, and a write costs more than a read. Such requests were rare in my sessions: 0.5 % of usage.
70 %of the context was written into the cache again by a request right after a switch in my sessions, against 1 % otherwise.
-
One part, one session
When a task has several separate parts, give each part its own fresh session.
Why
A new part of a task rarely needs the old conversation, but if you stay in the same session, every request carries it along.
-
After a long break, start fresh
After a break of over an hour in a long conversation, start fresh from a handoff file. What counts as long is your call. I use about 100k tokens.
Skill: /fresh also resumes work from a handoff file after a long pause.
Why
On a subscription the cache of the main conversation expires after one hour, so after a longer pause the whole context is written again. Such requests made up 4.5 % of usage.
71 %of the context was written again by a request after a pause of an hour or more in my sessions. It cost about 13 times as much as one within five minutes.
-
Compact while the cache is still valid
Compact (summarise the conversation) at natural breaks while the cache is still valid, never right after a long pause. Use /rewind to drop a dead end, /clear for an empty conversation.
Why
Compacting means the agent reads the whole conversation to summarise it. That is cheap while the cache is still valid and expensive once it has expired.
-
Keep always-loaded rule files short
Keep the rule files the agent loads at the start of every session short: a small index file that points to topic files, which are read only when needed.
Why
Every line of a file that loads at the start of each session goes out with every request.
-
Switch off unused MCP servers
Turn off MCP servers you do not use.
An MCP server is a connection that gives the agent access to an external tool.
Why
On supported models their tools are loaded only when a task needs them, so unused servers cost little. Otherwise the description of every tool (what it does and how to call it) goes out with each request.
-
Watch the cache hit rate
Check the cache hit rate with /usage (Claude Code v2.1.251 or later, main conversation only).
Why
The cache hit rate is the share of the context that was read from the cache instead of written again. A low rate means you pay the higher write price too often.
The details
Claims checked
Four statements that sound plausible, each checked against the documentation or my own measurements.
| Claim | Documented or measured |
|---|---|
| Helper agents save usage. | Each helper has its own context. Across my sessions, helpers made 12 % of usage. Whether the same work without them would have cost less was not measured. |
| /compact always saves. | It reads the whole conversation: cheap while the cache is still valid, full price once it expired. |
| Changing effort costs the cache. | Not on Fable 5.1 and later (Fable is the Claude model line for the hardest and longest tasks), Opus 5.5, Sonnet 5.5 and Haiku 5.5. A model switch mid-session does. |
| More rules make a better agent. | Every line of an always-loaded file is sent with every request. |
Settings worth knowing
| Cache lifetime | promptCacheTtl (main conversation) and subagentPromptCacheTtl (everything else), each 5m or 1h, Claude Code v2.1.242 or later. On a subscription the main conversation gets one hour, helpers and compaction (summarising the conversation) get five minutes. |
|---|---|
| Silent drop to 5 min | Once your plan's usage limit is used up and Claude Code draws on usage credits (extra usage billed beyond the plan limit), the main conversation drops from a 1-hour to a 5-minute cache. To keep 1 hour, set promptCacheTtl to "1h". |
| Actions that reset the cache without warning | Switching fast mode (a faster setting at a higher cost per token, with its own cache), reloading plugins (/reload-plugins), denying a whole tool, updating Claude Code. |
| /usage | Breaks usage down by skills, helper agents (Claude Code calls them subagents), plugins and MCP servers. |
How the numbers were measured
Summary
- All my local Claude Code transcripts from 2026-10-07 to 2026-12-01 were read by script: 2,649 sessions with 167,649 requests. Each token is counted at what it would cost through the paid API (the API list price per model), so every share is an estimate.
- A single session can differ a lot from the whole. One long session made up an estimated 32 % of my usage in the 7 days before it ended, and helpers made 83 % of it, against 12 % across all sessions.
Measurements
| Sessions | 2,649 |
|---|---|
| Requests | 167,649 (143,781 main conversation, 23,868 helpers) |
| Context per request (main conversation) | median (middle value) 139k tokens, one in ten above 329k |
| Requests over 150k tokens | 41 % of main-conversation requests, 46 % of all usage |
| Cache hit rate (main conversation) | 98 % |
| Requests after a pause of 1 h or more | 4.5 % of all usage |
| Largest tenth of sessions | 64 % of all usage |
| Rule of thumb | requests × average context matched 98 % of the differences in usage between 2,317 sessions with 5 or more requests (partly by construction) |
All numbers are estimated from the local transcripts (the .jsonl files Claude Code stores under ~/.claude/projects, one per conversation and per helper agent). Each token is counted at its API list price per model. Shares are not amounts paid. Shares are weighted by price, so the 98 % cache hit rate (the share of tokens read from the cache) and the 33.4 % of usage that went to cache writes (which cost more per token) do not contradict each other. Claude Code writes some requests into the transcript more than once. Each was counted only once. Writing to the cache costs more when the cache is kept for one hour than for five minutes. I priced each write by the kind the transcript records. Uncached input is 0.0 % because nearly all input was served from or written to the cache. Where Claude Code records its own cost for a session (1,138 sessions), my estimate matched it at the median.
The sizes of tool results and images are rougher: four characters of text count as one token, images are counted by their pixel size, and each result counts again for every later request until the conversation is compacted. A script of mine shortens some long shell output, so those sizes may be low.
The 100k and 150k token marks are working values, not documented limits: 100k is my rule of thumb for "long", 150k the point to switch.
Where the usage went, all sessions
By agent
- Opus main conversation 61.1 %
- Sonnet main conversation 22.2 %
- Helpers of all models 11.9 %
- Fable and Haiku main conversation 4.8 %
By token type
- Cache reads 47.3 %
- Cache writes 33.4 %
- Output 19.3 %
- Input 0.0 %
Notes
- Polling: only requests whose one action was a sleep in the foreground of the shell are counted. Such sleeps were 2.2 % of 98,753 shell calls. Waiting through other tools (monitors, listing sessions) is not counted.
- Always loaded: CLAUDE.md here and in the folders above, rule files without a
pathsfilter, the first 200 lines or 25 KB of MEMORY.md. Codex and Antigravity are two other coding agents. Codex caps its AGENTS.md chain with a size limit (project_doc_max_bytes), and Antigravity at 24,000 bytes per rule file and 20,000 tokens for all always-on rules. - Loaded only when needed: CLAUDE.md files in subfolders, rule files with a
pathsfilter, memory topic files. MCP tools (tools from external connectors) are by default loaded only when a task needs them, so toggling a server mid-session keeps the cache. With preloaded tools it does not. Plugin skills, commands, agents and hooks never invalidate the cache. MEMORY.md is the index of the memory folder.
Method and limitations
- All shares on this page are estimates at API prices, not what the subscription limit counted. Anthropic does not document how the limit weighs each kind of token, so a share of usage here is not a share of a weekly limit.
- These are the sessions of one person, with my kind of work, my projects and my settings.
- The shares show where usage went, not what a rule would save. I did not measure savings: that would need the same work done twice, with and without a rule.
- The worktree rule was not measured.
Sources
- How Claude Code uses prompt caching
- How Claude remembers your project
- Anthropic pricing page, API list prices per model
- Manage costs effectively, /usage breakdown
- Codex: AGENTS.md, size limit
- Antigravity: rules, size limits
- Matt Pocock: /handoff