Prompt is too long (context window exceeded)
The assembled prompt exceeded the model context window.
322 issues · 20 open · 302 resolved (94%) · first seen Feb 24, 2025
First response · account
What to do now
Most likely: Authentication, usage state or session size blocked the request.
- Check the exact account, organization and usage window currently selected.
- Try a new short session before deleting credentials or local history.
- If the state is inconsistent across machines, preserve diagnostics and re-authenticate once.
These are conservative triage steps, not an official Anthropic fix. Use the issue and workaround evidence below before making a destructive configuration change.
Is this getting better or worse?
This class of problem is converging. 33 new reports in the last 90 days vs 95 in the 90 before — -65%. The open backlog peaked at 52 in 2025-12 and sits at 20 today.
Derived by counting each matching issue from its creation date until it closed. First-party
computation over the anthropics/claude-code tracker — the trend is not published
anywhere upstream.
Which builds report this
141 of these reports name the Claude Code build they were running, spanning 72 releases. Heaviest reporters:
- Claude Code v2.0.76
- Claude Code v2.1.220
- Claude Code v2.1.114
- Claude Code v2.1.126
- Claude Code v2.1.42
- Claude Code v2.1.7
- Claude Code v2.1.229
- Claude Code v2.1.150
Report volume, not a defect count: an issue can mention a build without that build having caused the failure. Versions come from the version string in the bug-report template, matched against real published tags.
Do these get fixed?
Median time to close is 21 days across 302 closures. Of the 302 closures with a recorded reason, 16% were closed as completed and 255 as not-planned or duplicate. The most recent completed fix landed in 2026-08.
Workarounds reported by the community
47 of these issues post a workaround someone says worked. The highest-engagement ones:
- [BUG] Github Issue Prompt Too Long
- …e - Maintain sliding window of detailed context --- Current Workarounds Users must manually: - Run every 50-100 messages - Avoid reading large files entirely - Use / when reading files - Start new sessions frequently - M…
Found in the description of #23377 · still open - Subagents fail with 'prompt is too long' when user has many MCP servers (tool definitions exceed 200k)
- …rune least-relevant MCP tools rather than failing silently. Workarounds - Pass explicitly on Agent calls (costs more quota) - Reduce MCP servers in (defeats the purpose of having them) - Move servers to project-level con…
Found in the description of #37793 · still open - [BUG] Keep hitting "Request size exceeds model context window"
- happens more on Opus (default setting)- as a temp workaround i noticed you can set it to sonnet ask something and then change back to "default" model setting. Sonnet seems not causing issues for me at least.
Found in the thread of #6357 · resolved - /goal Stop hook fails with "Prompt is too long" when goal text is large
- …nd blocks the Stop. Subsequent Stops repeat the same error. Workaround that recovers cleanly: /goal clear. After clearing, Stop works again. Short single-sentence goals do not trigger the bug. Claude Model Opus Is this a…
Found in the description of #58192 · resolved - Explore agent always fails with "Prompt is too long" when many MCP tools are connected
- …ntext since Explore is specifically for codebase navigation Workaround Use and tools directly, or use the Agent type. Environment - macOS (Darwin 25.2.0, arm64) - Claude Code CLI - Model: claude-opus-4-6 (1M context) - ~…
Found in the description of #38928 · still open
Excerpts are quoted from the linked issue so you can judge relevance before opening it. Threads that only ask for a workaround, or report that there is none, are excluded. These are community suggestions, not official guidance from Anthropic — read the full thread before applying one.
Matching issues 1–100
Ranked by community engagement (reactions weighted over comments). Listing the top 300 of 322 matches; the statistics above cover all 322.
- [BUG] Github Issue Prompt Too Long
- Subagents fail with 'prompt is too long' when user has many MCP servers (tool definitions exceed 200k)
- [BUG] Keep hitting "Request size exceeds model context window"
- [BUG] Prompt is too long (Claude for VS Code)
- /goal Stop hook fails with "Prompt is too long" when goal text is large
- Compaction Failure: Conversation Length Exceeds Limit
- Explore agent always fails with "Prompt is too long" when many MCP tools are connected
- [BUG] Vertex AI 413 - can't count tokens
- Auto-compact to avoid "input length and max_tokens exceed context limit" errors
- Background task notifications trigger autonomous API calls — model responds as if it were the user
- [BUG] Cowork completely unusable on Windows — recurring VM crashes, tab disappearing, and brief recovery followed by immediate failure (Max plan subscriber)
- Compaction Failure: Conversation Length Exceeds Processing Limit
- [BUG] 'claude-api' is consuming entire context
- Skills from plugins registered twice in system prompt, doubling context usage
- [Bug] Claude hangs indefinitely on simple tasks, requires cancellation to resume
- [Bug] Memory leak causing performance degradation during extended runtime
- [BUG] [`Critical`] Compact issue block the normal use of Claude code
- [BUG] Claude for Windows desktop app does not switch to extra usage when 5-hour limit is reached, while Claude Code CLI on the same account does
- [Feature Request] Remove or make optional resume summary/compaction prompt on session resume
- Token counting ~2x inflated in 2.1.7 vs 2.1.2
- [Bug] Compaction fails with "Conversation too long" error, leaving session unrecoverable
- [Bug] Claude Code repeats completed plan steps due to stale state
- [Bug] `/context` command not functioning with sonnet[1m]
- API Request Size Exceeds Context Window Limit
- Unstable Terminal UI: Unexpected Scroll Jumps Disrupting Code View
- [FEATURE] Extend deferred tool loading to built-in subagents
- Anthropic API Context Limit Exceeded During Compaction
- Subagent results silently overflow context, causing unrecoverable session crash
- TaskOutput burst polling causes unrecoverable 'Prompt is too long' when multiple background agents complete simultaneously
- [Bug] Chat becomes unresponsive after "Prompt is too long" error
- [BUG] Maximum call stack exceeded
- [Bug] Anthropic API Error: Internal server error (500)
- Prompt too long error persists when compact command fails despite CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=60
- [BUG] VSCode extension stores user messages as per-character content blocks, causing premature 'Prompt is too long'
- [Bug] Compaction fails with "Conversation too long" error when context limit reached
- Terminal Resize Causes Unexpected UI Scroll Position Reset
- ⎿ API Error: 500 {"type":"error","error":{"type":"api_error...
- [BUG] 'Update' tool on a large file loads the entire file into context exceeding the compactable amount causing the chat to become irrecoverable.
- Sub-agents fail with 'Prompt is too long' in Claude Code Desktop App 2.1.87
- [FEATURE] A "context 80% full" indicator to warn that context window may run out.
- [BUG] 'Prompt is too long' error on ~50 word prompts in new sessions despite 80K+ free context
- [BUG] Bug Report: 1M Context Model Option Enforces 200K Token Limit
- [Bug] Compact Command Fails with "Conversation Too Long" Error
- [Bug] Anthropic API Error: Request Payload Exceeds Context Window Limit
- [BUG] System prompt consumes ~9.3M tokens on every session after installing Claude Desktop on Windows (WSL setup)
- Skills with context: fork still inject all MCP tool definitions into subagent, ignoring allowed-tools
- [BUG] claude with model sonnet[1m] doesn't accept single messages > 200.000 tokens
- Infinite Read Operation Hang in Claude Code CLI During File Processing
- [Bug] Explore agent fails with zero tool uses at conversation start
- [Bug] Rate limit error at 72% token usage
- [FEATURE] Controllable subagent context: filter MCP servers, plugins, skills, and rules per agent
- [BUG] Sandbox mode generates ~607k token system prompt with large permissions.deny list
- All plugin hooks stop firing after context compaction
- [Bug] Auto-Compact Failure Leaves Instance in Unrecoverable Context Limit State
- Session locks with 'Prompt is too long' — blocks input, wastes tokens
- [Bug] /compact command does not clear "Context low" warning message
- [Bug] Context command doesn't work for sonnet[1m] past a certain point
- [Bug] Compact command fails with "Conversation too long" error
- Context Window Exhaustion with Minimal Token Usage
- Automatic Context Management for Large Code Generation
- Explore subagent always fails with "Prompt is too long" when many MCP servers are registered
- [Bug] Context limit warning triggered incorrectly when limit not reached
- [Bug] Context Compaction fails when agent reaches context limit
- [BUG] Context limit reached - Autocompact spiral background agents return results simultaneously
- Tool results embed full file content causing 'Prompt is too long' crashes
- [BUG] In mass agent work, prompt is too long
- [Bug] MCP tools loaded upfront despite tengu_mcp_tool_search flag enabled
- "Agent Execution Interruption During Task Processing"
- [BUG} API Error: 400 'input length and `max_tokens` exceed context limit' occurs when close to compaction
- [BUG] Cowork mode: sub-agent spawning completely broken — "Prompt is too long" at 0 tokens for all models
- [Bug] Hook subprocess cleanup causes 100% CPU freeze on task interruption
- Improve Error Messaging for API Usage Limits
- [BUG]`API Error: Context limit exceeded makes tool unusable in longer sessions`
- [BUG] /goal stop hook "Prompt is too long" in long-conversation sessions even with 1M-context model enabled
- Cannot resume session when context exceeds limit - no way to compact before loading
- [BUG] CLI streaming files silently hangs and fails when token limit is exceeded
- [Bug] Auto-compact fails mid-session during refactor operations
- [Bug] Token count calculation exceeds context window limit (Messages: 212.8k/200k)
- [Bug] Compaction fails with multiple sub-agents
- [Bug] `/compact` command produces no output or effect
- [Bug] Context Window Overflow Despite Reported Available Space
- "Unexpected Compaction Prompt and Compaction Failure"
- /goal Stop hook fails with "Prompt is too long" in long sessions
- Subagent context budget blown by eagerly-materialized MCP tool schemas and skill listing
- `claude respawn` silently fails on background sessions that hit "request too large" — only nuclear `claude rm + claude --bg` recovers (loses conversation)
- [BUG] Claude Code shows "Usage limit reached" while all plan limits are well below 100%; new 5-hour session jumped to ~20% immediately after reset
- [FEATURE] Extend deferred tool loading to subagents — refile of #31623
- 500 errors
- [Bug] Explore agents unable to execute due to prompt-size limit constraints
- Allow per-agent-type model overrides in settings
- [Bug] Context limit error during active compacting operation
- feat: Add max_return_size parameter to Task tool for task-notification truncation
- [BUG] getting prompt is too long after just 130 messages,
- Prompt is too long /compact Error: Error during compaction: Error: Conversation too long. Press esc twice to go up a few messages and try again.
- [FEATURE] Proactive warning when file attachments exceed remaining context window
- [Bug] Compaction fails with "Conversation too long" error instead of auto-compacting
- [Bug] Compact issue persists after reboot on fresh session
- [Bug] Context compaction fails in infinite loop, forcing restart on backtrack
- CLI -p mode rejects valid prompts with 'Prompt is too long' below model context limit
- [Bug] Anthropic API Error: Missing Tool Result Block