Context window
The context window is the maximum amount of text a model can consider at once, measured in tokens and covering everything in the request: system prompt, your instructions, the files supplied, prior conversation, and the response being generated.
It is a hard ceiling, not a soft one. Past it, something has to be dropped or summarised, and what gets dropped is usually the oldest part of the conversation — which is often where you stated the requirements.
Size is not the only thing that matters. Models attend unevenly across a long context, and material in the middle of a very full window gets weighted less reliably than material at either end. A focused twenty thousand tokens frequently beats an unfocused two hundred thousand.
What this means in practice
This is why long correcting threads degrade. By message fifteen the window holds mostly failed attempts. Restating the task in a fresh conversation with the right files attached beats arguing, and it is the single most useful recovery move in agentic coding.
Prompts for the tools this applies to
Related terms
- Context engineering
Context engineering is the practice of deciding what information an AI model sees for a given task — which files, which conventions, which prior results — and in what form.
- Token limit
A token limit is a cap on how much text can be processed in a request or a period.
- Input tokens
Input tokens are the units of text a model reads: your prompt, the files supplied, the system prompt, and the conversation so far.
- Context retrieval
Context retrieval is how an AI coding tool decides which parts of your codebase to read for a given request.