A long coding agent session uses a lot because the full conversation travels with every request, and each tool call sends another request with its results. Cache misses after breaks, scheduled tasks, subagents and compaction add more. The fix is to keep context small, clear between tasks and know what runs in the background.
The documented causes
Anthropic's cost page for its coding tool has a section titled why usage climbs in a long session. It lists these causes, which are worth knowing by name.
| Cause | What happens | Fix |
|---|---|---|
| Long context | The full conversation is sent with every request, and each tool use sends another request with its results | Clear between unrelated tasks, keep context small |
| Cache misses | The first message after a break longer than the cache lifetime reprocesses the full context | Work in bursts, know the lifetime for your plan |
| Scheduled tasks | A task fires on its interval even when the session is idle, sending full context each time | Review and stop tasks you do not need |
| Cross-session messages | A message from another session starts a new turn, sending full context | Hold inbound messages if appropriate |
| Goal check-ins | Idle check-ins start new turns that send full context | Cap or turn off check-ins |
| Subagents and workflows | Each sends its own requests on top of the main conversation | Choose smaller models for them |
| Agent teammates | Each active teammate keeps consuming tokens until it exits | Shut down teammates when done |
| Compaction | Compacting reads the conversation it summarizes, so it is itself a large request | Use a fresh session when you do not need continuity |
The page also notes that a one-line question in a session that has been open all day still draws usage for the whole conversation, even though caching makes the repeated history cheaper to read.
The cache lifetime detail
According to the page, the cache lifetime is an hour on a subscription and drops to five minutes once you are drawing on usage credits, and on an API key or cloud provider it is five minutes by default. The practical effect is that coming back from a coffee break can cost more than a quick follow-up, depending on how you are signed in. Look up the current value for your setup.
How to find what is using your allowance
The page describes a usage command whose breakdown, on plan routes, attributes recent usage to skills, subagents, plugins and individual MCP servers, flags behaviors such as long context or cache misses when one accounts for ten percent or more of recent usage, and lists the heaviest scheduled loops. It also shows prompt cache statistics, including the share of input tokens served from cache and recent misses with a likely cause when one can be identified. Run it before you change habits, so you fix the biggest item first. The page notes the figures are approximate and computed from local session history on one machine.
Worked example: a quiet afternoon that used a lot
This example is illustrative. A developer leaves a session open from morning. It contains a large file read, a long test log and several experiments. Over lunch, a scheduled task fires every ten minutes, each time sending the full context. After lunch the developer asks one short question.
The usage breakdown flags long context and shows the scheduled task near the top of the loops list. The fixes: stop the scheduled task, clear the session with a note to resume later, and move future log reading into a filtered step so only errors enter context.
Habits that help
- Clear between unrelated tasks. The page says stale context wastes tokens on every later message.
- Add compaction instructions so the summary keeps what matters.
- Match the model to the job, and use lighter models for simple subagent tasks.
- Keep tool lists small. See do MCP tool definitions cost tokens.
- Preprocess noisy output. The page suggests a hook that filters test output to failures, turning tens of thousands of tokens into hundreds.
- Keep project instruction files short and move workflow detail to on-demand skills.
- Use plan mode and specific prompts to avoid wasted exploration.
For a fuller habits list see reduce Claude Code token usage.
Teams and governance
If many developers hit limits, look at fleet settings rather than lecturing people. Administrators can control some background behaviors through managed settings. And pair usage review with security review: the same background features that spend tokens also act on your code, so know which are enabled. See managed settings.
A weekly habit
Once a week, run the usage breakdown on your own machine and look at the top two items. If long context leads, set a reminder to clear between tasks. If cache misses lead, try working in tighter bursts. If a scheduled task leads, ask whether it still earns its keep. Make one change, measure the next week and keep what helps. Small, regular adjustments usually beat a one time cleanup, because the cause of heavy use shifts as projects change.
For teams, share a monthly note of what you learned, so the lessons spread beyond the person who found them.
What this means for you
If you use a coding agent every day, your biggest lever is the shape of your sessions, not the plan you pay for. A session that stays open for hours carries everything that happened in it. The model does not remember in the way a person does. Each request replays the whole conversation, so every old file read, test log and dead end rides along with every new question.
The good news is that this is easy to change. You can finish a task, write down where you stopped, clear the session and start fresh. You lose nothing important, because the files and commits hold the real state of the work. What you gain is a small context, so each request carries only what the next step needs.
Common mistakes
The first mistake is treating one long session as a sign of progress. Length is a cost, not a trophy. The second is leaving scheduled tasks and check-ins running when you are away from the keyboard, then wondering why the allowance fell. The third is reading whole log files into the conversation when a filter would show only the failures. The fourth is spawning helpers for small jobs, since each helper sends its own requests. The fifth is returning to a stale session after a long break and expecting the first message to cost the same as the others, when a miss on the cache can make it cost more.
A step by step reset routine
- Before you stop for the day, ask the agent for a short summary of what is done and what is next, and save it in a notes file in the repository.
- Rename the session so you can find it later, then clear it.
- When you return, start a new session and point it at the notes file and the two or three files that matter.
- Run the usage breakdown once a week and look at which item leads.
- Stop any scheduled task whose output nobody reads.
- Share what worked in your team channel, so others can copy it.
This routine takes five minutes a day and usually pays for itself within the first long task.
Try it yourself
Click through it at your own pace, or open it full screen. It walks through an assistant working through a task. Count the steps and tool results, and picture each one being carried into every later request.
Quick check
Does a short question in a long session cost little?
Not necessarily. The page says a one-line question in a session open all day still draws usage for the whole conversation.
Why did my first message after a break use so much?
A break longer than the cache lifetime causes a cache miss, so the full context is reprocessed.
Can background features use my limit?
Yes. The page lists scheduled tasks, cross-session messages, goal check-ins, subagents and teammates as sources of usage while a session is idle or delegated.
Sources
Last reviewed: 19 October 2026.