What Does Context Window Mean?
A context window is the amount of text an AI model can look at in one request, measured in tokens, which are small chunks of words. Everything counts against it: the system prompt, any instruction files, the conversation so far, files the model has read, tool results and the reply it is writing. In late 2026, common models offer windows from roughly 128,000 tokens to a million or more. When a conversation grows past the limit, older material has to be dropped or summarized. The model has no memory outside this window unless the application stores and re-sends information.
Why Does Context Window Matter?
The context window sets how much of your project an agent can keep in view at once and how much each turn costs, because you pay for every token sent. Long sessions fill the window with old tool output, which can make answers slower, pricier and less focused. Knowing this explains why agents compact or summarize conversations, and why short instruction files and focused tasks work better.
What Does Context Window Look Like in Practice?
Suppose an agent has a 200,000-token window. Your CLAUDE.md takes 1,500 tokens, the system prompt and tool definitions take 15,000, and reading five source files adds 40,000. After a long test run prints 60,000 tokens of output, more than half the window is used before the agent writes a line of code. Trimming the test output to the failing cases, or running the tests in a subagent, keeps most of that room free for the actual work.
What Do People Get Wrong About Context Window?
A model with a large context window does not read every part of it equally well. Details buried in the middle of a very long input are easier to miss. Putting the right material in matters more than the size limit.
Which Terms Are Related?
- Token: A small chunk of text, often part of a word, that models process; limits and prices are counted in tokens.
- Context engineering: Deciding what goes into a model context window, including instructions, files and tool output, so the model can do the task well.
- Prompt caching: Reusing the already processed start of a prompt across requests so repeated context is cheaper and faster.
- RAG (retrieval-augmented generation): Looking up relevant documents first and giving them to the model, so its answer is grounded in real sources.
- Large language model: An AI model trained on vast amounts of text to predict the next token, which lets it write, answer questions and code.
All 28 terms are in the AI glossary. For models side by side, see frontier vs open-weight.
Frequently Asked Questions
What happens when the context window is full?
The application must remove or summarize something before the next request, or the request fails. Coding agents often compact the conversation automatically, which keeps the session going but can lose details from earlier turns.
Is the context window the same as memory?
No. The window is only what the model sees in the current request. Anything an app remembers between sessions, such as an instructions file or saved notes, is stored outside the model and sent back in each time.
Does a bigger context window cost more?
Using it does. Most APIs charge per token sent, so filling a large window on every turn costs more than sending a small focused context. Prompt caching can reduce the cost of repeated parts.