What is a context window?

In short

A context window is the maximum amount of text a language model can take into account in a single request, measured in tokens. System instructions, tool definitions, conversation history, files the agent read and command output all have to fit inside it.

What fills a coding agent’s context

Every request an agent makes is a fixed base plus a history that keeps growing.

  • The system prompt and tool definitions, including tools from MCP servers.
  • Project instruction files such as CLAUDE.md or AGENTS.md.
  • Conversation history: your messages and the agent’s replies.
  • Files read and command output, often the biggest item.

What happens when it fills up

The model rereads the whole context on every turn. As the window nears its limit, agents summarize the conversation and drop older detail. Claude Code calls this compaction, and you can trigger it yourself with /compact. The summary helps, but some details are lost. /clear wipes the conversation entirely.

A bigger window isn’t a fix

Current models have windows of hundreds of thousands of tokens. Still, longer context makes every turn slower and more expensive, and the model can miss details buried in a long context. Keeping context small and relevant usually beats relying on a large window.

Using context well

A few habits keep the context clean for longer.

  • Start a new conversation when a task is done.
  • Turn off MCP servers you don’t use.
  • Have the agent read the relevant part of a file, not the whole thing.
  • Hand long research to subagents so only a summary comes back.

Context in AgentVera

AgentVera makes context visible and gives you several ways to shrink it.

  • The agent pane shows live context size; run /compact by hand or automatically at a threshold you set.
  • Context profiles: Lean cuts Claude Code’s first request from about 34.4k to 13.3k tokens.
  • Smart tools block rereading a file that is already in context and unchanged, and give the outline first for large files.
  • The project map lets agents find the relevant code without reading file after file.

FAQ

What happens when the context window is full?

The agent summarizes the conversation and carries on, or can’t go further. Claude Code compacts automatically, and some older detail may be lost in the summary.

Is the context window the same as a usage limit?

No. The context window is how much text fits in one request. Usage limits cap how much you can use over a period of time.

What’s the difference between /compact and /clear?

/compact summarizes the conversation and continues from the summary. /clear deletes the conversation and the agent starts fresh.

Does a bigger context window give better results?

Not always. More text fits, but unneeded context costs more and can distract the model.

Related terms

All terms

See these ideas at work.

Download AgentVera for free, add a project folder and run Claude Code, Codex and other agents side by side.