Context window
A context window is the maximum amount of text, measured in tokens, that a model can consider at once — the prompt, any retrieved material, the conversation so far, and the response it is generating.
Everything the model can "see" competes for the same budget. When a conversation or an agent run exceeds it, the earliest content is dropped or summarised, which is why long sessions quietly lose details established at the start.
Context length also has a direct cost consequence: several providers charge a higher rate above a long-context threshold, so the same task can bill at roughly double once a prompt grows past it.
How it works
Text is split into tokens, pieces of roughly three-quarters of an English word, before the model sees it. The context window is the total number of tokens the model can attend to in one request, counting the system instructions, any documents or search results, the whole conversation history and the answer being written. Anything outside the window does not exist for the model.
A larger window does not guarantee equal attention. Models tend to use information at the start and end of a long context more reliably than material buried in the middle.
Example
In a long coding session, a constraint agreed in the first message ("never change the database schema") can fall out of the window or be summarised away, and a later request quietly breaks it. Restating key constraints, or keeping them in a persistent instruction, avoids that.
Common mistakes
- Pasting whole documents when the relevant section would do, paying for tokens that dilute attention.
- Assuming a model still remembers details from the start of a very long session.
- Ignoring the higher per-token price some providers charge above a long-context threshold.