Skip to main content
Watch: I Built an AI App Without Leaving Databricks

Claude Code error

Claude Code: Prompt is too long

Error message
Prompt is too long

Status: 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

  1. 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
  2. Fix 2.

    Run /context to see what is consuming the window.

    Slash command
    /context
  3. 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>
  4. Fix 4.

    Turn auto-compact back on if you disabled it in /config or with DISABLE_AUTO_COMPACT.

  5. 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.

    Terminal
    claude update

More Claude Code errors

All 18 Claude Code errors

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.