Compaction Failure: Conversation Length Exceeds Processing Limit

Status Closed — not planned
Maintainer reply None cached
Activity 12 comments · opened Jun 15, 2025 · closed Jan 10, 2026

Bug Description
/compact
⎿ Error: Error during compaction: Error: Conversation too long.
Press esc to go up a few messages and try again.

Environment Info

  • Platform: darwin
  • Terminal: vscode
  • Version: 1.0.24
  • Feedback ID: 546b7692-9e82-472a-9528-e25979964a6f

Errors

[{"error":"Error: Command failed: security find-generic-password -a $USER -w -s \"Claude Code\"\nsecurity: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n\n    at genericNodeError (node:internal/errors:983:15)\n    at wrappedFn (node:internal/errors:537:14)\n    at checkExecSyncError (node:child_process:882:11)\n    at execSync (node:child_process:954:15)\n    at HZ (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:659:3921)\n    at file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:582:8863\n    at Q (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:526:17199)\n    at tJ (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:582:8009)\n    at HS (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:582:7090)\n    at T6 (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:582:11202)","timestamp":"2025-06-15T18:42:19.974Z"},{"error":"Error: Request was aborted.\n    at Lw.makeRequest (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1344:3784)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-06-15T18:49:08.574Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"prompt is too long: 202576 tokens > 200000 maximum\"}}\n    at h6.generate (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1329:12578)\n    at Lw.makeStatusError (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1344:2082)\n    at Lw.makeRequest (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1344:5257)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async ME2.K11.showErrors (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:22008)\n    at async K11 (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:12203)\n    at async ME2 (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:21854)\n    at async file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:17103\n    at async yt1 (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:5151)\n    at async Fu (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:17073)","timestamp":"2025-06-15T18:55:16.093Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"prompt is too long: 204960 tokens > 200000 maximum\"}}\n    at h6.generate (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1329:12578)\n    at Lw.makeStatusError (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1344:2082)\n    at Lw.makeRequest (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1344:5257)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async ME2.K11.showErrors (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:22008)\n    at async K11 (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:12203)\n    at async ME2 (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:21854)\n    at async file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:17103\n    at async yt1 (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:5151)\n    at async Fu (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1698:17073)","timestamp":"2025-06-15T19:18:36.915Z"},{"error":"Error: Conversation too long. Press esc to go up a few messages and try again.\n    at BH1 (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1914:7444)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async Object.call (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1977:1674)\n    at async FU5 (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:2431:58)\n    at async Wp (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:2427:19304)\n    at async file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:2434:3648","timestamp":"2025-06-15T19:18:36.932Z"},{"error":"Error: Error during compaction: Error: Conversation too long. Press esc to go up a few messages and try again.\n    at Object.call (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1977:1963)\n    at process.processTicksAndRejections (node:internal/proc

Note: Error logs were truncated.

View original on GitHub ↗

12 Comments

jmarbutt · 1 year ago

I am having this also, did you find a solution?

benthecoder · 1 year ago

same problem

pattihis · 1 year ago

The error message is missing the twice.

You can hit esc twice, it will bring up a list of your past prompts, you can go up to previous messages and run the /compact earlier.

t0mtaylor · 1 year ago

Thats cool, although its rather slow when switching between messages if you have a really long message

edgariscoding · 1 year ago

Can't believe the error message is missing such a crucial part of the message. I hit esc twice and was able to go back to a previous prompt and compact from there.

ZGK1450 · 11 months ago

I'm also having the same problem. This is a newly introduced bug as evidenced by the multiple threads reporting the same thing. It's very annoying and I have to babysit runs a lot more now.

ZGK1450 · 11 months ago
Can't believe the error message is missing such a crucial part of the message. I hit esc twice and was able to go back to a previous prompt and compact from there.

This has not always worked for me, and even if it did, I hate that I lose the most relevant context.

stanislavromanov · 11 months ago

I do not understand the reason for this "feature". Just force auto-compact if you cannot do a regular /compact.

Indeed, what if the very last exchange is where it fixed a critical bug and if you jump before that it would lose the information/context about it.

> > /compact
    ⎿  Error: Error during compaction: Error: Conversation too long. Press esc twice to go up a few messages and try again.


  Why can't you compact?

⏺ The conversation is too long to compact. You'll need to:

  1. Press Esc twice to go back in the conversation
  2. Select an earlier point to compact from
  3. Try /compact again from there

  This typically happens when there's too much code/content to summarize effectively.

> Why? What would happen on auto-compact?

⏺ Auto-compact would kick in automatically when context gets very low (usually around 5-10%). It would:

  1. Automatically summarize the entire conversation up to the current point
  2. Preserve key information like:
    - Current file states
    - Recent changes made
    - Active work/issues
  3. Continue working without interruption

  The difference is that auto-compact handles the entire conversation length automatically, while manual /compact seems to have a limit on how much it can process at once.

  Since we're at 7% context, auto-compact is likely to trigger soon anyway. You could either:
  - Wait for auto-compact to handle it automatically
  - Start a new conversation with the current code state
  - Go back further in the conversation to manually compact a smaller chunk

  The work we've done is already saved in the files, so nothing would be lost either way.

> Ok so can you just force auto-compact?

⏺ No, I can't force auto-compact - it's triggered automatically by the system when context gets critically low (usually around 5-10%).

  Since we're at 7% now, it should trigger very soon on its own - probably within the next few messages.

  If you want to continue working right now, you could:
  1. Just keep going and let auto-compact trigger naturally (very soon)
  2. Start a fresh conversation
  3. Try going back further to manually compact a smaller section

  The auto-compact will happen automatically when the system determines it's necessary, which should be any moment now given we're at 7%.

> So I just add some jibberish until you auto compact?

⏺ Ha! Yes, that would work! Auto-compact should trigger any moment now since we're at 7% context.

  Though honestly, even just continuing our normal conversation about the code would probably trigger it within 1-2 more exchanges.

  The system is watching the context usage and will jump in automatically when it hits the threshold.

  So... shall we talk about the weather while we wait? 😄
johnbindel · 10 months ago

It seems crazy to me that the /compact command should ever fail because of not having enough space. The purpose of calling it is to free up more space. So it needs to resolve its own issues related to space management in order to achieve that goal. If there is not enough space, can it use the same logic as auto compact? Or can it write the context out to a temp file and then summarize that file in a separate ephemeral session? Or can we split the context into two parts, summarize each, and then combine? It is just unreasonable to have this command fail because of not having enough space.

github-actions[bot] · 8 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] · 7 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

github-actions[bot] · 7 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.