Fix: Context Window Exceeded Error
Error Message:
"Request too large" "Context window exceeded" "Please reduce the length of the input" "Input length exceeds maximum context window size"
What This Error Means
Every Claude Cowork session runs inside a fixed-size context window. Think of it as a whiteboard with a hard edge — once the board is full, nothing else fits. For standard plans that board holds roughly 200K tokens; Enterprise and Opus 4.6 Beta plans can stretch to 1M tokens. A token is roughly three-quarters of a word, so 200K tokens is about 150,000 words — a thick novel. That sounds like a lot, but it fills up faster than you'd expect because the window has to hold everything in the conversation: your prompts, Claude's replies, every file you attached, every tool output, and the system instructions themselves.
The error fires when the total token count of the current request plus the accumulated history pushes past that limit. It is not a bug in Claude — it is a hard ceiling enforced by the model's architecture. The good news is that the ceiling is predictable, and once you understand what eats tokens, you can keep well under it.
Root Cause Analysis
The most common trigger is invisible accumulation. You start a session, paste in a 60-page PDF, ask a few questions, paste another PDF, run a codebase search that returns 40 files, and keep going. Each of those operations adds tokens to the window permanently for that session. Nothing gets removed until you reset. A single large codebase read can dump 30,000–80,000 tokens into the window in one tool call. Do that twice and you've consumed most of a standard plan's budget before you've even asked your real question.
A second, sneakier cause is junk file ingestion. When you tell Claude to "read everything in this folder," it dutifully reads every file it can — including node_modules/, .git/, build artifacts, lock files, and minified bundles. A typical node_modules directory can contain hundreds of megabytes of text. Claude will try to read it all until the context window overflows. The error you see is actually the model protecting itself; without it, the request would silently fail or get truncated mid-file.
A third cause is long-running sessions that never reset. Over a full workday, a single chat can accumulate dozens of tool calls, file reads, and back-and-forth replies. Even if no single message is large, the cumulative history crosses the threshold. This is the "death by a thousand cuts" pattern — each individual turn looks small, but together they exceed the limit.
Real-World Example
A user was analyzing a competitor's product documentation. They uploaded a 120-page PDF spec (roughly 45,000 tokens), then asked Claude to cross-reference it against their own 80-page internal spec (another 30,000 tokens). So far so good — about 75K tokens used. Then they asked Claude to "read the entire codebase for context," pointing it at a monorepo with 1,200 source files. The tool call returned 90,000 tokens of file contents, pushing the total past 200K. Claude threw the context window error mid-task, and the user lost the analysis they'd built up over the prior 40 minutes of conversation.
Step-by-Step Fix
1. Reset the Session (Fastest Fix)
This is the first thing to try. Old conversation history is the single biggest token consumer.
- Type
/resetin the chat input, or click the New Chat button. - This clears all prior history and tool output from the window.
- Your uploaded files and workspace permissions are preserved — you don't need to re-grant access.
- After resetting, re-state your current question concisely. Don't re-paste everything from the old session.
2. Switch from "Read Everything" to Targeted Search
Instead of asking Claude to ingest an entire folder, point it at specific files.
- Bad: "Read every file in
~/projects/apiand tell me how auth works." - Good: "Search for files matching
authorloginin~/projects/api, then read only those."
Claude's search tools (grep, glob, file listing) use far fewer tokens than full file reads. A search that returns 5 relevant files costs maybe 2,000 tokens; reading all 200 files in the folder costs 50,000+.
3. Split Large Tasks Into Chunks
If you're working with a massive document, break the work into sequential steps:
- Ask Claude to summarize chapters 1–5. Note the summary externally (copy it out).
- Reset the session.
- Paste the summary back and ask for chapters 6–10.
- Repeat until done, then ask Claude to synthesize all summaries.
This keeps each session's window small while still producing a complete analysis.
4. Create a .coworkignore File
Prevent Claude from reading junk directories. Create a .coworkignore file in your workspace root, using the same syntax as .gitignore:
node_modules/
.git/
dist/
build/
*.min.js
*.lock
*.log
Claude respects this file when scanning directories and will skip anything matching the patterns.
5. Check Token Usage Mid-Session
On most plans, Cowork shows a token usage indicator near the input box. If you're above 80% of the window, you're in the danger zone — finish your current thought, save any output you need, and reset before starting the next task.
Common Pitfalls
- Re-uploading the same file after reset. If you reset and then re-attach the same 40,000-token PDF, you're back where you started. Extract only the pages or sections you need.
- Assuming "New Chat" deletes your files. It doesn't. Files in your workspace remain accessible; only the conversation history is cleared.
- Ignoring hidden files. On macOS, folders often contain
.DS_Storefiles and other hidden clutter. They're small individually but add up across thousands of directories. Your.coworkignoreshould include.DS_Store. - Pasting entire web pages. Copy-pasting a full Wikipedia article or documentation page can dump 10,000+ tokens in one shot. Paste only the relevant section, or give Claude the URL and ask it to fetch a specific part.
Prevention Checklist
- Start a fresh session for each distinct task — don't pile unrelated work into one chat.
- Set up a
.coworkignorefile in your workspace root on day one. - Prefer targeted file searches over "read the whole folder" requests.
- Monitor the token usage indicator; reset when you cross 80%.
- When working with large documents, extract sections rather than uploading the whole thing.
- Avoid pasting raw web pages — trim to the relevant portion first.
- If a session feels sluggish or Claude starts "forgetting" earlier context, that's a sign the window is nearly full. Reset proactively.