Last reviewed
Correct answer: B. It compacts on its own, clearing older tool output first, then summarising
Explanation
The principle — the window filling is an event the tool handles, not a wall you hit.
Why the key is correct — Anthropic states that Claude Code compacts automatically as you approach the limit, so a full context window does not end your session, and describes the order: it clears older tool outputs first, then summarises the conversation if needed. Tool output goes first because it is the bulkiest and least reusable material in the window, which is why a session full of long command output compacts sooner than one full of discussion.
Why the others are wrong — the session does not end, and believing it does leads people to restart unnecessarily and lose the thread. Nothing is losslessly preserved either; a summary is a summary, and what survives depends on how each item was loaded rather than on it having been present. And imported files are not shed first to make room, because they are part of the startup load rather than a buffer.
Remember this — you will not be stopped, but you may be quietly summarised. Put anything that must persist in a file rather than in the conversation.
Sources — Anthropic's context window page and How Claude Code works.
Sources
“Claude Code compacts automatically as you approach the limit, so a full context window doesn't end your session.”
“Claude Code manages context automatically as you approach the limit. It clears older tool outputs first, then summarizes the conversation if needed.”
Practise 10 questions on this topic
Take Claude Code Basics — Timed Test 2 (10 questions) — scored instantly, explanation for every question, no login.