Skip to content

Context window

Also called: context windows, context length

Published:

What counts toward the context window?

Anthropic's documentation defines the context window as all the text a model can refer to while generating a response, including the response itself [1]. It is separate from the large corpus the model was trained on; the documentation describes it as the model's working memory [1]. Google uses a similar picture and compares it to short-term memory, since a model, like a person, can only hold a limited amount of information at a time [2].

Everything sent in a request takes up space: the system prompt, earlier messages, tool results, images, documents and tool definitions. The output the model writes for that turn counts too [1]. In a conversation, each user message and each reply accumulates in the window as the turns go by [1].

How large can a context window be?

It depends on the model. As of November 2026, Anthropic lists a 1-million-token window for some Claude models and a 200,000-token window for others [1]. Google says many Gemini models offer windows of 1 million tokens or more [2]. To make that number concrete, Google notes that such a window holds roughly 50,000 lines of code at 80 characters per line, or about eight average-length English novels [2].

Does a bigger window always give better results?

No. Anthropic points out that accuracy and recall degrade as the token count grows, an effect it calls context rot [1]. What goes into the window matters as much as how much room there is. If the input alone is larger than the window, the API rejects the request with a "prompt is too long" error [1].

Frequently asked questions

Is the context window the same as training data?

No. Training data is the large corpus the model learned from. The context window is the text in front of the model for a single request.

What happens when the context window is full?

If the input exceeds the limit, the request fails. Some chat interfaces keep going by dropping the oldest messages or summarising earlier parts of the conversation.

Sources

  1. Context windows — Anthropic
  2. Long context — Google