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].