Skip to content

Claude Code says the prompt is too long or the context is full

By the Toolbay team · Checked against the sources below on

The conversation has filled the model's context window. Run /compact to summarise it and keep going, or /clear to start fresh. If it keeps happening, something is pouring large output into the session; find it with /context and keep it out.

What the messages mean

  • "Prompt is too long": the request no longer fits in the window.
  • "Prompt is too long · automatic compaction failed": Claude Code tried to summarise and could not make enough room.
  • "Context limit reached · /compact or /clear to continue": the session is full; it tells you the two ways out.

Fixes, quickest first

  1. Run /compact with a focus, for example /compact focus on the API changes, so the summary keeps what you still need.
  2. Run /clear when the next task is different. A fresh session with a good CLAUDE.md beats a summary of an old one.
  3. Run /context to see what is using the window as a coloured grid, including the skills row.
  4. Stop reading huge files and logs in full. The docs warn that if one file or output is so large that the context refills at once, Claude Code stops auto-compacting after a few attempts and shows an error instead of looping. Ask for a search or the last 100 lines instead.
  5. Hand big searches to a subagent. Subagents run in their own context window and send back a summary.
  6. Add a "Compact Instructions" section to CLAUDE.md that says what every summary must keep.

Rules in the project-root CLAUDE.md survive compaction: after /compact, Claude Code re-reads that file from disk. Instructions you only typed in chat early on may be lost, so put lasting rules in CLAUDE.md.

When a skill or vault helps, and when it does not

Helps

  • A skill loads its full instructions only when it is used, so it costs less context than pasting the same steps into CLAUDE.md.
  • A vault the agent reads on demand keeps reference material out of the window until a task needs it.

Does not help

  • No skill raises the context limit. A full window needs /compact or /clear.
  • Many installed skills still cost some context for their names and descriptions; remove the ones you never use.