Core Concepts

Load Entire Codebases and Books into One Claude Conversation

1M tokens, about 555,000 words in one request

Claude's context window is the amount of text it can reference at once, including its own response. On Anthropic's current models (Claude Fable 5.1, Opus 5.5, Sonnet 5.5, and Haiku 5.5) it is 1M tokens, which Anthropic puts at roughly 555,000 words. That fundamentally changes how you can work with AI. Instead of feeding Claude small snippets and hoping it understands the bigger picture, you can give it the entire picture.

A context window is not just a feature spec, it determines what kinds of tasks are possible. A 4K-token window can handle a short conversation. A 1M-token window can analyze an entire codebase, read a full book, or compare dozens of documents simultaneously. Here's what you need to know.

Anthropic's current Claude models (Fable 5.1, Opus 5.5, Sonnet 5.5, and Haiku 5.5) have a 1M-token context window, roughly 555,000 words, and can generate up to 128K output tokens per request. Some older models, such as Claude Haiku 4.5, have a 200K-token window (about 150,000 words). That means you can include entire codebases, full research papers, or 300-page documents in a single request, and Claude can reference any part of it in responses.

Fundamentals

What is a context window?

Tokens: the unit of measurement

AI models don't read words, they read tokens. A token is a chunk of text, typically 3-4 characters in English. "Hello" is one token. "Anthropic" is two tokens ("Anthrop" + "ic"). Code tokenizes differently from prose, a line of Python might be 10-20 tokens depending on variable names and syntax. Anthropic puts 1M tokens at roughly 555,000 English words on its current tokenizer (older models fit about 750,000 words in 1M tokens), and 200K tokens at roughly 150,000 words.

Why context window size matters

The context window determines what Claude can "see" when generating a response. Everything inside the window, your messages, Claude's responses, uploaded documents, system prompts, is visible. Everything outside is invisible. A larger window means Claude can reason across more information simultaneously, which enables tasks that are simply impossible with smaller contexts: analyzing entire legal contracts, reviewing full codebases, or maintaining coherent long conversations.

Input tokens vs. output tokens

The context window includes both what you send (input tokens) and what Claude generates (output tokens). A single request on a current model can generate up to 128K output tokens, and any thinking Claude does counts too. If your input nearly fills the window, there is little room left for the response, so leave headroom for the answer you expect.

Comparison

Context window by Claude model

ModelContextApprox. WordsNotes
Claude Fable 5.11M tokens~555,000 wordsUp to 128K output tokens per request. For demanding reasoning and long-horizon agentic work.
Claude Opus 5.51M tokens~555,000 wordsUp to 128K output tokens per request. For long-running agentic coding and knowledge work.
Claude Sonnet 5.51M tokens~555,000 wordsUp to 128K output tokens per request. Balances speed and intelligence.
Claude Haiku 5.51M tokens~555,000 wordsUp to 128K output tokens per request. For high-volume, latency-sensitive tasks.
Claude Haiku 4.5 (legacy)200K tokens~150,000 wordsOlder models such as Haiku 4.5 and the deprecated Sonnet 4.5 keep a 200K window.

Context sizes from Anthropic's documentation as of October 2026. For every Claude release with its date, see the Claude Model Timeline.

Applications

How to use the full context window

Codebase analysis

Load an entire repository into a single conversation. Claude can read thousands of lines of code, understand the architecture, find bugs across files, suggest refactors that account for dependencies, and generate documentation that reflects the actual implementation, not just the file it can see.

Long document analysis

Upload contracts, research papers, financial reports, or even entire books. Ask Claude to summarize, extract specific information, identify inconsistencies, or answer questions that require synthesizing information from different sections. No chunking or splitting required.

Multi-document comparison

Load multiple documents simultaneously, competing proposals, different drafts of a contract, research papers on the same topic, or quarterly reports across years. Claude can compare, contrast, and identify differences that would take hours to find manually.

Extended conversations

In a long working session, your conversation history stays in context. Claude remembers what you discussed 50 messages ago. This means you can iteratively refine work, editing a document, discussing strategy, debugging code, without Claude losing track of earlier decisions.

Best Practices

Context window best practices

Front-load the most important content

Put your key documents and instructions at the beginning of the conversation. While Claude can access the full context window, attention is strongest at the beginning and end of the context. Structure your prompt so critical information appears first.

Use structured formatting for large inputs

When loading multiple documents, clearly label each one with headers, XML tags, or delimiters. "Document 1: Q3 Financial Report" is much easier for Claude to reference than an unlabeled wall of text. Structure helps Claude cite and cross-reference accurately.

Know when to chunk instead

Just because you can fit everything in one context doesn't always mean you should. If you need to process 500 documents with the same prompt, batch processing (one document per request) is more reliable and cost-effective than cramming them all into one conversation. Use the full context for tasks that require cross-document reasoning.

Monitor your token usage

Every token in the context window costs money on the API. A request carrying 200K tokens of context costs significantly more per message than a 5K-token one, because the model processes the entire context with every response. For cost-sensitive applications, only include what the model actually needs to see.

FAQ

Frequently asked questions

Does a bigger context window always mean better results?

Not necessarily. A larger context window means Claude can see more information, but the quality of results depends on how you structure that information. A well-organized 10K-token prompt often outperforms a messy 100K-token dump. The context window is a capacity limit, not a quality dial, think of it as a desk: a bigger desk helps when you genuinely need to spread out many documents, but a tidy small desk beats a cluttered large one.

How do I count tokens?

One token is roughly 3/4 of a word in English. A 1,000-word document is approximately 1,333 tokens. Code tends to tokenize less efficiently than prose, expect roughly 1 token per 3 characters for code. Anthropic provides a tokenizer tool in their documentation, and most API client libraries include a token counting utility.

What is the difference between context window and memory?

The context window is everything Claude can see in a single conversation, your messages, its responses, and any documents you've shared. It resets when you start a new conversation. Memory (via Claude Projects or the API's system prompt) is persistent information that carries across conversations. Think of context as short-term working memory and projects/system prompts as long-term reference material.

How does context window size affect cost?

On the API, you pay per token, both input and output. A conversation that fills a large share of the context window costs more per response because Claude processes the entire context each time it generates a reply. This is why context management matters: only include information the model needs for the current task. On claude.ai (consumer product), context costs are covered by your subscription.

Learn to use Claude effectively

Stop reading about it. Build something.

Frequently Asked Questions

How big is Claude's context window?

Anthropic's current models (Claude Fable 5.1, Opus 5.5, Sonnet 5.5, and Haiku 5.5) have a 1M-token context window, roughly 555,000 words, which can hold entire codebases, research papers, or book-length documents. Some older models, such as Claude Haiku 4.5, have a 200K-token window.

What can I fit in Claude's context window?

On a current model you can fit roughly 555,000 words, an entire mid-size codebase, or many research papers in a single request. A request can also include up to 600 images or PDF pages, though very large files can hit request size limits before the token limit.

Does a larger context window affect quality?

It can. Anthropic's documentation notes that as token count grows, accuracy and recall degrade, which it calls context rot. More context is not automatically better, so curate what you include and put the material that matters most where it is clearly labeled.

Which Claude models have a 1M-token context window?

According to Anthropic's documentation, Claude Fable 5.1, Fable 5, Opus 5.5, Opus 5, Opus 4.8, Opus 4.7, Opus 4.6, Sonnet 5.5, Sonnet 5, Sonnet 4.6, and Haiku 5.5 all have a 1M-token window, and 1M is the default with no beta header needed. Other models, including Claude Haiku 4.5 and the deprecated Sonnet 4.5, have a 200K-token window.

How do I optimize token usage with Claude's context window?

Use prompt caching to avoid resending static content, structure your inputs with clear sections so Claude can reference specific parts, and use the /compact command in Claude Code to compress conversation history. For API users, the system prompt is cached automatically after the first request.

Nightschool AI is an independent learning platform and is not affiliated with, endorsed by, or sponsored by Anthropic. Claude is a trademark of Anthropic, PBC. Looking for Anthropic's official Claude Academy? It's at academy.claude.com.