Context Budget Strategies
Spend Wisely Instead of Wasting
You now know how to tidy up your desk. But real pros go one step further: They plan in advance how to allocate their context budget -- before they type the first line.
Subagents: The Intern with Their Own Desk
Imagine you have an intern. You can send them off to research something. They go to their own desk, dig through documents, and come back with a short result. Your desk stays clean.
That is exactly how Subagents work in Claude Code. When you ask Claude to research or analyze something, it can start a separate agent that works in its own context. Only the result lands in your main context.
> Find all places in the project where we use user authentication,
and summarize which patterns we are using.
Claude often recognizes on its own when a subagent makes sense. But you can also explicitly instruct it:
> Use a subagent to search through the entire API documentation
and summarize only the relevant endpoints for user management.
*Why Subagents Are So Powerful
A subagent can search through hundreds of files without a single one landing in your main context. You only get the distilled summary -- that saves an enormous amount of context budget.
One Task Per Session
The simplest and most effective strategy: One task, one session, one tidy desk.
Not:
- Fix bug, then build feature, then write docs -- all in one session
Instead:
- Fix bug -->
/clear - Build feature -->
/clear - Write docs --> done
Each task gets a fresh context. It sounds obvious, but the temptation is great to just keep going. "Just this one more thing..." -- and suddenly the context is at 90%.
MCP Tool Search: Deferred Loading
If you have MCP servers configured (for example, for GitHub, Linear, or Jira), their tool definitions load into the context at startup. This can cost enormously:
- GitHub MCP without optimization: ~77,000 tokens just for tool definitions
- GitHub MCP with Deferred Loading: ~8,700 tokens
The difference? Almost 70,000 tokens saved -- that is more than a third of the entire context window.
iHow to Activate Deferred Loading
In your MCP configuration, you can mark tools as "deferred." They are then not loaded at startup but only on demand. Claude automatically searches for the matching tool when it is needed.
You configure this in your .claude/settings.json:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"toolConfiguration": {
"defaultMode": "deferred"
}
}
}
}
Checkpoints and Rewind: Save Points
Do you know save points in video games? Before you fight the boss, you save. If you die, you load the save point and try again.
Claude Code has a similar concept: Checkpoints. Each step in the conversation automatically creates a point you can jump back to.
Esc+Escjumps to the last checkpoint- You can also jump back multiple times to go further into the past
This is especially useful when Claude has pursued a wrong approach. Instead of leaving the error in the context and building on it, you jump back and give a better instruction.
!Context Cost of Mistakes
A failed attempt burdens your context twice: once for the instruction, once for the wrong solution. With Rewind, you save those tokens completely.
Session Continuation: /continue and /resume
Sometimes work gets interrupted -- your terminal crashes, you have to go to a meeting, or the computer restarts. No problem:
claude --continue(or/continuein chat) -- continues the last conversation in the current projectclaude --resume(or/resume) -- shows a list of all previous sessions for you to choose from
The context of the previous session is restored. You pick up exactly where you left off.
# Continue last session directly
claude --continue
# Choose from list
claude --resume
*Session Strategy
You can deliberately use sessions as "work packages." One session per feature branch, one session per bug. With /resume, you jump between them without mixing the context.
The Golden Rules
- New task =
/clear-- Always - Big research = Subagent -- Your context stays clean
- MCP tools = Deferred Loading -- Save thousands of tokens at startup
- Wrong path = Rewind -- Instead of leaving the error in the context
- Session interrupted =
/continue-- Nothing is lost