# Context window

> Canonical: https://skillalmanac.com/glossary/context-window | Last verified: 2026-11-24 | Index status: index-eligible

A context window is what a model can reference when generating a response, measured in tokens. For Claude, the response itself, plus images, documents and tool results in the request, count toward it.

Also called: context windows, context length, context size.

## In plain language

A context window is all the text a model can look at when it writes a response, counting the response itself. Think of it as the working memory for one model call, which is different from the data the model was trained on. The size differs by model; as of 2026-11-24, Anthropic's models overview lists a 1M-token context window for Claude Opus 5.5.

## Technical definition

For Claude, the documented context window counts the system prompt, every message (including tool results, images and documents), tool definitions and the output Claude generates for the turn, including extended thinking. Whether thinking blocks from earlier turns stay in the window depends on the model. The documentation gives the context window size and, separately, the number of output tokens a single request can generate (max_tokens, the maximum number of tokens to generate before stopping). More context is not automatically better, because accuracy and recall degrade as token count grows, a phenomenon the documentation calls context rot. Chat interfaces such as claude.ai can also manage the window on a rolling first-in, first-out basis, meaning the oldest content is the first to leave. Server-side compaction, which automatically summarizes earlier parts of a conversation on the server, lets it continue past the context window limit.

## How it shows up when you use agents

For Claude, the request and the model's generated output count toward the context window, including tool definitions and tool results. The Anthropic documentation says accuracy and recall degrade as token count grows, so a larger window is not a guarantee of reliable recall. For agents that span multiple sessions, it advises designing state artifacts so that context recovery is fast when a new session starts.

For a concrete number, Anthropic's models overview lists a context window of 1M tokens and a maximum output of 128K tokens for Claude Opus 5.5, as of 2026-11-24. Those figures belong to that model; other models list their own.

A guide on Claude Code cost explains that each request sends the conversation so far, so cost grows with context length; see [Claude Code pricing explained](/learn/claude-code-pricing-explained).

## Common confusions

- **Context versus training.** The Anthropic documentation says the context window is different from the large corpus of data the model was trained on.
- **Window versus conversation.** Chat interfaces such as claude.ai can manage the window on a rolling first-in, first-out basis, and server-side compaction summarizes earlier parts of a conversation so it can continue past the window limit.
- **Capacity versus quality.** More context is not automatically better, because accuracy and recall degrade as token count grows.
- **Context versus output limit.** The model's output counts toward the context window, and the documentation gives a separate maximum number of output tokens (max_tokens) for a single request. Whether earlier thinking blocks stay in the window depends on the model.

## Worked examples in this catalogue

### [context-window-packer](https://skillalmanac.com/skills/skill-almanac/context-window-packer)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: The skill chooses which files fit one prompt's token budget and records what was kept, shrunk or dropped, and why.

Why it exercises the concept: Read its record of what was kept, shrunk or dropped for one prompt's budget.

### [session-handoff-notes](https://skillalmanac.com/skills/skill-almanac/session-handoff-notes)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: The skill produces a handoff note the next coding-agent session can act on, checked for evidence, paths and vague items.

Why it exercises the concept: Compare it with the documentation's advice to design state artifacts so context recovery is fast when a new session starts.

### [What Is an LLM? The Facts Agent Users Need](https://skillalmanac.com/learn/what-is-an-llm-for-agent-users)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: The guide says the agent is the code around the model.

Why it exercises the concept: Use it to separate the model from the agent code around it.

## Related terms

- [Large language model (LLM)](https://skillalmanac.com/glossary/large-language-model.md)
- [Token](https://skillalmanac.com/glossary/token.md)
- [Prompt](https://skillalmanac.com/glossary/prompt.md)
- [AI agent](https://skillalmanac.com/glossary/ai-agent.md)
- [Retrieval-augmented generation (RAG)](https://skillalmanac.com/glossary/retrieval-augmented-generation.md)

## Sources

- [Context windows](https://platform.claude.com/docs/en/build-with-claude/context-windows), Anthropic (accessed 2026-11-24)
- [Machine Learning Glossary: context window](https://developers.google.com/machine-learning/glossary#context-window), Google for Developers (accessed 2026-11-24)
- [Models overview](https://platform.claude.com/docs/en/models/overview), Anthropic (accessed 2026-11-24)
- [Create a Message (max_tokens)](https://platform.claude.com/docs/en/api/messages/create), Anthropic (accessed 2026-11-24)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-24. [Glossary index](https://skillalmanac.com/glossary.md).
