Claude Code "prompt is too long": causes and fixes (context limit exceeded)

Is there an outage right now?

Claude Code official status is operational. If this error persists, it is likely an implementation or environment issue on your side.

View Claude Code status

What this error means

Your input exceeded the model's context limit (e.g. "API Error: 400 … prompt is too long"). It happens when the conversation grows too long, or large files / big pastes push tokens over the limit.

Common causes

  • Conversation history grew too large
  • Large files, logs, or output added to context
  • Pasted a large amount of text
  • Input plus output (max tokens) exceeded the limit

How to fix

  1. 1.Compress with `/compact` or reset with `/clear`
  2. 2.Pass only the relevant parts of large files, not the whole thing
  3. 3.Reduce unnecessary pastes and logs
  4. 4.Split the task into smaller steps
  5. 5.Use a model with a larger context window

When waiting helps (and when it won't)

This is an input-size issue—waiting will not help. Use /compact, /clear, or reduce input size.

Alternatives when Claude Code is down

CodexCursorGitHub CopilotClineWindsurfContinue

Related errors

FAQ

What is Prompt is too long?

Your input exceeded the model's context limit (e.g. "API Error: 400 … prompt is too long"). It happens when the conversation grows too long, or large files / big pastes push tokens over the limit.

How do I fix Prompt is too long?

Compress with `/compact` or reset with `/clear` / Pass only the relevant parts of large files, not the whole thing / Reduce unnecessary pastes and logs / Split the task into smaller steps / Use a model with a larger context window

Compare Claude Code with others