Category · Models and how they work
What is a context window?
A context window is the amount of text, counted in tokens, that a model can take into account at once: instructions, conversation, documents and the answer included. Beyond it, part of the content must be summarised or removed.
By Laurent Poupet, Claude trainer and artificial intelligence architect · Updated
How it works
- For Claude, it reaches 200,000 tokens, and up to one million for some models; the documentation gives the exact size for each model.
- Everything sent at each turn counts, the conversation history, the tool results and the answer being written, and the cost follows the number of tokens read.
- When a session nears the limit, Claude Code compacts it: it replaces the history with a summary so it can keep going.
The trap to avoid
The trap is believing a large window is enough; quality often drops well before the limit, because the model makes poorer use of information buried in a long text.
A concrete example
A 200,000-token window holds roughly a 500-page book. You can put a long contract and the whole conversation in it. But if you pour in ten contracts “just in case”, the answer about the right contract gets less precise, and every turn costs more: give the model what helps, not everything you have.
What is the difference with an assistant’s memory?
| Criterion | Context window | an assistant’s memory |
|---|---|---|
| Duration | The length of one conversation | From one conversation to the next |
| Size | Limited by the model, in tokens | A few chosen notes |
| Cost | Everything re-read is paid at every turn | Only what is reloaded counts |
Related terms
- ClaudeModels and how they work
- Claude CodeDevelopment and code
- Fine-tuningModels and how they work
Where this is taught
Track 1 · Discovering Claude day to day
Claude models: choosing the right one for each tasklesson 1 · 1 hour
Lesson content (step-by-step instructions, exercises with solutions, quizzes) is for students only, with an access code received after the first lesson.