Technology & Innovation Artificial Intelligence

Claude Context Window: Sizes, Limits and How to Manage It

The Claude context window is the working memory of a Claude conversation: 200,000 tokens for most models, 1,000,000 for the newest. Sizes by model and surface, what fills the window, and how to manage it.

A software developer at a desk with a laptop showing blurred code and a long chat conversation
A long Claude Code session fills the context window with every file read and every reply given.
Table of Contents

The Claude context window is the working memory of a Claude conversation: everything the model can see and use while it answers. For most Claude models that window holds 200,000 tokens. For the newest models it holds 1,000,000. This guide explains the sizes, what fills the window, what happens when it runs out, and how to manage it.

If you have used Claude for a long coding session, you have felt the window. The first hour is sharp. The second hour, the model starts forgetting files you opened, repeating questions, or giving vaguer answers. That is not a bug. As the context grows, accuracy and recall degrade, a problem researchers call context rot.

Key Takeaways

  • The Claude context window is 200,000 tokens for most models and 1,000,000 tokens for the newest models, including Opus 4.6, Sonnet 4.6 and Haiku 5.5.
  • Paid Claude chat plans run at 500,000 tokens for the newest models. Claude Code reaches 1M through its [1m] model variants.
  • Everything counts toward the limit: your messages, files, tool results, images, the system prompt, and the model’s own replies.
  • A two-hour coding session can use 100,000 to 300,000 tokens, so a 200K window can run out in one afternoon.
  • Use /context to see what fills the window, /compact to summarise and carry on, and /clear to start fresh.

What is the Claude context window?

The Claude context window is the total amount of text a Claude model can reference in one conversation, measured in tokens, including everything it has already written back to you. It is working memory, not training data: the model does not learn from your conversation, it just holds it while the session lasts.

One token is roughly 3 to 4 characters of English, so 200,000 tokens is about 500 pages.

Two facts about the window catch most people out. First, the window holds the model’s output too, including its thinking. Long replies eat the window as surely as long files do.

Second, accuracy falls as the window fills. A model with a full context gives worse answers than the same model with a fresh one, even though it has more information in front of it. That is why managing the window matters more than its size.

How big is the Claude context window?

The size depends on the model and on where you use it. The table below gives the sizes for the current models across the three main surfaces: chat, Claude Code and Cowork.

ModelContext sizeClaude chat (paid plans)Claude Code
Opus 4.6, 4.7, 4.8, 5, 5.51M tokens500K1M via [1m] variant
Sonnet 4.6, 5, 5.51M tokens500K1M via [1m] variant
Haiku 5.51M tokens500K1M via [1m] variant
Fable 5, 5.1, 5.21M tokens500K1M via [1m] variant
Mythos 5, 5.1, 5.2, Preview1M tokens500K1M via [1m] variant
Other Claude models200K tokens200K200K

The 1M-token models are the current generation: Fable 5.2, 5.1 and 5, Mythos 5.2, 5.1, 5 and Preview, Opus 5.5, 5, 4.8, 4.7 and 4.6, Sonnet 5.5, 5 and 4.6, and Haiku 5.5. Every other model runs at 200,000 tokens.

On the 1M models, a single request can produce up to 128,000 output tokens and include up to 600 images or PDF pages. The 200K models allow 100.

On paid Claude chat plans, the newest models run at 500K tokens: Fable 5, Opus 4.8, 4.7 and 4.6, and Sonnet 4.6. Any model outside that list runs at 200K, roughly 500 or more pages. The 1M window is the default, and standard pricing applies, except that Haiku 5.5 prompts over 100,000 tokens cost more.

Claude Code reaches 1M through the [1m] model variants: Opus 4.6 and Sonnet 4.6 in their [1m] form. Cowork is different again. It auto-compacts at different points by model: Sonnet 5 at 500K, Sonnet 4.6 and Opus 4.6 at 200K, and Haiku 5.5 at 500K.

The Claude context window docs list the current sizes for every model, and the Claude paid plan limits page gives the chat figures.

What fills the window?

Everything in the conversation counts. Your messages count. The files you attach count. Tool results count, including the output of code the model runs. Images and documents count. The system prompt counts, and so do the tool definitions themselves, which is why a session with many tools available fills faster than a plain chat.

The model’s own output counts too, including its thinking blocks. On Opus 4.5 and later, Sonnet 4.6 and later, Haiku 5.5, Fable 5.x and Mythos 5.x, thinking blocks are kept by default, so a model that thinks hard uses more of its window. A few concrete sizes help make this real:

  • A 500-line TypeScript file is roughly 1,500 to 2,000 tokens.
  • A long chat message with a pasted error log can be 5,000 to 10,000 tokens.
  • A single screenshot counts as roughly 1,000 to 2,000 tokens, depending on size.
  • A 20-page PDF can be 10,000 to 20,000 tokens once its text is extracted.
  • A tool result that dumps a whole test suite can be tens of thousands of tokens in one step.

Two things do not count. Your CLAUDE.md file is read fresh at the start of every session, but it is not session context, so it does not sit in the window. And nothing from one conversation carries into the next: every new chat starts with an empty window.

A two-hour coding session, in tokens

Two hours of coding with Claude can use 100,000 to 300,000 tokens. That range surprises people, because 200,000 tokens sounds like a lot. The worked budget below shows where it goes in a realistic session: fixing a bug in a medium-sized project, with tests run twice.

What happensTokens usedRunning total
Read 10 source files, about 500 lines each15,000 to 20,00020,000
Your messages, prompts and questions5,00025,000
Model replies, plans and explanations20,000 to 30,00055,000
First test run and its output15,00070,000
More files read while debugging20,00090,000
Second test run, bigger output25,000115,000
Thinking blocks across the session30,000 to 50,000165,000
Final edits, summary and follow-ups20,000185,000

At 185,000 tokens, a 200K window is nearly full after two hours of ordinary work, and the last part of the session runs with the model already losing track of the earliest files. On a 1M model the same session uses under a fifth of the window.

The same arithmetic applies outside coding. A research session with five long PDFs and a dozen follow-up questions can pass 100,000 tokens in an hour. A writing session where you paste three drafts and ask for revisions each time fills the window with your own words.

What happens when the window fills?

It depends on how you hit the limit. If a single input alone is over the limit, the API returns a 400 error with the code invalid_request_error and the message “prompt is too long”. There is no partial answer. You have to shorten the input and try again, usually by removing files or splitting the request.

If the window fills during a reply, Claude 4.5 and later stop with the stop reason “model_context_window_exceeded”. The reply simply ends, sometimes mid-sentence. In Claude Code, the primary strategy is server-side compaction: the system summarises the earlier conversation and carries on.

Compaction is not magic. A summary keeps the decisions and the current state, but it loses the exact wording of earlier messages, the details of files read long ago, and the reasoning behind choices. After a compaction, the model may ask about things it already read, or redo work it already did.

The management playbook

Managing the window is a habit, not a setting. Four commands and three habits cover almost every situation.

A laptop screen showing a long scrolling AI chat conversation with blurred message bubbles and a usage meter bar
A long conversation grows token by token. Checking what fills the window is the first step in managing it.

Start with /context. It shows what fills the window right now: how much your messages take, how much files take, how much the model’s replies take. Check it when a session starts to feel slow or forgetful. It tells you whether the problem is one huge file or a hundred small messages.

Use /compact when the session is long but still valuable. It summarises the conversation now, keeping the current state and the key decisions, and frees the window. You can add a focus hint, such as what to preserve. Use it before the window fills, not after: a compaction you choose is better than one forced on you.

Use /clear when the session has served its purpose, or when the model starts repeating itself. It wipes the conversation and starts fresh with an empty window. Pair it with a good CLAUDE.md, which is read fresh at the start of every session, so the new session still knows the project conventions without carrying the old conversation.

Use /usage to see session tokens. It shows how much you have used in the current session, which helps you learn your own pattern: how many tokens your typical session takes, and which habits burn the most.

Three habits make the commands work better. First, start a fresh session for each task instead of piling unrelated work into one chat. Second, read only the files the task needs, and ask the model to summarise a file rather than dumping it whole.

Third, keep your own notes outside the chat: a short summary in a file is worth more than a long conversation the model has to re-read.

Our Claude regression testing guide shows a long Claude Code session in practice, and the GPT-OSS versus Gemini comparison puts Claude’s rivals in the same frame, since their context limits shape the same trade-offs.

Frequently Asked Questions

How many tokens is the Claude context window?

The newest Claude models have a 1,000,000-token context window, including Opus 4.6, Sonnet 4.6, Haiku 5.5, Fable 5 and Mythos 5. Every other Claude model has a 200,000-token window. Paid Claude chat plans run the newest models at 500,000 tokens.

Does the Claude context window include the model’s replies?

Yes. Everything counts toward the limit, including the model’s own replies and its thinking blocks. That is why a long session fills the window even if your own messages are short: every answer the model gives takes up space too.

What happens when the Claude context window is full?

If a single input is over the limit, the API returns a 400 error saying the prompt is too long. If the window fills during a reply, Claude 4.5 and later stop with the reason “model_context_window_exceeded”. In Claude Code, server-side compaction summarises the conversation and carries on.

How do I free up space in the Claude context window?

Use /compact to summarise the conversation and keep going, or /clear to start fresh with an empty window. Start a new session for each task, read only the files you need, and check /context to see what is using the most space.

Is a 1M context window better than 200K?

For long sessions, yes: a two-hour coding session can use 100,000 to 300,000 tokens, so a 200K window can run out in one afternoon. But accuracy still falls as the window fills, so a 1M window is not a substitute for managing it. Fresh sessions and compaction matter at any size.

Manage the Window, Don’t Just Fill It

The Claude context window is generous at 200,000 tokens and very generous at 1,000,000, but size is only half the story. The other half is what you put in it. A session that reads ten files it never needed will run out of room at any size, and its answers will get worse as it fills.

Start your next long session with the playbook: check /context once an hour, compact before the window fills, and clear and start fresh when the task changes. That is how you get the value of a million tokens instead of just using them up.

David Chen
Senior Technology Analyst

David Chen

David Chen is a senior technology analyst who explains complex systems in plain language. A former software engineer, he covers artificial intelligence, semiconductors and the innovations reshaping the tech industry.

View Full Author Profile →
Keep Reading

Related Stories

More in Technology & Innovation →