[Bug] Compact command fails with "Conversation too long" error

Resolved 💬 5 comments Opened Oct 17, 2025 by macOS26 Closed Nov 3, 2025

Bug Description

/compact

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

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 2.0.21
  • Feedback ID: 7831898e-c076-49fc-b910-803864c2e9ab

Errors

[{"error":"SyntaxError: Unexpected token '`', \"```json\n{\n\"... is not valid JSON\n    at JSON.parse (<anonymous>)\n    at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:62:719\n    at Q (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:15093)\n    at Zn2 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1056:20444)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-10-17T20:52:50.132Z"},{"error":"Error: Request was aborted.\n    at Yy.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:356:3850)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-10-17T20:53:32.968Z"},{"error":"Error: Request was aborted.\n    at Yy.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:356:3850)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-10-17T20:54:56.554Z"},{"error":"SyntaxError: Unexpected token '`', \"```json\n{\n\"... is not valid JSON\n    at JSON.parse (<anonymous>)\n    at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:62:719\n    at Q (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:15093)\n    at Zn2 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1056:20444)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-10-17T20:55:21.536Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"prompt is too long: 201705 tokens > 200000 maximum\"},\"request_id\":\"req_011CUDSLDhB3LuZvNaFyTL3h\"}\n    at E4.generate (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:202:83047)\n    at Yy.makeStatusError (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:356:2117)\n    at Yy.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:356:5330)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async Tz1.model (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3311:19535)\n    at async Tz1 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2649:39781)\n    at async fRQ (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3311:19689)\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3311:13874\n    at async Ma0 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3311:4494)\n    at async aQ1 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3311:13844)","timestamp":"2025-10-17T20:55:40.878Z"},{"error":"SyntaxError: Unexpected token '`', \"```json\n{\n\"... is not valid JSON\n    at JSON.parse (<anonymous>)\n    at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:62:719\n    at Q (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:15093)\n    at Zn2 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1056:20444)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-10-17T20:56:36.469Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"prompt is too long: 201722 tokens > 200000 maximum\"},\"request_id\":\"req_011CUDSQKTZD3Xzrz96AocBT\"}\n    at E4.generate (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:202:83047)\n    at Yy.makeStatusError (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:356:2117)\n    at Yy.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:356:5330)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async Tz1.model (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3311:19535)\n    at async Tz1 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2649:39781)\n    at async fRQ (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3311:19689)\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3311:13874\n    at async Ma0 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3311:4494)\n    at async aQ1 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3311:13844)","tim

Note: Error logs were truncated.

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗