Course · Claude Code · Sessions & context
Inspect the context window with /context and /usage
Take a hypothetical case from the course’s running example, a small Express + TypeScript payments service. The task was to add GET /healthz beside the existing GET /health, with both returning the same response, because existing callers use the old address and a new monitor uses the new one. You return from comparing two designs for that change and the agent asks which address must remain compatible. That question can be useful: perhaps you never told this session. Or it may repeat a decision already made here. Before blaming the size of the conversation, check which conversation you are in and whether the decision was ever supplied to it.
Then inspect the resource you are worried about. Both commands are typed at the prompt of a running Claude Code session, open in any repository of yours (the install lesson covers installing, signing in, and launching with claude). Run them separately:
/context/usage/context shows the current context usage and a breakdown of what occupies it. /usage reports usage information appropriate to the account, including session token statistics (tokens are the units in which model input and output text are measured and billed) and, for supported subscriptions, plan usage. Their current displays are described in the command reference and usage guide.
Ask which limit you have reached
Section titled “Ask which limit you have reached”Context occupancy is about the material available for the current interaction. Usage accounting concerns work performed and the limits or costs associated with it. A small active context does not imply unused plan allowance. A large active context does not, by itself, explain a rate-limit message.
Suppose the session has room for more context but the account reports a usage limit. Compacting the conversation (replacing its detailed history with a shorter summary) will not undo consumption already recorded. Conversely, buying more allowance does not establish that the agent has the missing compatibility requirement. These problems require different evidence and different responses.
Record what your own displays say. This lesson does not assign every reader a 200k-token window or invent a terminal breakdown that looks like a measured run. Model, configuration, and product behavior determine the actual display.
Inspect what deserves the space
Section titled “Inspect what deserves the space”Look for material that is large relative to its usefulness for this task. A long test log may contain one consequential assertion. An earlier implementation discussion may still explain a decision you need. Size alone does not tell you which to discard.
For the health patch, the useful question is whether the context still makes the contract and current state recoverable: both addresses and their shared response, whichever implementation you selected, relevant tests, and unresolved failures. A discarded design may deserve one sentence explaining why it was rejected rather than its entire exploratory exchange.
Tool context also varies. MCP tool definitions are the descriptions of tools that connected external servers make available to the agent, and each loaded definition occupies context. Current Claude Code can defer them until they are needed; it is inaccurate to assume every connected server always loads every schema. The context-management explanation describes that behavior. Read your actual breakdown before removing a tool the task still needs.
The simulator below uses a deliberately simplified 200k-token window and an illustrative threshold at which the simulated session would compact. Its eager-loaded MCP example is one possible setup, not a prediction of your Claude session. The numbers teach how categories add up; they do not measure intelligence or establish a universal point where answers worsen.
Without the widget, the relationship is the same: instructions, loaded tools, conversation, file excerpts, and results all occupy context. Adding a large result leaves less room for other material. Summarizing can reduce occupancy while losing detail. Whether the remaining detail is sufficient is a separate check.
Choose a response to the evidence
Section titled “Choose a response to the evidence”If you resumed the wrong session, the resume lesson shows how to recover the right conversation. If the compatibility decision was never stated, supply it. If you have moved to a different task, start a new conversation with the evidence that task needs. If you are continuing this task and carrying too much detail, prepare a summary.
A repeated question is worth investigating; it is not a diagnosis. Verify the cause you can observe before choosing a remedy. The next lesson preserves the health task’s essential state while reducing what the session has to carry.