Skip to main content

Context Budget

The context window is shared by everything the model reads. Some of it is there before you type a word. This page counts that start. It shows what each tool and setting adds. It lists ways to keep it small. For compaction and what fills the window later, see Context and Compaction.

Your Numbers May Differ

All numbers come from one subscription account on 2026-10-21, with Claude Code 2.1.305 on Opus 5.5 unless a row says otherwise. Anthropic turns some tools on or off per account from its servers. For example, ListAgents and ScheduleWakeup are gated. A server-side list can defer Workflow and ReportFindings (see Tools). Another account, plan, or date can get a different tool list and different totals. Run /context to see your own numbers.

What an Empty Session Holds​

Method: live runs on 2.1.305 with a subscription login, a fresh config folder, and an empty project (a README.md only, no git repo). We ran claude -p "/context" --output-format stream-json. We read the context_usage object. For the second column we ran claude -p "Reply with 'OK'." (the reply was exactly OK in every run). Then we ran claude -p --continue "/context". All numbers are tokens on Opus 5.5. See Probes. Source: the program (

Undocumented: Only the program shows this item. It can change without notice.
).

CategoryEmptyAfter Reply with 'OK'.
System prompt2,4072,407
System tools (loaded)7,8977,962
System tools (deferred, not in the total)13,42513,425
Skills (listing)2,2102,210
Messages103,698
Total12,52416,277

The window is 1,000,000 tokens on Opus, Sonnet, and Haiku 5.5. The autocompact buffer is 33,000 tokens. See Context and Compaction for the levels.

Messages jump by about 3.7k on the first turn. The first request carries injected content as messages:

  • a system reminder about git attribution
  • an environment block (working folder, platform, model, knowledge cutoff)
  • the names of the deferred tools
  • the "Available agent types" list (claude, Explore, general-purpose, Plan, statusline-setup)
  • the skills listing

Your own prompt (Reply with 'OK'.) is a few tokens. See the captured first-turn messages.

The real first request matched /context exactly: input 2, cache write 5,441, and cache read 10,834 make 16,277. Reruns on 2.1.306, 2.1.307, 2.1.308, 2.1.309, 2.1.310, and 2.1.311 matched the same way: input, cache write, and cache read of the first reply added up to the /context total. Those runs used the default model, claude-sonnet-5-5, and a warm cache, so their counts are not shown here. They listed the same categories, no memory files, no agents, and no MCP tools. See Probes. The split between cache write and cache read depends on the cache, not on the request. A subscription login writes with a 1-hour lifetime. So another session on the account with the same tools and system prompt within the last hour lets this one read them. A cold first request wrote almost all of it and read nothing. /context itself only calls the token counting endpoint, so it does not run a model turn. We checked this: claude -p "/context" against the stub sent 24 requests to /v1/messages/count_tokens and none to /v1/messages.

What Each Tool Costs​

We removed one tool at a time from the default set with --disallowedTools <tool>. We read the new total of the empty session (12,524). We did not run a tool alone with --tools. Those numbers carry shared overhead and mislead.

RemovedNew totalChangeNotes
Workflow10,555-1,969
ScheduleWakeup10,849-1,675
Agent11,204-1,320
ReportFindings11,717-807
Read11,818-706
ListAgents12,179-345
Edit12,184-340
Write12,294-230
Bash12,908+384The program adds Glob and Grep in its place. So the loaded tools rise to 8,273.
Skill18,123+5,599The skills listing goes. The Workflow tool (description and schema) grows from 5,313 to 22,089 characters. With no Skill tool to load the workflow-authoring skill, the program puts that guidance in the tool text.
ToolSearch28,422+15,898Every deferred tool loads (deferred 0, tools 23,781).
WebSearch (deferred)12,394-130The deferred pool shrinks, 13,425 to 13,190. The system prompt was also 128 tokens smaller in this run.

The system prompt line moved between 2,277 and 2,427 across these runs. So each Change has some noise (10 to 20 tokens in most rows).

Loaded by default: Agent, Bash, Edit, ListAgents, Read, ReportFindings, ScheduleWakeup, Skill, ToolSearch, Workflow, and Write. Deferred by default: CronCreate, CronDelete, CronList, DesignSync, EnterWorktree, ExitWorktree, Monitor, NotebookEdit, PushNotification, RemoteTrigger, SendMessage, TaskStop, WebFetch, and WebSearch. A deferred tool costs nothing, apart from its name, until ToolSearch loads it. In the default session the deferred tools would add 13,425 tokens.

Skill brings the skills listing. It is 2,210 tokens for the built-in skills:

SkillTokens
dataviz482
claude-api361
update-config236
code-review331
schedule127
run123
loop115
plugin-authoring89
workflow-authoring84
keybindings-help83
fewer-permission-prompts64
simplify63
security-review30
init22

What Else Changes the Budget​

Each row is a session after Reply with 'OK'. on Opus 5.5, compared to the default of 16,277.

VariantTotalChangeWhy
Default16,2770
--tools "Read,Edit,Bash"5,358-10,919Tools drop to 2,533. There is no skills listing.
--tools ""2,532-13,745No tools. The system prompt is 2,222.
ENABLE_TOOL_SEARCH=false31,604+15,327All tools load, 23,846 in all. Nothing is deferred.
CLAUDE_CODE_DISABLE_AUTO_MEMORY=115,586-691The system prompt drops from 2,407 to 1,706.
CLAUDE_CODE_DISABLE_EXPLORE_PLAN_AGENTS=115,953-324The agent list is shorter.
includeGitInstructions: false15,929-348The Bash text is shorter (loaded tools 7,815). The messages are shorter too.
Git repo with one commit16,454+177A git status goes into the messages.
CLAUDE.md of 60 short lines (about 3.4 KB)17,727+1,450Memory files take 1,327.
outputStyle set to Explanatory16,614+337Claude Code adds the style text.
One custom agent file with a one-line description16,306+29Custom agents take 19.
One MCP server (filesystem, 14 tools)16,467+190Claude Code defers its tools (2,753) until a search loads them.
Sonnet 5.516,679+402Loaded tools take 8,355.
Haiku 5.517,459+1,182The system prompt is 3,198.

Messages still vary by a few tokens between runs, even though every reply was exactly OK. Two runs of the default session gave totals of 16,274 and 16,277. The split differed more. For example, deferred tools were 15,919 in one run and 13,425 in the other, and messages were 3,769 and 3,698. So trust the totals more than single categories. --disable-slash-commands makes the request larger, not smaller. In a test with 2.1.305 (claude -p "Reply with 'OK'." against a local stub, Opus 5.5, no skills of your own), the request body grew by 9,057 bytes (from 44,332 to 53,389 here; the totals shift a little with the length of the project path; on 2.1.307 the growth was the same 9,057 bytes, from 45,388 to 54,445, and on 2.1.309 too, from 45,671 to 54,728, after the Bash tool description grew, and on 2.1.310 too, from 45,766 to 54,823, after Monitor joined the tool list), about 2,300 more tokens at 4 bytes per token (an estimate, not a count). The Skill tool (1,803 bytes) and the list of skills in the messages (the text of that message fell from 8,947 to 2,952 bytes, 5,995 bytes less) went away. The Workflow tool description grew by 16,955 bytes, because it then holds the workflow authoring reference that it otherwise loads through the workflow-authoring skill. Your own skills and commands are left out too, so with many of them the net change is smaller.

Best Practices​

Keep Tool Search On​

Tool search defers rarely used tools. Turning it off added 15,327 tokens. Leave ENABLE_TOOL_SEARCH unset unless you have a reason.

Trim Tools for Narrow Jobs​

A headless job or a narrow agent rarely needs every tool. --tools "Read,Edit,Bash" cut the session from 16,277 to 5,358 tokens. It also removed the skills listing.

claude -p "Fix the typo in README.md" --tools "Read,Edit"

To remove single tools, deny them. permissions.deny and --disallowedTools both remove a tool from the context. Denying Workflow and ScheduleWakeup, which cost the most and are often unused, took the empty session from 12,524 to 8,852 tokens. See Permissions.

.claude/settings.json
{
"permissions": {
"deny": ["Workflow", "ScheduleWakeup"]
}
}

Denying a deferred tool such as WebSearch only shrinks the deferred pool (13,425 to 13,190). It left the total almost unchanged (12,524 to 12,394).

Do not deny tools that are part of the loading machinery:

  • Denying ToolSearch loads every deferred tool: +15,898.
  • Denying Skill raised the total by 5,599. The workflow-authoring reference moves into the Workflow text. Denying both Skill and Workflow gives 9,875, which saves 2,649.
  • Denying Bash raised the total by 384. The program adds Glob and Grep in its place.

Keep CLAUDE.md Short​

Claude Code sends your memory files on every turn. A CLAUDE.md of 60 short lines cost about 1,300 tokens of memory files (1,327). It cost 1,450 in total with the extra message text. Keep only rules the model needs in every session.

Put Rare Instructions in Skills or Subagents​

Claude Code lists only the description of a skill. The body loads when the skill runs. Move a long, rarely needed procedure out of CLAUDE.md into a skill, or into a subagent that has its own context.

Keep MCP Descriptions Short​

Claude Code defers MCP tools. So one server with 14 tools added only 190 tokens at the start. The 2,753 tokens of schemas arrive when a search loads them. So keep tool descriptions short.

Turn Off Text You Do Not Use​

Each switch below removes a block of the start. Use one only if you do not need that feature.

SwitchSavesYou lose
CLAUDE_CODE_DISABLE_AUTO_MEMORY=1691Auto memory
includeGitInstructions: false348Commit and PR rules in the Bash text
CLAUDE_CODE_DISABLE_EXPLORE_PLAN_AGENTS=1324The Explore and Plan agents
~/.claude/settings.json
{
"$schema": "https://clawdipedia.cc/schemas/claude-code-settings.json",
"includeGitInstructions": false,
"env": {
"CLAUDE_CODE_DISABLE_AUTO_MEMORY": "1",
"CLAUDE_CODE_DISABLE_EXPLORE_PLAN_AGENTS": "1"
}
}

See Overriding Prompts for each switch.

Watch Custom Agent Descriptions​

One custom agent with a one-line description added 29 tokens (the agent list itself took 19). That is cheap. But the descriptions accumulate. Claude Code warns when the descriptions of all non-built-in agents pass 15,000 tokens. See Subagents.

Keep the Start Stable for the Cache​

The start of the request (tools and system prompt) is cached. In live tests with 2.1.305 (a two-turn session, the second turn resumed with --continue):

Change Before Turn TwoCache ReadCache Written
Nothing12,9803,474
CLAUDE.md edited12,9803,604
Tools changed (--disallowedTools ListAgents)015,925
Tools changed (--disallowedTools ReportFindings)10,0135,499

Editing CLAUDE.md keeps the cache. This also holds inside one open session. After the model rewrote CLAUDE.md with the Write tool, the next request read 16,611 tokens from the cache and wrote 182. Claude Code sends memory in the first user message, not the system prompt. The old text stays there. The new text comes in a later message. Changing the tools breaks the cache. Dropping ListAgents discarded the whole cached prefix. Dropping ReportFindings kept the first 10,013 tokens. Pick tools before you start. No earlier request in the past hour had dropped either tool. An earlier identical request would have left a matching cache to read. A new session with the same tools and system prompt also reads the cache of an earlier one within the cache lifetime (1 hour on a subscription). It read 10,834 tokens on its first turn. See Request and Cache.