Claude Code \"Prompt is too long\"? Find what fills it
On this page
  1. Step 1: read the second half of the message
  2. Step 2: run /context
  3. Step 3: compact or clear
  4. Step 4: cut what every request carries
  5. If it happens near 200K on a bigger model
  6. Where Joxo fits
  7. Frequently asked questions
  8. How do I fix "Prompt is too long" in Claude Code?
  9. What does /context show in Claude Code?
  10. Does /clear delete my conversation?
  11. Try it with your team

Blog / claude code

Claude Code \"Prompt is too long\"? Find what fills it

Read the error's second half, run /context to see what fills the window, then compact, clear, or cut the tools and memory files every request carries.

"Prompt is too long" (shown in a session as Context limit reached · /compact or /clear to continue) means the request Claude Code is about to send no longer fits in the model's context window. The request is more than your conversation: it also carries the system prompt, every tool definition, your CLAUDE.md files and any attachments. So the fix depends on which part is big. Run /context to see, then compact, clear, or cut what every request carries.

Claude Code compacts on its own before the window fills, so seeing this error means compacting either couldn't run or wasn't enough. Running /compact again won't always help. The rest of the message usually says why.

Step 1: read the second half of the message#

The text after the · tells you which case you are in. The common forms, from the Claude Code error reference:

The message ends withWhat it meansDo this
/compact or /clear to continueThe conversation grew too longRun /compact (step 3)
auto-compact is off · /config to turn it onYou turned automatic compaction offTurn it back on in /config, or compact by hand
automatic compaction failed: <error>Compaction itself hit another error, such as a sign-in or model problemFix the named error first; /compact fails the same way until you do
this conversation is a single exchange…One prompt is too big on its own, or the tools and memory files take most of the roomNothing to compact: go to step 4

If /compact answers Not enough messages to compact., you are in the last row: a single message plus what Claude Code sends with it fills the window.

Step 2: run /context#

/context shows what is using the window, by category. Here is part of its output from a fresh session in a small test repo:

**Tokens:** 34.5k / 1m (3%)

| Category                  | Tokens |
|---------------------------|--------|
| System prompt             | 3.1k   |
| System tools              | 1.2k   |
| Memory files              | 15.6k  |
| Skills                    | 9.9k   |
| Messages                  | 1.1k   |

Two lines matter most:

  • Messages is your conversation. If it is most of the total, compact or clear.
  • System tools, Memory files, Skills and the rows for any tool servers you have connected are sent with every request, before you type a word. If they are large, every session starts half full, and compacting can't shrink them.

Below the table, /context lists each connected tool and memory file with its size, so you can see exactly which tool server or file is the heavy one. Notice that even in this nearly empty session, memory files were the biggest single item.

Step 3: compact or clear#

Compact keeps the thread. /compact replaces earlier turns with a summary and keeps the newest ones. You can tell it what must survive:

/compact keep the failing test names, the error text and the plan for the next step

Clear starts over. /clear begins a new conversation in the same folder. The old one is kept, and /resume brings it back. Clear when the session has drifted, or when its history is mostly failed attempts.

Before you clear, ask Claude to write what matters into a file (the plan, decisions, what's done and what's next), then start the new session with "read NOTES.md and continue". That takes ten seconds and carries the important part across.

Rules you only ever said in chat are lost by both. Anything the agent must always follow belongs in CLAUDE.md; see keep Claude Code's rules after compaction.

Step 4: cut what every request carries#

When step 2 shows that tools and memory take most of the room, compacting is the wrong tool. Make the fixed part smaller:

  • Switch off tool servers you aren't using in this project. Each connected server sends its whole tool list with every request, and Claude Code lets you disable one per project without removing it.
  • Trim CLAUDE.md. Keep the rules every task needs. Move instructions for one area of the code into path-scoped rules under .claude/rules/, which load only when Claude works on matching files.
  • Don't paste huge logs or whole files. Paste the failing part, or save it to a file and ask Claude to read the lines it needs.
  • Send big jobs to a subagent. "Use a subagent to search the codebase for every caller of parsePrice and report the list" keeps the search results out of your main conversation; only the answer comes back.

If it happens near 200K on a bigger model#

If you use a gateway or a custom model ID and the error appears around 200,000 tokens on a model that takes more, Claude Code may not recognise the model and assume a 200K window. The docs explain how to set the model's real context window. Updating Claude Code also fixes several older causes of this error, so check claude --version against the latest release.

Where Joxo fits#

Long sessions often exist because one agent is carrying a whole project in its head. With Joxo, work is split into tasks on a shared board, and each agent leaves a short note when it hands off, so a fresh session (yours or a teammate's) picks up from the note instead of from a giant transcript. Setup is one line pasted into your agent. If the session is also going round in circles, see Claude Code stuck in a loop.

Frequently asked questions#

How do I fix "Prompt is too long" in Claude Code?#

Run /compact if the conversation is long, or /clear to start fresh. If /compact says there is nothing to compact, run /context: the tools, skills and memory files sent with every request are filling the window, so switch off unused tool servers and trim CLAUDE.md.

What does /context show in Claude Code?#

How full the context window is, split into the system prompt, tools, connected tool servers, memory files, skills and messages, with a list of each connected tool and memory file by size.

Does /clear delete my conversation?#

No. It starts a new conversation in the same folder, and /resume lists the earlier one so you can go back to it.