Page languageFrançaisEnglish
Teacher area
Laurent PoupetClaude trainer and artificial intelligence architectStudent area

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 , 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?

CriterionContext windowan assistant’s memory
DurationThe length of one conversationFrom one conversation to the next
SizeLimited by the model, in tokensA few chosen notes
CostEverything re-read is paid at every turnOnly what is reloaded counts

Related terms

Where this is taught

Lesson content (step-by-step instructions, exercises with solutions, quizzes) is for students only, with an access code received after the first lesson.

See the full program

Sources

All glossary terms

Trial lesson · 30 min · $20

Book (new tab)