[Bug] Premature compaction trigger when context below 10%

Resolved 💬 3 comments Opened Oct 22, 2025 by rhc Closed Oct 25, 2025

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

when the context is low below 10%

Environment Info

  • Platform: darwin
  • Terminal: kitty
  • Version: 2.0.19
  • Feedback ID: e5d6adf5-4b12-44a6-9b47-364a80816515

Errors

[{"error":"SyntaxError: Unexpected token '`', \"```json\n{\n\"... is not valid JSON\n    at JSON.parse (<anonymous>)\n    at file:///Users/ckyony/.asdf/installs/nodejs/22.12.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:62:719\n    at Q (file:///Users/ckyony/.asdf/installs/nodejs/22.12.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:15093)\n    at Pi2 (file:///Users/ckyony/.asdf/installs/nodejs/22.12.0/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-17T08:31:14.463Z"},{"error":"SyntaxError: Unexpected token '`', \"```json\n{\n\"... is not valid JSON\n    at JSON.parse (<anonymous>)\n    at file:///Users/ckyony/.asdf/installs/nodejs/22.12.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:62:719\n    at Q (file:///Users/ckyony/.asdf/installs/nodejs/22.12.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:15093)\n    at Pi2 (file:///Users/ckyony/.asdf/installs/nodejs/22.12.0/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-17T08:34:03.906Z"},{"error":"SyntaxError: Unexpected token '`', \"```json\n{\n\"... is not valid JSON\n    at JSON.parse (<anonymous>)\n    at file:///Users/ckyony/.asdf/installs/nodejs/22.12.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:62:719\n    at Q (file:///Users/ckyony/.asdf/installs/nodejs/22.12.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:15093)\n    at Pi2 (file:///Users/ckyony/.asdf/installs/nodejs/22.12.0/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-17T08:38:52.476Z"},{"error":"SyntaxError: Unexpected token '`', \"```json\n{\n\"... is not valid JSON\n    at JSON.parse (<anonymous>)\n    at file:///Users/ckyony/.asdf/installs/nodejs/22.12.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:62:719\n    at Q (file:///Users/ckyony/.asdf/installs/nodejs/22.12.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:15093)\n    at Pi2 (file:///Users/ckyony/.asdf/installs/nodejs/22.12.0/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-17T09:02:44.503Z"},{"error":"SyntaxError: Unexpected token '`', \"```json\n{\n\"... is not valid JSON\n    at JSON.parse (<anonymous>)\n    at file:///Users/ckyony/.asdf/installs/nodejs/22.12.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:62:719\n    at Q (file:///Users/ckyony/.asdf/installs/nodejs/22.12.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:15093)\n    at Pi2 (file:///Users/ckyony/.asdf/installs/nodejs/22.12.0/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-17T09:09:54.334Z"},{"error":"SyntaxError: Unexpected token '`', \"```json\n{\n\"... is not valid JSON\n    at JSON.parse (<anonymous>)\n    at file:///Users/ckyony/.asdf/installs/nodejs/22.12.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:62:719\n    at Q (file:///Users/ckyony/.asdf/installs/nodejs/22.12.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:15093)\n    at Pi2 (file:///Users/ckyony/.asdf/installs/nodejs/22.12.0/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-17T11:12:25.390Z"},{"error":"SyntaxError: Unexpected token '`', \"```json\n{\n\"... is not valid JSON\n    at JSON.parse (<anonymous>)\n    at file:///Users/ckyony/.asdf/installs/nodejs/22.12.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:62:719\n    at Q (file:///Users/ckyony/.asdf/installs/nodejs/22.12.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:15093)\n    at Pi2 (file:///Users/ckyony/.asdf/installs/nodejs/22.12.0/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-17T11:22:41.512Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n    at vK (file:///Users/ckyony/.asdf/installs/nodejs/22.12.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1140:4413)\n    at file:///Users/ckyony/.asdf/installs/nodejs/22.12.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1140:4141\n    at Array.ma

Note: Error logs were truncated.

View original on GitHub ↗

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