# What Is a Context Window in an AI Model?

> What an LLM's context window is, how many tokens fit in Claude or Gemini, why more context is not better and how much of your product page gets read.

URL: https://clione.ai/glossary/context-window/
Lang: en

The context window is not a browser window or the "context" of a marketing plan: it is **everything a language model has in front of it at the moment of answering**. It matters to a store from two sides. When an assistant answers about your products, it can only use what of your page made it into that window, next to what came from other stores. And when a tool writes your product pages with an [LLM (large language model)](/glossary/llm/), what decides which data gets used is what that tool puts inside.

## How it works

Anthropic defines it as all the text a model can reference while generating a response, **including the response itself**. It is not the enormous corpus the model was trained on, but a "working memory".[^anthropic-context] Google uses almost the same image: a short-term memory, with a limited capacity to hold information before generating the answer.[^gemini-long-context]

It is measured in [tokens](/glossary/token/), the pieces of text the model splits what it reads into, and the count includes much more than the question. In Claude's API it counts everything that goes in the request: system instructions, every message in the conversation including tool results, images and documents, tool definitions and, on top of that, what the model generates in that turn, reasoning included.[^anthropic-context] OpenAI sums it up in one rule: **the request and the response together cannot exceed the model's maximum context length**.[^openai-concepts]

The size has grown a lot. As of October 2026, current Claude models have a one-million-token window and can generate up to 128,000 output tokens per request; other models in the same family stay at 200,000.[^anthropic-context] [Gemini](/glossary/gemini/) also accepts a million tokens, and Google translates that into things you can picture: about 50,000 lines of code, eight average-length novels or the transcripts of more than 200 podcast episodes.[^gemini-long-context]

When something does not fit, what happens depends on who manages the window. In Claude's API, if the input alone already exceeds the window, the request is rejected with a prompt-too-long error. Chat interfaces, by contrast, can drop the oldest part of the conversation to make room for the new.[^anthropic-context]

### More context is not better

Anthropic itself warns about it on the same page: a bigger window allows longer tasks, but **as the number of tokens grows, accuracy and recall degrade**, a phenomenon it calls _context rot_.[^anthropic-context] Google gives a figure for the same problem: finding a single fact in a long context works around 99% of the time, but accuracy drops noticeably when several facts have to be found at once in the same context.[^gemini-long-context]

Position counts too. A study by Nelson F. Liu and six other authors, published in 2023 in the journal TACL, had several models answer questions with many documents in front of them. **Performance was best when the relevant information was at the beginning or the end of the context, and dropped significantly when it was in the middle**, even in models built for long contexts.[^lost-middle] That is why Anthropic's engineers treat context as a finite resource with diminishing returns, and their advice is to look for the smallest set of useful information that makes the result you want likely.[^anthropic-context-eng]

## In a store

A **fictional example**: a tool has to write the description of a travel tripod. It can fill the window three ways:

| What it puts in the window                                                                                              | What happens                                                                                                                                                               |
| ----------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Only the product title                                                                                                  | It fits with room to spare, but the model has no weight or maximum load, and may fill them in with something plausible: an [AI hallucination](/glossary/ai-hallucination/) |
| The whole catalog and all the brand's manuals                                                                           | It may not even fit; and if it does, the tripod fact is a needle among thousands, and accuracy drops when there is a lot to find[^gemini-long-context]                     |
| The [product page](/glossary/product-page/), the merchant's answers and the manual excerpts that talk about that tripod | Little text and almost all of it useful: the small, relevant set Anthropic recommends[^anthropic-context-eng]                                                              |

The third option is the one that follows from this page's sources. Clione, for example, does not send the whole catalog: with each product travel the store's instructions, up to 10,000 characters, the merchant's answers about that product and, if the store turns it on, the four most relevant excerpts from its documents, about 1,200 tokens.

The same holds in reverse for the assistants that read your site: your [product page](/glossary/product-page/) shares a window with other stores' pages, and enters in pieces, not whole. **A fact that only makes sense with the rest of the page around it has fewer chances of being useful.**


That a window of a million tokens means the assistant has "read" your entire store, or that what fits in it is what the model knows about you. The window is what the model has in front of it in one specific request, which is different from what it learned in training,[^anthropic-context] and that something fits does not guarantee it is used well: **accuracy drops as the window fills up**.[^anthropic-context]


## How to check it

1. **Look up the window and the output limit of the model your tool uses** in the provider's documentation. They are two different figures, and both are measured in tokens.[^anthropic-context]
2. **Count the tokens of a typical request before sending it.** Anthropic recommends its token counting precisely so you do not go over the window.[^anthropic-context]
3. **Take out what does not help.** If the context carries the whole catalog to describe one product, trim it to what talks about that product.[^anthropic-context-eng]
4. **Put the key facts at the beginning or the end of what you give the model**, not buried in the middle of a long document.[^lost-middle]
5. **If an answer comes out cut off, look at the reason.** In Claude's API, a generation that reaches the window limit stops with the reason `model_context_window_exceeded`.[^anthropic-context]

## Related concept: RAG

[RAG (retrieval-augmented generation)](/glossary/rag/) and the context window are explained together. Google says that models with small windows needed to retrieve only what was relevant, summarize or trim messages, and that a large window allows another route: **giving all the relevant information up front**.[^gemini-long-context] But context rot and the position effect are still there,[^anthropic-context][^lost-middle] so retrieving well has not stopped being useful. RAG decides what goes in; the window is the space it goes into.

To keep going, the entry on [tokens](/glossary/token/) explains the unit the window is measured in, and the [reading path](/learn/ai-search/) orders the rest of the terms.
