Claude Code error
Claude Code: Prompt is too long
Prompt is too longStatus: WorkaroundLast verified 5 documented fixes2 sources
What it means
The conversation plus attached files exceeds the model's context window. In an interactive session it is shown as Context limit reached · /compact or /clear to continue. Amazon Bedrock reports the same condition as Input is too long for requested model.
Causes
- A long conversation that auto-compact did not reduce in time
- Large pasted text or attachments in a single exchange
- Large system prompt, MCP tool definitions, or CLAUDE.md memory files
- Auto-compact turned off in /config or with DISABLE_AUTO_COMPACT
- A model ID Claude Code does not recognize, for which it assumes a 200K window
How to fix it
- Fix 1.
Run /compact to summarize earlier turns, or /clear to start fresh. If /compact answers Not enough messages to compact., run /clear and resend with less content.
Slash command/compact - Fix 2.
Run /context to see what is consuming the window.
Slash command/context - Fix 3.
Disable MCP servers you are not using to remove their tool definitions from context, and trim large CLAUDE.md files or move instructions into path-scoped rules.
Slash command/mcp disable <name> - Fix 4.
Turn auto-compact back on if you disabled it in /config or with DISABLE_AUTO_COMPACT.
- Fix 5.
Update Claude Code: v2.1.284 fixed errors that persisted after compacting, v2.1.288 fixed failures when the last reply reported zero token usage, and v2.1.302 fixed the error when stopping a turn during compaction.
Terminalclaude update
More Claude Code errors
All 18 Claude Code errorsAPI Error: 500 Internal server error. This is a server-side issue, usually temporaryStatus: WorkaroundAPI Error: Repeated 529 Overloaded errors. The API is at capacityStatus: WorkaroundAPI Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.5: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_01FRvEykWmCgrgJ22mvBbKhV. Each `tool_use` block must have a corresponding `tool_result` block in the next message."}}Status: OpenUnable to connect to API. Check your internet connectionStatus: WorkaroundUnable to connect to API: SSL certificate verification failed (UNABLE_TO_GET_ISSUER_CERT_LOCALLY).Status: WorkaroundPlease run /login · API Error: 401 OAuth token has expiredStatus: WorkaroundOAuth error: timeout of 15000ms exceededStatus: OpenYou've hit your session limit · resets 3:45pmStatus: By design
Related reading
- Claude Code Idle Compaction: What It Does and How to Turn It OffClaude Code 2.1.299 compacts sessions over 200K tokens after about 54 idle minutes. How the cache math works, the setting to turn it off, and when to keep it.
- Anthropic Removed 80% of Claude Code's System Prompt. Here Is What They Learned.Anthropic cut over 80% of Claude Code's system prompt for Claude 5 models with no coding eval loss. The new context engineering rules and what HN thinks.
- Claude Code Sends 33k Tokens Before Your Prompt - OpenCode Sends 7kClaude Code sends about 33k tokens before your prompt, OpenCode about 7k. The methodology, cache economics and the HN debate over whether the overhead pays off.
- Agent Skills Need Exit Criteria, Not More Prompt LoreAgent skills work when they carry exit criteria. What Addy Osmani's agent-skills repo gets right about turning AI coding advice into engineering checklists.
- Long-Running Agents Need Harnesses, Not HopeLong-running coding agents need a harness: task contracts, scoped workspaces, logs, checkpoints, verification gates, and cost limits to recover from failure.
- Prompt Engineering for AI Coding ToolsPrompt engineering for AI coding tools is task design: specs, repo context, constraints, examples, verification and reviewable receipts, not clever wording.
FAQ
What does "Prompt is too long" mean in Claude Code?
The conversation plus attached files exceeds the model's context window. In an interactive session it is shown as Context limit reached · /compact or /clear to continue. Amazon Bedrock reports the same condition as Input is too long for requested model.
How do I fix "Prompt is too long"?
There are 5 documented fixes. Start with the first: Run /compact to summarize earlier turns, or /clear to start fresh. If /compact answers Not enough messages to compact., run /clear and resend with less content.
Is this Claude Code error fixed?
Status: Workaround. No release removes the cause. The documented fixes work around it. Affected versions: All versions; multiple recovery fixes through v2.1.302.
Sources
Last verified against 2 sources: official docs, maintainer replies and release notes.
Newsletter
Fixes for the tools you use, weekly
One email per week. New coding agent releases, what broke, and how developers are working around it.