claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[Bug] Manual Compaction Fails with "Conversation Too Long" Error

Open eltigros opened this issue 1 year ago • 8 comments

Bug Description my attempts to run /compact in advance of running out of space give an error message ( Error: Error during compaction: Error: Conversation too long. Press esc twice to go up a few messages and try again.) However if I just keep going down to 0% then auto-compact kicks in and works fine.

NOTE: I also got "Error submitting feedback / bug report" so used to feature to create an issue in GH instead which did work.

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 1.0.128
  • Feedback ID:

Errors

[{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n    at AK (file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1774:1183)\n    at file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1774:911\n    at Array.map (<anonymous>)\n    at WJ (file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1774:902)\n    at bJB (file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:2912:9380)\n    at KC (file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:34:19415)\n    at Mp (file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:36:42814)\n    at V9 (file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:36:38355)\n    at jh (file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:36:38283)\n    at LC (file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:36:38137)","timestamp":"2025-09-27T20:04:07.201Z"},{"error":"Error: EISDIR: illegal operation on a directory, read\n    at Module.readFileSync (node:fs:442:20)\n    at Object.readFileSync (file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:719:16544)\n    at lBB (file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:3607:659)\n    at Object.call (file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1712:952)\n    at call.next (<anonymous>)\n    at Th6 (file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:3227:21990)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async HFB (file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:3227:18132)\n    at async U2B (file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1163:31089)\n    at async Y8B (file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1937:1846)","timestamp":"2025-09-27T20:35:53.146Z"},{"error":"Error: EISDIR: illegal operation on a directory, read\n    at Module.readFileSync (node:fs:442:20)\n    at Object.readFileSync (file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:719:16544)\n    at lBB (file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:3607:659)\n    at Object.call (file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1712:952)\n    at call.next (<anonymous>)\n    at BO (file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1163:30556)\n    at file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1790:1328\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-09-27T20:43:57.495Z"},{"error":"Error: Shell b7988f is not running, so cannot be killed (status: killed)\n    at Object.call (file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:3306:1757)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async Th6 (file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:3227:21990)\n    at async HFB (file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:3227:18132)\n    at async U2B (file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1163:31089)\n    at async Y8B (file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1937:1846)\n    at async Rh6 (file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:3227:17325)\n    at async Lh6 (file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:3227:16266)\n    at async vO (file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:3227:13530)\n    at async vO (file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:3227:14460)","timestamp":"2025-09-27T21:07:32.723Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: rules\n    at file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1149:367\n    at Object.useMemo (file:///Users/pauledge/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:34:25928)\n

Note: Error logs were truncated.

eltigros avatar Sep 29 '25 05:09 eltigros

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/8226
  2. https://github.com/anthropics/claude-code/issues/8050
  3. https://github.com/anthropics/claude-code/issues/7594

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

github-actions[bot] avatar Sep 29 '25 05:09 github-actions[bot]

Note that after restarting claude code, the problem is no longer occurring. Same terminal, same feature branch etc.

eltigros avatar Sep 29 '25 06:09 eltigros

i'm also getting this error

auto compact is the only thing working

rahulkarajgikar avatar Oct 04 '25 17:10 rahulkarajgikar

Same here! After i had just 1% context left, i tried /compact command and it failed. I exited cloude code (ctrl + c -> twice) and then claude --continue and then /compact worked.

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

This should be fixed! ;)

archneon avatar Oct 06 '25 22:10 archneon

it's now occuring again after 2.0.21 / 22

Image

usorama avatar Oct 18 '25 16:10 usorama

I just closed #9856 as a duplicate, exact same issue 2025-10-18

jmaddington avatar Oct 19 '25 13:10 jmaddington

This should be fixed in 2.0.31.

amorriscode avatar Nov 03 '25 03:11 amorriscode

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.

github-actions[bot] avatar Nov 10 '25 14:11 github-actions[bot]