PATH COMPLETION0 / 45 STEPS (0%)
BACK TO LEARNING PATHTRACK 03: Context Engineering
Step 1 of 6 in this track · 7 min

What is the context window

The context window is everything the model can see when it generates its next response. It is working memory, and it is finite.

What goes in it

More than people expect. All of this counts:

  • The system prompt, which the harness writes, not you
  • Your project rules file
  • Every message in the conversation, yours and the model's
  • Every tool definition, including names, descriptions, and full parameter schemas
  • Every tool result, including the whole file you asked it to read
  • The model's own reply, including any reasoning it does

That fifth item is usually the surprise. Ask an agent to read a 2,000 line file and those 2,000 lines now sit in context for the rest of the session.

Sizes today

Current frontier models mostly offer 200,000 or 1,000,000 token windows. As a rough conversion, one token is about four characters of English, so 200,000 tokens is roughly 150,000 words.

That sounds enormous until you load a codebase into it. Twenty medium source files and a few tool results will get you there.

The context window checker will show you where your own content actually lands.

What happens when it fills

Two different things, and it matters which.

The request is rejected. If the input alone exceeds the window, the API returns an error before generating anything.

Generation stops partway. If input plus the reply exceeds the window, the model can start an answer and hit the wall mid sentence.

Harnesses hide most of this by trimming or summarising older turns automatically. That is why an agent can forget something you said twenty turns ago: it is genuinely no longer there.

Bigger is not automatically better

A one million token window does not mean you should fill it. Accuracy and recall degrade as the window fills, an effect usually called context rot. A model with 900,000 tokens of context will miss things it would have caught with 20,000.

This is the single most counterintuitive thing about the context window, and it gets its own page: context rot and why more is worse.

Why you pay attention to it

Two reasons, both practical.

Cost. You pay for input tokens on every single turn. A bloated context is a recurring charge, not a one off.

Quality. The signal to noise ratio in the window is roughly what determines output quality. Curating it is most of the skill in working with agents.

Next

Context engineering basics covers what to put in and what to keep out.