TECHNOLOGY

What fills a Claude Code context window

In this article
THE QUICK TAKE

Context occupancy is the combined working material of a session, including information that may never appear as a normal chat message.

A short visible conversation can still have substantial context. Claude Code loads configured startup material and adds file contents, tool results and its own responses during work. The context-window documentation makes this hidden contribution explicit, helping explain why a task can become crowded even when the user has written very little.

Account for startup material

Project instructions, auto memory, skill descriptions and MCP tool information can contribute before the first substantive file read. The exact composition depends on configuration. For a small migration task, broad unrelated guidance can therefore occupy space without answering the migration question. Review startup material by its purpose: keep universally needed conventions available and move occasional procedures to mechanisms that load when relevant.

Treat each file read as new working material

Reading a long generated client can add substantial content even if the relevant interface occupies a small portion. Search and focused reads help locate the useful section. In the migration example, start with the changed type and representative consumers. A repository file that was not read remains a possible source to inspect later; it does not need to be copied into the conversation merely because it exists.

Keep verbose observations in proportion

A command can return a large log while the next decision depends on a short assertion and its surrounding diagnostic. Preserve the full output as a referenced artifact when necessary, but surface the relevant evidence. This is especially useful for migration checks that repeat the same warning across many files. The repeated text should not hide a distinct error that actually explains why the check failed.

Use subagent context for bounded investigation

Claude Code documents that a subagent performs its own reads in a separate context and returns a summary. That can keep a large dependency investigation out of the main session. Give the investigation a concrete question, such as locating consumers of the changed interface. The returned summary should identify files and findings so the main task can use the evidence without inheriting every intermediate search result.

Understand what compaction changes

Compaction summarizes conversation history to make room; it is not a deletion of repository files. Claude Code reloads some startup information and handles other content according to its documented lifecycle. A migration handoff should therefore preserve the accepted goal, current patch and remaining check in explicit artifacts. The session can continue with focused references rather than treating the earlier transcript as the only location of essential state.

Documentation and further study

Related engineering guides: Reproducible inference stacks: preserving a GPU pilot’s result; Choose a local AI stack: desktop chat, shared UI or coding agent.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles