Glossary

Context window

The maximum amount of text (in tokens) a language model can hold in its working memory at once. Modern frontier models support 200k-1M+ tokens of context.

The context window is the maximum number of tokens a language model can process in a single request, everything the model “sees” at once: your prompt, the conversation so far, any uploaded documents, tool definitions, and the response it’s generating.

In 2026, frontier models have generous context windows:

ModelContext window
Claude Opus 4.7 (1M)1,000,000 tokens
Claude Sonnet 4.6200,000 tokens
GPT-4o128,000 tokens
Gemini 2.5 Pro2,000,000 tokens

For comparison: a 200k-token context window is roughly the length of The Lord of the Rings trilogy. A 1M-token window is roughly Game of Thrones plus Wheel of Time. You can fit a lot of code, a lot of documents, and a lot of conversation in there.

Why it matters

Bigger context = more capability:

  • Larger codebases can be analysed in a single session
  • More documents can be referenced at once
  • Longer conversations can run without losing earlier context
  • More examples can be included in few-shot prompts

The trade-off: you pay per token. A 200k-token prompt costs 200x what a 1k-token prompt costs. Use the window when you need it; don’t waste it when you don’t.

Common mistake: thinking bigger is always better

Pasting more context isn’t always better. Past about 50k tokens, models can struggle to attend to all of it equally, important details in the middle of a long context sometimes get under-weighted (the “lost in the middle” effect, well-documented).

If your prompt is 100k+ tokens, consider:

  • Can you summarise some of the context first?
  • Can you split the task into smaller subagent calls?
  • Do you actually need all of this, or are you padding?

Context window vs prompt cache

The full prompt (including cached content) counts against the context window. Caching reduces the cost of large prompts but not the size. You still need to fit within the model’s max window.

Related terms

Want this built for your business?

Book a free 30-minute AI audit. We'll map your business and show you exactly which systems we'd build first. No pitch deck, no scoping fee.

Book my free AI audit