Learning resourcesReviewed · Anthropic

Claude Context Windows Guide

Context windows is Anthropic's guide for developers building Claude conversations and agents, but larger context windows do not guarantee accurate recall. It explains how requests, generated answers, thinking and tools share the model's working memory, and describes ways to manage that memory as conversations grow.

Researched 13 Nov 2026

In short.

Context windows is Anthropic's guide for developers managing long Claude conversations, but having room for more material does not guarantee that the model will use it accurately. It explains request and output accounting, model-dependent thinking retention, tool cycles, context awareness and overflow behavior. Its practical value is helping developers budget space and choose context-management techniques; exact prices, complete integration instructions and application-level results are not established by this page.

Researched and written by an AI model and checked by a second AI model. How it works

Covers the complete supplied text of the single documentation page at [https://platform.claude.com/docs/en/build-with-claude/context-windows.md], including its notices about context degradation, model deprecation, beta features, pricing exceptions, image limits, thinking signatures and overflow. Linked pages and referenced image assets are outside the supplied evidence. No commands, code, API requests or agent workflows were executed; operational behavior, application quality, costs and current account-specific availability remain unassessed.

The overview

Identity

Context windows is a Claude API documentation page from Anthropic. The original source address is [https://platform.claude.com/docs/en/build-with-claude/context-windows.md], and the page declares its web address as [https://platform.claude.com/docs/en/build-with-claude/context-windows].

It is an explanatory reference covering the model's working memory, including conversation history, generated output, thinking and tool use. It links to implementation guides for related features.

Assessment

This guide is useful when a Claude application accumulates conversation history, large documents or tool results. It distinguishes reaching a hard capacity limit from losing accuracy while still inside that limit.

Concrete API fields, retention rules and error behavior make it useful for implementation planning. It does not demonstrate effective recall at the advertised limits or establish that a particular agent can complete long tasks reliably.

Users

Beginners can use the working-memory explanation to understand why earlier messages and new answers compete for space. The distinction between training data and request context is particularly helpful for understanding what the model can reference during a conversation.

Experienced developers building document assistants, tool-using agents or long conversations can use the accounting details to plan output capacity, preserve thinking blocks correctly and handle overflow. Applying those details requires familiarity with Claude API requests and responses.

Capabilities

The page explains token accumulation, cached-input accounting, thinking retention, tool-result handling, compaction, context editing and overflow. It lists multiple models with 1M-token windows and up to 128k generated output tokens, and describes 200k-token windows for other models.

It also describes automatic context-awareness updates for Claude Sonnet 5, Sonnet 4.6, the deprecated Sonnet 4.5 and Haiku 4.5. Several other named models do not receive those updates; the page points to beta task budgets for explicitly supplying a budget.

Using it

Requirements

Applying the guidance requires identifying the exact Claude model, its context limit, the requested max_tokens and whether thinking or tools are enabled. Developers also need to account for system instructions, messages, tool definitions and attached content.

The page does not establish SDK version requirements, account eligibility, regional availability or complete access prerequisites for the linked beta features. Those details remain unknown within this source.

Mechanism

The context window contains the request plus the generated output. System instructions, messages, tool definitions, tool results, images and documents consume space, as do the current answer and its thinking. With prompt caching, input_tokens, cache_read_input_tokens and cache_creation_input_tokens all count toward capacity.

Thinking tokens share the max_tokens output allowance. Previous thinking is retained by default on Opus 4.5 and later Opus models, Sonnet 4.6 and later Sonnet models, Haiku 5.5 and the listed Fable and Mythos models. On earlier Opus and Sonnet models, and Haiku models through Haiku 4.5, the API automatically strips previous thinking blocks when they are passed back, following the described turn and tool-cycle rules.

During a tool cycle, the thinking block accompanying a tool request must be returned intact with the corresponding results, including its signature. On models that strip earlier thinking, that block can be dropped automatically after the cycle reaches the next user turn.

Setup

Start with the chosen model's window size and thinking-retention default. The page recommends estimating requests with the token counting API and examining response usage. Set max_tokens with room for both visible output and thinking, and handle the returned stop_reason.

For conversations regularly approaching capacity, the page recommends server-side compaction, described as beta for Claude 4.6 and later models and Claude Mythos Preview. Context editing offers tool-result clearing and thinking-block clearing. Complete enablement requests and configuration details are located in linked pages and are not supplied here.

Example

The page illustrates context awareness with a 200,000-token budget: after 35,000 tokens have been used, the remaining capacity is 165,000. It says the API injects these budget notices automatically on supported models; developers should not insert the illustrated tags themselves.

For a document-reading agent, the same accounting means that returned document text and tool definitions occupy space alongside the conversation and future answer. Clearing an old tool result can reduce retained content, while caching it does not remove its context usage. This is an illustrative application of the documented rules; no agent or API request was executed.

Assessment & evidence

Limitations

The guide warns that accuracy and recall can degrade as context grows, but provides no benchmark measuring that degradation. It also provides no measured latency, task-success results or assessment of information retained after compaction.

Token capacity is not the only limit. The page allows up to 600 images or PDF pages for 1M-window models and 100 for 200k-window models, while warning that request-size limits may be reached first. Exact request byte limits are not given.

Input exceeding the window produces a 400 invalid_request_error. On Claude 4.5 and newer, a request whose input plus max_tokens exceeds capacity can be accepted, but generation stops with model_context_window_exceeded if it reaches the window boundary. Earlier models require the documented beta header for that overflow behavior. No described behavior was independently tested.

Reasoning

The documented accounting implies that short final answers do not necessarily mean small requests: accumulated tool outputs and retained thinking can consume capacity and become input again on later turns. This is a design implication, not a measured cost or performance result.

Window size, retained relevance and available output space therefore need to be considered together. The page establishes why context management matters, but does not identify an optimal clearing or summarization strategy for a particular workload.

Alternatives

Within Claude, the page presents compaction for continuing growing conversations, tool-result clearing for accumulated tool content and thinking-block clearing for earlier reasoning. Their suitability depends on which material is consuming space.

Prompt caching addresses pricing rather than capacity, so it cannot by itself prevent context overflow. The page also references context-engineering articles and a memory-tool pattern for multisession agents; their contents and competing providers are not assessed here.

Evidence

The supporting source is the complete supplied text of the Context windows documentation page at [https://platform.claude.com/docs/en/build-with-claude/context-windows.md], captured at 2026-11-13T01:28:16.382Z. Its source revision is sha256:aa289e55ec1ee55ec7c1fc3d609372707bd09e5fc4d5c0b11f5fd816ce7382cc.

The text provides the explanations, API field names, model-specific claims and notices discussed here. Linked documentation, pricing tables and engineering articles were not supplied. Diagram descriptions are present, but the referenced image files are not included. No runtime results are available.

Access & freshness

Costs

Numeric API prices and workload costs are unknown from this page. It says long-context requests use standard pricing for the listed 1M-window models, except Claude Haiku 5.5, where prompts exceeding 100,000 tokens cost more. The surcharge amount is not provided.

Thinking is billed as output when generated and counts toward rate limits. Retained thinking becomes billable input on later requests. Prompt caching changes the price of cached input without freeing context space. Compaction-specific charges and achievable savings are not established here.

Rights

The supplied page contains no explicit documentation license or permission to redistribute its text or images. Public availability alone does not establish those permissions.

Claude API service terms, data-handling terms and rights concerning generated outputs are not specified on this page. Those rights remain unknown within the supplied evidence.

Freshness

The capture date identifies the available snapshot; the page's publication and last-update dates are unknown. It labels server-side compaction and task budgets as beta and identifies Sonnet 4.5 as deprecated.

Model availability, window limits, thinking defaults, beta requirements and pricing exceptions are specific to this captured text. Changes after capture and availability for individual accounts are unknown.

Actions

Use the guide to map everything occupying a request and identify the chosen model's thinking-retention and overflow rules. Follow its linked official documentation to establish exact integration steps, current model limits and numeric pricing before committing to a design.

For an application using long conversations, verify token estimates, tool-cycle thinking preservation, stop-reason handling and the usefulness of information retained after clearing or compaction on representative tasks. Those application-level outcomes remain unassessed by this page.

Evidence for this report

selected-page.txtselected · checked 2026-11-13