The context window is the maximum amount of text an LLM can consider at once, measured in tokens — its working memory. Everything shares that budget: your instructions, the conversation so far, documents you paste in, tool outputs, and the reply the model is writing. Once the budget is spent, something has to be dropped, summarized or truncated.
What the numbers mean in practice
Frontier models in 2026 commonly offer 1M-token windows — Claude Sonnet 5, Claude Opus 4.8 and GLM-5.2 among them. A million tokens is roughly 750,000 English words: a whole codebase, several books, or hours of transcripts in one call. That’s what makes repo-wide code reasoning and long agent sessions possible at all.
The three catches
- Long context costs more. Input tokens are billed per million, so filling a 1M window is real money on every call — and some vendors charge a premium rate above a threshold (e.g. above 200K or 272K tokens).
- Advertised ≠ effective. Models can degrade on content buried mid-window (the “lost in the middle” effect); a model that accepts 1M tokens doesn’t necessarily use them all equally well. Vendors increasingly publish long-context benchmarks precisely because the headline number alone doesn’t tell you.
- The window varies by platform. The same model can ship with different limits on different clouds — Opus 4.8 runs 1M tokens on the Claude API but 200K on Microsoft Foundry.
Working with the budget
Prompt caching makes reused prefixes (long system prompts, shared documents) dramatically cheaper on repeat calls. Retrieval (RAG) stuffs only relevant excerpts into the window instead of everything. And our Token Calculator tells you what your text actually costs before you send it. Compare current windows across models in the LLM directory.