Prompt is too long (context window exceeded) — page 2
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 101–200
Ranked by community engagement (reactions weighted over comments). Listing the top 300 of 322 matches; the statistics above cover all 322.
- [Bug] Context Loss: Agent Unable to Maintain Conversation State
- Request Entity Too Large: Anthropic API Context Window Overflow During File Exploration
- Context Limit Exceeded: Compaction Failure Causing Data Loss
- Compact Command Execution Failure After Plan Cancellation
- Infinite Read Operation Hang in Claude Code CLI During File Processing
- Issue Title: Git Push Failure: Request URL Exceeds Length Limit This title: - Identifies the specific problem (Git push failure) - Highlights the technical root cause (URL length limit) - Uses clear, technical language - Provides immediate context for dev
- Compaction Failure: Context Limit Exceeded During Retry
- Context Truncation Warning During Input Processing
- [Bug] Repeated tool hallucinations causing workflow disruptions and token waste
- [BUG] "Prompt too long" with respect to ridiculous session token usage.
- [BUG] Agent SDK: auto-compact completely broken on resumed sessions — reactive compaction handler is null
- [BUG] Messages category exceeds total context and context window size. Maybe calculation bug in read tool token counting.
- Compaction death spiral in Cowork: 6 compactions in 3.5min due to system context consuming 86.5% of window
- [FEATURE] Size-aware file reading — pre-flight checks for Read tool and smart @ attachment handling
- [Bug] Plugin marketplace installation fails silently across projects
- [Bug] Compact operation hangs with 9% remaining progress
- [BUG] /compact fails when context ~90% full due to max_tokens not being accounted for
- [Bug] Compact Command Fails with 413 Request Too Large Error
- Request Size Exceeds Anthropic API Context Window for Claude Opus
- [BUG] Request size exceeds model context window
- [BUG] Gateway provider discards the refresh token and has no refresh-token grant, so every renewal is a full device-code re-grant
- Three diagnosability issues around context limits and custom base URLs
- Context limit UX failure: No progressive warnings, misleading error messages, cascade failure in compaction
- [Feature Request] Add full-text search with highlighting across chat history
- 400 role 'system' is not supported — client builds malformed request after large, twice-compacted session (unrecoverable in-place)
- [BUG] "Prompt is too long" error mid-response, session stuck with --resume for 8+ hours
- [BUG] HTTP 400 'prompt is too long' is misreported to the user as 'usage limit reached'
- [BUG] Per-prompt cap on claude-opus-4-7 silently dropped ~2x around Apr 27, 2026
- [BUG] [BUG] Switching from Opus 4.7 1M to Sonnet mid-session (~700k tokens) breaks session completely — no recovery possible
- Prompt is too long error blocks work without graceful recovery
- --continue loads oldest messages instead of most recent in large sessions
- [BUG] Claude Code fails with 'Prompt is too long' instead of auto-compacting
- [Bug] Anthropic API Error: Could not process image from Recraft.ai vector
- [BUG] Autocompact buffer (232.9k) exceeds 200k context window (116.5%) on Max plan — instant compaction loop after upgrading from 2.1.74
- [BUG] Cowork session resume loop burns context in minutes, locks session with "Prompt is too long" — Windows 11 Home, Max plan
- [Bug] Context limit error shown despite available context remaining
- [Bug] Message history token calculation exceeds context window limit
- [Bug] Context window exhausted in new session
- [Bug] Infinite loop attempting to read PNG as JPEG despite correct file type specification
- [Bug] Auto-compact context summarization loses critical instructions and workarounds
- Transcript Extraction Failure: Incorrect Data Field Used : 4 hrs of wasted TIME AND TOKENS!!! Thank you CLAUDE CODE!
- [BUG] I cannot /compact and cannot continue current chat, how to keep context and start a new caht?
- [BUG] Automatic compression does not work, and context limit error is displayed
- Terminal Image Display / Large Output Breaks Context Compaction
- [Bug] Anthropic API Error: Server Rate Limiting Response
- [Bug] Agent enters infinite loops causing cascading feature failures
- [DOCS] Fix Temporary
- [BUG] Extension shows "usage limit reached" while /usage reports 17% session / 1% weekly
- Claude Code VS Code : ~181k token system prompt on new chats causes immediate "Prompt is too long"
- [BUG] "Usage limit reached" hard-stop fires below the displayed 5-hour ceiling (~95%, not 100%)
- [Bug] Anthropic API Error: Multiple server errors (400, 529, 500) blocking execution
- Compaction reports inflated cumulative token count and produces degenerate summary for tool-heavy sessions
- [Bug] Anthropic API Error: Prompt is too long in /goal command
- [Bug] Anthropic API Error: Prompt too long in /goal stop hook
- [BUG] macOS Desktop 1.6608.2 - "Prompt is too long" error triggers persistent "Usage limit reached" state with full quota remaining
- [Bug] Explore subagent rejects with "prompt too long" error
- [Bug Report: Model performance degradation or unexpected behavior changes]
- [Bug] Sub-agents deploy successfully but fail to accept prompts at runtime
- Explore subagent rejects short prompts with "Prompt is too long"; general-purpose accepts same prompt
- [BUG] Desktop app shows "Out of extra usage" and disables input despite 91% weekly / 61% extra usage remaining
- [BUG] VSCode: Switching to a lighter model mid-session leaves session stuck — misleading error makes recovery non-obvious.
- [BUG] Switching from Sonnet back to Opus after "prompt too long" error leaves session in broken state
- [Feature Request] Hook output for dynamic tab title prefix/session label overlay
- [Bug Report] Unable to process empty bug report
- Issues recently with claude code for enterprise data analytics and knowledgebase application
- [Bug] Claude Code repeatedly fails to execute specified tasks and wastes API tokens
- [Bug] Remote control active causes companion tasks to hang permanently
- [Bug] Agent not executing skills and not proposing solutions as expected
- [Bug] Increased task avoidance and rule non-compliance at medium effort level
- Explore agent defaults to Haiku, overflows with real-world MCP setups
- [Bug] Ctrl+O and Ctrl+E message history toggle not functioning
- [Bug] Agents fail with "prompt too long" error despite small prompts, causing zero token usage
- [BUG] Explore subagents fail with 'Prompt is too long' when MCP servers are configured
- Context window limit warning: warn users before "Prompt is too long" error mid-task
- Sub-agents inherit all MCP tools causing 'Prompt is too long' errors
- [Bug] Explore Agents Non-Functional
- [Bug] Anthropic API Error: Context limit reached with background Agent sub-skill invocation
- [Bug] Auto-compact buffer exceeds context window, causing infinite compaction loop on macOS
- [Bug] Auto-compact not triggering despite being enabled, causing context limit errors
- MCP tool schemas consume context unconditionally, creating an unmanageable ceiling on project complexity
- [BUG] Double SessionStart:compact + "Prompt is too long" on session initialization race
- [BUG] Cowork: saved session fails to reload with "Prompt is too long" error
- [Bug] Context limit reached error triggers prematurely before auto-compact activates
- [Bug] High CPU usage (~200%) on macOS after latest Homebrew upgrade
- [Bug] Conversation Too Long Error: Up Arrow Navigation Does Not Resolve Issue
- [BUG] VS Code extension — context limit error (400) when auto-compaction fails to trigger
- Split panel button silently duplicates sessions causing crashes and data corruption
- VS Code sessions spontaneously split, swap, and duplicate between panels
- [Bug Report] Unable to generate issue title - no bug report content provided
- [Bug] Bash command context overflow: `! ls -la` in large directory exceeds token limit
- [Bug] Plan mode doesn't auto-update status after task completion
- [Bug] Unable to compact or clear context
- [Bug] Auto-Compact not triggering despite low context with 24% usage
- [Bug] Windows Auto-Compact triggers prematurely with "Conversation too long" error
- [Bug] Repeated task execution failures and incorrect behavior validation
- [Bug] Long-running output tasks trigger premature context limit with failed compaction
- [Bug] Plugin hook stdout not surfaced to Claude in system messages
- [Bug] Framebuffer output causes accessibility issues without respecting screen dimensions
- [BUG] "Prompt is too long" error when SessionStart hooks inject large context
- Regression: 'Prompt is too long' error interrupts test suite execution