Skip to content
AI Dev Toolkit.
Esc
  • AI Token CounterCount tokens for GPT, Claude, Gemini, DeepSeek, Qwen and more.Tool
  • LLM API Cost CalculatorEstimate per-request, daily and monthly API costs.Tool
  • AI Model ComparisonCompare prices, context windows and features across models.Tool
  • AI Model Pricing PagesSpecs, real costs and cheaper alternatives for popular models.Tool
  • Context Window CheckerSee whether your text fits each model's context window.Tool
  • Subscription vs API CalculatorFind out whether a chat plan or the API is cheaper for you.Tool
  • GPU / VRAM CalculatorCheck how much VRAM a local model needs and which GPUs fit.Tool
  • Claude Code Error DatabaseExact Claude Code error messages with tested fixes.Tool

Claude Code · Requests and models

Prompt is too long / Context limit reached

The conversation plus everything Claude Code sends with it no longer fits in the model’s context window.

Message

The exact error

Claude Code
Context limit reached · /compact or /clear to continue

Also appears as:

In -p output and transcripts
Prompt is too long
When automatic compaction failed
Prompt is too long · automatic compaction failed: <the underlying error>
Amazon Bedrock
Input is too long for requested model.

Meaning

What it means

Every request carries the whole conversation plus the system prompt, tool definitions (including MCP servers), memory files like CLAUDE.md, and any attachments. When the total passes the model’s context window, the API refuses it. Auto-compact normally summarises older turns before this happens; seeing the error means it was turned off, failed, or a single huge message filled the window by itself.

Causes

Common causes

  • A long session with auto-compact turned off
  • Large pasted text, files or images in one message
  • Many MCP servers whose tool definitions are sent with every request
  • A very large CLAUDE.md or other memory file

Fix

How to fix it

  1. Compact or start fresh

    Run /compact to summarise earlier turns, or /clear to start a new conversation. If /compact says Not enough messages to compact., the one message is too big: run /clear and resend with less pasted text.

  2. See what’s using the space

    Run /context for a breakdown of system prompt, tools, memory files and messages.

  3. Cut what’s sent every time

    Disable unused MCP servers with /mcp disable <name>, and trim large CLAUDE.md files. The context window checker shows how much a document takes before you paste it.

  4. Turn auto-compact back on

    If you switched it off in /config or with DISABLE_AUTO_COMPACT, turn it on again, or run /compact yourself before the window fills.

Related

Search all Claude Code errors