Explore the context window changedcontext-window
Nearest release: v2.1.242, published under an hour after this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Recorded here
Lines+34added
Lines−20removed
From line
87
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits22to this page, all time
The whole hunk
from line 87, old and new numbered
/
from line 87
8787 tokens: 2400,
8888 color: '#8A8880',
8989 vis: 'brief',
90 restoredAfterCompact: true,
9091 desc: 'Main auth file. You see "Read auth.ts" in your terminal, but the 2,400 tokens of file content only Claude sees.',
9192 tip: 'File reads dominate context usage. Be specific in prompts ("fix the bug in auth.ts") so Claude reads fewer files. For research-heavy tasks, use a subagent.',
9293 link: null
from line 98
9798 tokens: 1100,
9899 color: '#8A8880',
99100 vis: 'brief',
101 restoredAfterCompact: true,
100102 desc: 'Following imports to the token module. Shown as a one-liner in your terminal.',
101103 link: null
102104 }, {
from line 108
106108 tokens: 380,
107109 color: '#4A9B8E',
108110 vis: 'brief',
111 restoredAfterCompact: true,
109112 desc: 'This rule in `.claude/rules/` has a `paths:` pattern matching `src/api/**`. It loaded automatically when Claude read a file in that directory. You see "Loaded .claude/rules/api-conventions.md" in your terminal, but not the rule content.',
110113 link: '/en/memory#path-specific-rules'
111114 }, {
from line 118
115118 tokens: 1800,
116119 color: '#8A8880',
117120 vis: 'brief',
121 restoredAfterCompact: true,
118122 desc: 'Tracing the auth flow deeper.',
119123 link: null
120124 }, {
from line 128
124128 tokens: 1600,
125129 color: '#8A8880',
126130 vis: 'brief',
131 restoredAfterCompact: true,
127132 desc: 'Checking existing tests for expected behavior.',
128133 link: null
129134 }, {
from line 138
133138 tokens: 290,
134139 color: '#4A9B8E',
135140 vis: 'brief',
141 restoredAfterCompact: true,
136142 desc: 'Another path-scoped rule, this one matching `*.test.ts` files. Triggered when Claude read auth.test.ts. Shown as a one-line "Loaded" notice.',
137143 link: '/en/memory#path-specific-rules'
138144 }, {
from line 337
331337 tokens: 620,
332338 color: '#558A42',
333339 vis: 'brief',
334 desc: 'You invoked a skill that has `disable-model-invocation: true`. Its description was not in the skill index at startup, so it cost zero context until this moment. Now the full skill content loads and Claude follows its instructions to stage, commit, and push your changes.',
340 restoredAfterCompact: true,
341 desc: 'You invoked a skill that has `disable-model-invocation: true`. Its description was not in the skill index at startup, so it cost zero context until this moment. Now the full skill content loads and Claude follows its instructions to stage, commit, and push your changes. After `/compact`, Claude Code re-injects the body of each skill you invoked, capped at 5,000 tokens per skill.',
335342 tip: 'Set `disable-model-invocation: true` on skills with side effects like committing, deploying, or sending messages. They stay out of context entirely until you need them.',
336343 link: '/en/skills#control-who-invokes-a-skill'
337344 }, {}, {
from line 534
527534 }
528535 {}
529536 const autoLoads = nonCompact.filter(e => e.kind === 'auto' && e.t < STARTUP_END && !e.noSurviveCompact);
537 const restored = nonCompact.filter(e => e.restoredAfterCompact);
530538 const summarized = nonCompact.filter(e => e.t >= STARTUP_END && e.kind !== 'sub');
531539 const sumTokens = summarized.reduce((s, e) => s + e.tokens, 0);
532540 const summaryBlock = {
from line 544
536544 tokens: Math.round(sumTokens * 0.12),
537545 color: '#A09E96',
538546 vis: 'hidden',
539 desc: `All ${summarized.length} conversation events condensed into one structured summary. The summary keeps: your requests and intent, key technical concepts, files examined or modified with important code snippets, errors and how they were fixed, pending tasks, and current work. It replaces the verbatim conversation: full tool outputs and intermediate reasoning are gone. Claude can still reference the work but won't have the exact code it read earlier.`,
547 desc: `All ${summarized.length} conversation events condensed into one structured summary. The summary keeps: your requests and intent, key technical concepts, files examined or modified with important code snippets, errors and how they were fixed, pending tasks, and current work. It replaces the verbatim conversation: full tool outputs and intermediate reasoning are gone. Claude Code re-reads the files modified most recently and re-injects the skills you invoked, listed below. Claude can still reference the rest of the work but won't have the exact content.`,
540548 link: '/en/how-claude-code-works#the-context-window'
541549 };
542550 return {
543 visible: [...autoLoads, summaryBlock],
551 visible: [...autoLoads, summaryBlock, ...restored],
544552 preCompactTotal: nonCompact.reduce((s, e) => s + e.tokens, 0)
545553 };
546554 }, [preCompactVisible, isCompacted]);
from line 621
613621 if (detailRef.current) detailRef.current.scrollTop = 0;
614622 }, [hovEvent]);
615623 const focusT = hovEvent ? hovEvent.t : time;
616 const takeaway = isCompacted ? 'Compaction replaces the conversation with a structured summary. System prompt, CLAUDE.md, memory, and MCP tools reload automatically. The skill listing is the one exception. Only skills you actually invoked are preserved.' : focusT < STARTUP_END ? 'A lot loads before you type anything. CLAUDE.md, memory, skills, and MCP tools are all in context before your first prompt.' : focusT < 0.28 ? "Your prompt is tiny compared to what's already loaded. Most of Claude's context is project knowledge, not your words." : focusT < 0.50 ? 'Each file Claude reads grows the context. Path-scoped rules load automatically alongside matching files.' : focusT < 0.71 ? 'Hooks fire automatically on tool events. Output reaches Claude via additionalContext JSON. Exit code 2 surfaces stderr to Claude. Plain stdout on exit 0 goes to the debug log, not the transcript.' : focusT < 0.79 ? 'Follow-up questions keep building on the same context. Everything from earlier is still there.' : focusT < 0.87 ? "The subagent works in its own separate context window. None of its file reads touch yours. Only the final summary comes back." : focusT < 0.88 ? 'Bang commands run in your shell and prefix the output to your next message. Useful for grounding Claude in command results without it running them.' : focusT < 0.90 ? 'User-only skills stay out of context entirely until you invoke them. The skill index at startup only lists skills Claude can call on its own.' : '/compact summarizes the conversation to free space while keeping key information. In a real session, run it when context starts affecting performance or before a long new task.';
617 const terminalView = isCompacted ? 'A "Conversation compacted" message. The summarization happens silently.' : focusT < STARTUP_END ? 'The input box, waiting for your first message. Everything above loads silently before you type anything.' : focusT < 0.28 ? 'Your prompt. Claude hasn\'t started working yet.' : focusT < 0.52 ? 'Your prompt and "Reading files...". Rules show as one-line "Loaded" notices, not their content.' : focusT < 0.72 ? "Claude's response and file diffs. Hooks fire silently. Tool output like npm test shows as a brief summary, not the full content." : focusT < 0.79 ? 'Your follow-up prompt.' : focusT < 0.86 ? "A brief notice that a subagent is working, then its result. You don't see the subagent's individual file reads." : focusT < 0.90 ? "Claude's response, your git status output, and the commit-push skill running." : 'Your full conversation. /compact is available to run.';
624 const takeaway = isCompacted ? 'Compaction replaces the conversation with a structured summary. System prompt, CLAUDE.md, memory, and MCP tools reload automatically. Claude Code also re-reads up to five of the files modified most recently, reloads the rules that match them, and re-injects the skills you invoked. The skill listing does not reload.' : focusT < STARTUP_END ? 'A lot loads before you type anything. CLAUDE.md, memory, skills, and MCP tools are all in context before your first prompt.' : focusT < 0.28 ? "Your prompt is tiny compared to what's already loaded. Most of Claude's context is project knowledge, not your words." : focusT < 0.50 ? 'Each file Claude reads grows the context. Path-scoped rules load automatically alongside matching files.' : focusT < 0.71 ? 'Hooks fire automatically on tool events. Output reaches Claude via additionalContext JSON. Exit code 2 surfaces stderr to Claude. Plain stdout on exit 0 goes to the debug log, not the transcript.' : focusT < 0.79 ? 'Follow-up questions keep building on the same context. Everything from earlier is still there.' : focusT < 0.87 ? "The subagent works in its own separate context window. None of its file reads touch yours. Only the final summary comes back." : focusT < 0.88 ? 'Bang commands run in your shell and prefix the output to your next message. Useful for grounding Claude in command results without it running them.' : focusT < 0.90 ? 'User-only skills stay out of context entirely until you invoke them. The skill index at startup only lists skills Claude can call on its own.' : '/compact summarizes the conversation to free space while keeping key information. In a real session, run it when context starts affecting performance or before a long new task.';
625 const terminalView = isCompacted ? 'A "Conversation compacted" message, then a one-line "Read auth.ts" for each re-read file and "Skills restored (commit-push)". The rules show as "Loaded" lines on Claude\'s next turn. None of the content itself appears.' : focusT < STARTUP_END ? 'The input box, waiting for your first message. Everything above loads silently before you type anything.' : focusT < 0.28 ? 'Your prompt. Claude hasn\'t started working yet.' : focusT < 0.52 ? 'Your prompt and "Reading files...". Rules show as one-line "Loaded" notices, not their content.' : focusT < 0.72 ? "Claude's response and file diffs. Hooks fire silently. Tool output like npm test shows as a brief summary, not the full content." : focusT < 0.79 ? 'Your follow-up prompt.' : focusT < 0.86 ? "A brief notice that a subagent is working, then its result. You don't see the subagent's individual file reads." : focusT < 0.90 ? "Claude's response, your git status output, and the commit-push skill running." : 'Your full conversation. /compact is available to run.';
618626 const mono = 'var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace)';
619627 const renderWithCode = s => s.split('`').map((part, i) => i % 2 === 1 ? <code key={i} style={{
620628 fontFamily: mono,
from line 948
940948 lineHeight: 1.5,
941949 marginTop: 4
942950 }}>
943 This is what's left in context: startup content, which lives outside the message history and reloads after compaction, plus a structured summary of the entire conversation. Skill descriptions don't reload.
951 This is what's left in context: startup content, which lives outside the message history and reloads after compaction, a structured summary of the entire conversation, the files modified most recently, which Claude Code re-reads along with the rules that match them, and the body of each skill you invoked. Skill descriptions don't reload.
944952 </div>
945953 </div>}
946954 {time > 0 && visible.length > 0 && <div style={{
from line 971
963971 const enteringSubagent = isSub && prevKind !== 'sub';
964972 const leavingSubagent = prevKind === 'sub' && !isSub;
965973 let showPhase = null;
966 if (evt.kind === 'user' && prevKind !== 'user') showPhase = 'You'; else if (evt.kind === 'claude' && prevKind === 'user') showPhase = 'Claude works'; else if (evt.label === 'Conversation summary') showPhase = 'Summarized by /compact';
974 if (isCompacted && evt.restoredAfterCompact) {
975 if (prevKind === 'compact') showPhase = 'Restored after /compact';
976 } else if (evt.kind === 'user' && prevKind !== 'user') showPhase = 'You'; else if (evt.kind === 'claude' && prevKind === 'user') showPhase = 'Claude works'; else if (evt.label === 'Conversation summary') showPhase = 'Summarized by /compact';
967977 const isNewRow = isCompacted && !(evt.kind === 'auto' && evt.t < STARTUP_END);
968978 return <div key={evt.label + evt.t} className={isNewRow ? 'cw-compacted-row' : ''} style={isNewRow ? {
969979 animationDelay: `${i * 60}ms`
from line 1589
15791589
15801590## What survives compaction
15811591
1582When a long session compacts, Claude Code summarizes the conversation history to fit the context window. As of v2.1.198, the summarization request inherits your session's [extended thinking](/docs/en/model-config#extended-thinking) configuration, so it reasons with thinking enabled when your session has it enabled and stays off otherwise. Thinking affects only how the summary is produced; your session settings are unchanged afterward. What happens to your instructions depends on how they were loaded:
1592When a long session compacts, Claude Code summarizes the conversation history to fit the context window. As of v2.1.198, the summarization request inherits your session's [extended thinking](/docs/en/model-config#extended-thinking) configuration, so it reasons with thinking enabled when your session has it enabled and stays off otherwise. Thinking affects only how the summary is produced; your session settings are unchanged afterward. What happens to each kind of content depends on how it was loaded:
15831593
1584| Mechanism | After compaction |
1585| :---------------------------------------- | :------------------------------------------------------------------------------------------ |
1586| System prompt and output style | Unchanged; not part of message history |
1587| Project-root CLAUDE.md and unscoped rules | Re-injected from disk |
1588| Auto memory | Re-injected from disk |
1589| Rules with `paths:` frontmatter | Lost until a matching file is read again |
1590| Nested CLAUDE.md in subdirectories | Lost until a file in that subdirectory is read again |
1591| Invoked skill bodies | Re-injected, capped at 5,000 tokens per skill and 25,000 tokens total; oldest dropped first |
1592| Hooks | Not applicable; hooks run as code, not context |
1594| Mechanism | After compaction |
1595| :------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------ |
1596| System prompt and output style | Unchanged; not part of message history |
1597| Project-root CLAUDE.md and unscoped rules | Re-injected from disk |
1598| Auto memory | Re-injected from disk |
1599| The plan Claude wrote in [plan mode](/docs/en/permission-modes#analyze-before-you-edit-with-plan-mode) | Re-injected from disk |
1600| Rules with `paths:` frontmatter | Claude Code reloads them as Claude reads files they match |
1601| Nested CLAUDE.md in subdirectories | Claude Code reloads them as Claude reads files in that subdirectory |
1602| Files Claude read or edited | Claude Code re-reads up to five, most recently modified first |
1603| Invoked skill bodies | Re-injected, capped at 5,000 tokens per skill and 25,000 tokens total; oldest dropped first |
1604| Context that hooks added earlier | Summarized with the rest of the conversation |
1605| [SessionStart hooks](/docs/en/hooks-guide#re-inject-context-after-compaction) that match the `compact` source | Claude Code runs them and adds their output to the compacted context |
15931606
1594Path-scoped rules and nested CLAUDE.md files load into message history when their trigger file is read, so compaction summarizes them away with everything else. They reload the next time Claude reads a matching file. If a rule must persist across compaction, drop the `paths:` frontmatter or move it to the project-root CLAUDE.md.
1607Path-scoped rules and nested CLAUDE.md files load into message history when their trigger file is read, so compaction summarizes them away with everything else. Right after compaction, Claude Code re-reads up to five of the files Claude has read or edited in the session, choosing the ones modified most recently, and reloads the rules and nested CLAUDE.md files that apply to those files. A file over 5,000 tokens comes back as a path reference without its content, shown as `Referenced file` instead of `Read`. Its rules still reload. If a rule must persist across compaction, drop the `paths:` frontmatter or move it to the project-root CLAUDE.md.
15951608
15961609Skill bodies are re-injected after compaction, but large skills are truncated to fit the per-skill cap, and the oldest invoked skills are dropped once the total budget is exceeded. Truncation keeps the start of the file, so put the most important instructions near the top of `SKILL.md`.
15971610
from line 1615
16021615You can also act before the automatic pass runs:
16031616
16041617* **Compact with a focus**: run `/compact` with instructions, like `/compact focus on the auth bug fix`, before starting a long new task. The summary keeps what you choose instead of what the automatic pass guesses is important.
1618* **Compact part of the conversation**: run `/rewind`, select a message, and choose **Summarize from here** or **Summarize up to here**. See [Rewind and summarize](/docs/en/checkpointing#rewind-and-summarize) for what each option keeps and how to guide the summary.
16051619* **Compact earlier**: run [`/autocompact`](/docs/en/commands#all-commands) with a token count, like `/autocompact 500k`, to set how full the context window gets before the automatic pass runs. See [Set the auto-compact window](/docs/en/model-config#set-the-auto-compact-window) for accepted values and overrides.
16061620* **Clear between tasks**: run `/clear` when switching to unrelated work. Old conversation crowds out the files you need next and costs tokens on every message.
16071621* **Delegate large reads**: send research to a [subagent](/docs/en/sub-agents) so the file contents stay in its context window, not yours.
No line in this hunk matches that.