Troubleshooting
Context Window Exceeded: What to Do When Cowork Chokes on Too Many Files
Cowork hit its token limit on a big PDF or folder? Here's what the context window actually is, why it fills up, and practical ways to work around it.
Quickest fix: Start a fresh Cowork session, point it at a single subfolder or a small batch of files instead of the whole project, and ask for one specific task at a time.
You asked Cowork to help with a folder full of documents or a particularly hefty PDF, and partway through it threw up its hands with some variation of “prompt too long” or “context window exceeded.” It sounds like a confusing technical error, but it’s actually a fairly simple physical limit, like trying to fit too many papers on a desk at once. Once you understand the shape of the constraint, working around it is straightforward.
Quickest fix: Start a new Cowork session (clears the context), then give it one specific task on a small batch of files or a single document. If the document itself is enormous, ask Cowork to extract just the section you need rather than loading the whole thing.
What the Context Window Actually Is
Think of the context window as Claude’s working memory for a session. Everything in the conversation so far, including the contents of every file it has read, every question you’ve asked, and every response it has given, has to fit inside this window simultaneously. It’s measured in tokens, which are chunks of text roughly four characters long on average (a bit shorter for common English words, a bit longer for technical jargon or non-English text).
When the total size of that working memory exceeds the limit, Claude cannot continue. It’s not that the information is lost or corrupted; it’s that there’s simply no room to add anything new. You get an error, the task stops, and you need to figure out a smaller way to approach the problem.
This is different from your computer’s RAM or disk space. It’s a limit baked into the AI model itself, and it applies to every AI system that works this way, not just Claude. See the Anthropic documentation for current context window specs on different Claude models.
Why Files and PDFs Fill It Up Fast
When you share a folder with Cowork and ask it to work on the files inside, it reads those files and loads their contents into the context. A 50-page PDF might be 25,000 words. That’s a large chunk of context all at once. Add a few more documents of similar size, plus the back-and-forth of your conversation, and you can hit the limit faster than you’d expect.
A few specific situations push you into trouble quickly:
Large PDFs. Dense PDFs, especially reports, academic papers, legal contracts, or technical manuals, are context hogs. A 100-page legal document can easily use more context than an entire folder of short text files.
Folders with many files. If you point Cowork at a project folder and ask it to “review everything,” it will try to read everything. A software project with hundreds of source files, a photo archive with lots of sidecar metadata files, or a research folder with dozens of papers will all push the limit.
Long sessions. Every message in the conversation takes up context too. A session where you’ve been going back and forth for an hour, making revisions and asking follow-up questions, has a lot of conversation history sitting in the window. Tasks that would have worked at the start of the session may fail near the end just because of accumulated history.
Binary or poorly-formatted files. Some file types don’t convert cleanly to text and produce very large token counts relative to their information content. Cowork is better suited to plain text, markdown, and clean PDFs than to scanned documents or complex binary formats.
Fix 1: Start a Fresh Session
The single most reliable fix for a context window error is to start a new Cowork session. This clears the accumulated conversation history and any files that were loaded earlier. You start with a blank slate.
The tradeoff is that you lose continuity. Any context Cowork had built up about your project, your preferences, or previous work is gone. You’ll need to re-brief it on what you’re working on. For complex, ongoing projects, this gets tedious, which is why the other fixes below are worth learning.
Fix 2: Work on Fewer Files Per Task
Instead of pointing Cowork at your entire project folder, share a single subfolder or a small, specific set of files.
How to do this effectively:
- Before starting a task, think about which files are actually necessary. Cowork doesn’t need to read your entire codebase to fix a bug in one module.
- Create a temporary working folder and copy just the relevant files into it.
- Share that working folder with Cowork instead of the parent directory.
- Run the task. When it’s done, copy the results back to the main project.
This approach also tends to produce better results, not just fewer errors. Cowork does better work when it’s focused on a specific subset of files rather than trying to hold an entire project in its head.
Fix 3: Process Large Documents in Batches
If the problem is a single large document (a long PDF, a giant log file, a sprawling spreadsheet export), break the task into smaller pieces.
Numbered steps for large PDF processing:
- Ask Cowork to read the first section of the document (for example, “Read pages 1 through 30 of this PDF and summarize the key points”).
- Save that summary to a new file (ask Cowork to write it out, or copy it yourself).
- Start a new session.
- Ask Cowork to read the next section and produce a summary in the same format.
- Repeat until you’ve covered the whole document.
- In a final session, give Cowork all the summary files (which are much smaller than the originals) and ask it to synthesize them.
This is slower than doing it in one pass, but it works reliably and produces results you can check at each stage.
Fix 4: Ask for Extraction, Not Full Reads
Instead of asking Cowork to “read this document and then help me with X,” ask it to extract only what’s relevant to your task.
For example, instead of “Read this contract and tell me about the termination clauses,” try “In this contract, find and quote only the sections that mention termination, notice periods, or early exit. Do not summarize the rest.”
A targeted extraction task uses far less context than loading the whole document into a narrative summary. Once you have the relevant excerpt, you can ask follow-up questions about just that piece.
Fix 5: Convert and Compress Before Sharing
Some files are much larger than they need to be in their original format.
Useful conversions:
- Scanned PDFs (images of text) should be run through OCR to produce real text before sharing with Cowork. A scanned PDF can be 10x the context size of the same content as a text PDF. macOS Preview, Adobe Acrobat, and free tools like Tesseract can do this.
- Large Word documents can be saved as plain text or markdown before sharing. This strips formatting metadata that inflates token count without adding useful information.
- Log files with repetitive lines can be deduplicated or filtered before sharing. If a 50,000-line log is 90% the same error repeated, grep out the unique lines first.
Fix 6: Summarize and Save Before Long Sessions
If you’re planning a long working session on a large project, build a summary document first and use that as Cowork’s reference rather than the raw files.
Ask Cowork to read your project files early in a fresh session and produce a structured summary: directory layout, key components, main functions, open questions. Save that summary as a file in the project. In future sessions, share the summary file first. It gives Cowork the context it needs while using a fraction of the tokens.
This is especially useful for software projects. A concise README-style summary of what each file does takes far less context than the actual source code.
Knowing When to Wait for Anthropic
Context window limits have expanded significantly with each generation of Claude models. If you’re hitting the limit frequently on tasks that feel like they should be reasonable, it may be worth checking the Claude Help Center or the Anthropic blog to see if a larger-context option has become available. This is one area where the product genuinely improves over time, and advice that applies today may be obsolete in six months.
For now, the practical reality is that working in smaller, more focused batches is not just a workaround for the limit. It often produces better results anyway. Cowork is more precise when the task is well-scoped.
Frequently asked questions
How many files can Cowork handle in one session?
There's no fixed file count limit because it depends on file size. A folder of 200 tiny text files might be fine; five large PDFs might not. Watch the session as it reads files and stop it before it hits the limit if you notice it reading very large documents.
Does starting a new session fix the context window problem?
Yes, starting a fresh session clears everything from the context. The tradeoff is that Cowork starts from scratch and needs to re-read any files relevant to the new task.
Can Cowork summarize a huge file and then work from the summary?
Yes, and this is a practical workaround. Ask Cowork to read a large document and produce a summary or extract specific sections, save that output to a new file, then start a new session and point it at the summary file instead of the original.
Will Anthropic increase the context window limit?
Context window sizes have grown substantially over time and will likely continue to grow. Check the Anthropic blog for announcements. For now, working in batches is the practical path.
My PDF is only 20 pages but Cowork still hits the limit. Why?
Page count and token count don't map neatly to each other. A 20-page PDF with dense tables, complex layouts, or embedded images can produce far more tokens than a 20-page PDF of plain prose. PDFs with scanned content (images of text rather than real text) also require more processing.