Skip to content
Checked against Claude Code 2.1.286 · October 9, 2026

How to fix “Prompt is too long” in Claude Code

Fix Claude Code's “Prompt is too long” error by separating the current request from saved conversation context, then compacting or starting a clean session safely.

Short answer

“Prompt is too long” means Claude Code could not send the request within the model's input limit. Shorten the new prompt or remove oversized pasted text first. If an old conversation is carrying too much history, run /compact; if compaction cannot recover enough space, start a new session with a written handoff.

What the message means

This is an input-size failure, not an account quota reset. The request Claude Code assembles can include the conversation, tool results, attachments, project instructions, and the message you just entered. A huge paste can break a short session; a small message can break a session whose saved context is already full.

Fix it in this order

1. Check the message you just added

Cancel the turn and remove generated logs, lockfiles, minified bundles, or repeated stack traces. Point Claude at a file and ask for the relevant section when the tool can read it locally, instead of pasting the whole file into the prompt.

# Edit the prompt before sending it again

2. Compact a long-running conversation

Inside the affected interactive session, use /compact. Give the compacted session one concrete next step afterward. Compaction helps when accumulated history is the problem; it cannot make one enormous attachment fit.

/compact

3. Carry only durable state into a fresh session

If the session still fails, write down the goal, changed files, commands already run, current failure, and next step. Start Claude Code again in the same repository and supply that bounded handoff instead of replaying the transcript.

claude "Read the handoff in progress.md, verify the current diff, and continue."

Important distinctions

  • Deleting files from the repository does not shrink text that is already recorded in the conversation.
  • Changing plans or waiting for a usage reset does not solve an oversized request.
  • Keep the old session until the new one is oriented; it remains useful as an audit trail even if you stop adding turns to it.

Where Crowsnest fits

Crowsnest can search the local transcript and reopen the exact Claude Code session, which is useful when you need to recover decisions before writing a smaller handoff. It does not enlarge Claude's context window or bypass the input limit.

Source and version

The exact text and flags on this page were checked against the installed Claude Code 2.1.286 binary on October 9, 2026. Version-specific behavior can change, so compare your own --help output before scripting around it. Official status or documentation →

Reviewed from first-party CLI output and the released Crowsnest product source. No command on this page bypasses provider limits, billing, authentication, or native history rules.