[Bug] Auto-Compact Fails Due to Conversation Length Limit

Status Closed — not planned
Maintainer reply None cached
Activity 10 comments · opened Oct 3, 2025 · closed Jan 29, 2026

Bug Description
it fails to compact saying "Error: Error during compaction: Error: Conversation too long. Press esc twice to go up a few messages and try
again." often. its happened at single digit % and 0% and refuses to move foward. it doesn't even autocompact

Environment Info

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

Errors

[{"error":"Error: Request was aborted.\n    at ng._createMessage (file:///Users/aneesh/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:899:4711)\n    at processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at runNextTicks (node:internal/process/task_queues:69:3)\n    at process.processTimers (node:internal/timers:520:9)","timestamp":"2025-10-01T17:57:35.395Z"},{"error":"Error: Request was aborted.\n    at ng._createMessage (file:///Users/aneesh/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:899:4711)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-10-01T23:38:08.778Z"},{"error":"Error: Request was aborted.\n    at ng._createMessage (file:///Users/aneesh/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:899:4711)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-10-01T23:38:32.833Z"},{"error":"McpError: MCP error -32603: Attempted to use detached Frame 'A2500192933044A2A27AEB1843F546A7'.\n    at mM1._onresponse (file:///Users/aneesh/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1004:16569)\n    at _transport.onmessage (file:///Users/aneesh/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1004:13741)\n    at q30.processReadBuffer (file:///Users/aneesh/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1006:2306)\n    at Socket.<anonymous> (file:///Users/aneesh/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1006:1672)\n    at Socket.emit (node:events:518:28)\n    at Socket.emit (node:domain:489:12)\n    at addChunk (node:internal/streams/readable:561:12)\n    at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)\n    at Readable.push (node:internal/streams/readable:392:5)\n    at Pipe.onStreamRead (node:internal/stream_base_commons:189:23)","timestamp":"2025-10-02T00:14:21.927Z"},{"error":"McpError: MCP error -32603: Attempted to use detached Frame 'A2500192933044A2A27AEB1843F546A7'.\n    at mM1._onresponse (file:///Users/aneesh/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1004:16569)\n    at _transport.onmessage (file:///Users/aneesh/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1004:13741)\n    at q30.processReadBuffer (file:///Users/aneesh/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1006:2306)\n    at Socket.<anonymous> (file:///Users/aneesh/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1006:1672)\n    at Socket.emit (node:events:518:28)\n    at Socket.emit (node:domain:489:12)\n    at addChunk (node:internal/streams/readable:561:12)\n    at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)\n    at Readable.push (node:internal/streams/readable:392:5)\n    at Pipe.onStreamRead (node:internal/stream_base_commons:189:23)","timestamp":"2025-10-02T00:14:25.499Z"},{"error":"MaxFileReadTokenExceededError: File content (31529 tokens) exceeds maximum allowed tokens (25000). Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.\n    at Na2 (file:///Users/aneesh/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1834:404)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async Object.call (file:///Users/aneesh/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1829:1010)\n    at async ay6 (file:///Users/aneesh/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2652:27289)\n    at async YYB (file:///Users/aneesh/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2652:23431)","timestamp":"2025-10-02T00:14:37.741Z"},{"error":"Error: Request was aborted.\n    at ng._createMessage (file:///Users/aneesh/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:899:4711)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-10-02T00:14:51.085Z"},{"error":"McpError: MCP error -32603: Attempted to use detached Frame 'A2500192933044A2A27AEB1843F546A7'.\n    at mM1._onresponse (file:///Users/aneesh/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1004:16569)\n    at _transport.onmessage (file:///Users/aneesh/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1004:13741)\n    at q30.processReadBuffer (file:///Users/aneesh/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1006:2306)\n    at Socket.<anonymous> (file:///Users/aneesh/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1006:1672)\n    at Socket.emit (node:events:518:28)\n    at Socket.emit (node:domain:489:12)\n    at addChunk (node:internal/stre

Note: Error logs were truncated.

View original on GitHub ↗

10 Comments

github-actions[bot] · 11 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/8050
  2. https://github.com/anthropics/claude-code/issues/8791
  3. https://github.com/anthropics/claude-code/issues/8379

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

art-shen · 10 months ago

All the time for me!

gwpl · 9 months ago

Can't Claude Code just have some smart fallback strategy?

e.g.:

  • if Error(context_too_long); then combine( compact(first 90%) , compact(last 90%) )
  • if Still Error(context_too_long); then combine ( compact(first 80%), compact(last 80%))
  • (...)

sounds like trivial workaround, not perfect, but better then annoying error happening so often... and ofc if rootcause would be addressed still having this fallback , only makes system more resilient and self recoverable in case of regression in the future, so probably good to have such "fallback of last resort" anyway implemented.

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.

DataRMmason · 8 months ago

This seems to have re-surfaced in latest udpate for me. Auto-compacting reaches zero and locks up sessions (v2.0.64 regression)

MichaelHuang7119 · 8 months ago
This seems to have re-surfaced in latest udpate for me. Auto-compacting reaches zero and locks up sessions (v2.0.64 regression)这个问题在最新更新中又出现了。自动压缩达到零并锁定会话(v2.0.64 回归问题)

yes, i also get this.

tonydehnke · 8 months ago

Ran into the same issue today. Conversation id: b75bef82-13d1-43a4-ae0a-25e54879328f

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.

marcindulak · 7 months ago

This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.

github-actions[bot] · 6 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.