[Bug] Conversation Compaction Fails: Unable to Trim Older Messages
Bug Description
I have hit this error quite a few times now. I am wondering if the "conversatio got to long" because it is keep allof the "thinking" messages. I bet if all that part was droped in might work better. Otherwise I don't know why I'd have to go back futehr in the covnersation and lose the newer data.
As a note here is the full message:
Error: Error during compaction: Error: Conversation too long. Press esc twice to go up a few messages and try again.
I wish it would have dropped OLDER message vs having me "go back" -- the goal is to keep the latest and drop the older...or in my case I even tried ot suggest this in the /compact [message] where I noted /compact keep the latest message around the bug fix and choices made so we can keep talkign about them.
Not sure if others are havingthis issue but i wanted to share some thoughts and a request to not a "message siz" limit and/or a way to request that they can be trimmed off of the older messages not the latest.
Environment Info
- Platform: win32
- Terminal: mintty
- Version: 1.0.128
- Feedback ID: 589720bd-97fa-46bd-9d4c-3fad08ea8280
Errors
[{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n at AK (file:///C:/Users/direc/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1774:1183)\n at file:///C:/Users/direc/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1774:911\n at Array.map (<anonymous>)\n at WJ (file:///C:/Users/direc/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1774:902)\n at pJB (file:///C:/Users/direc/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:2912:14271)\n at KC (file:///C:/Users/direc/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:34:19415)\n at Mp (file:///C:/Users/direc/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:36:42814)\n at V9 (file:///C:/Users/direc/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:36:38355)\n at jh (file:///C:/Users/direc/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:36:38283)\n at LC (file:///C:/Users/direc/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:36:38137)","timestamp":"2025-09-27T23:05:19.888Z"},{"error":"Error: Request was aborted.\n at Ju._createMessage (file:///C:/Users/direc/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:899:4711)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-09-27T23:15:36.082Z"},{"error":"SyntaxError: Unexpected token 'I', \"I apologiz\"... is not valid JSON\n at JSON.parse (<anonymous>)\n at file:///C:/Users/direc/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:747:9932\n at Q (file:///C:/Users/direc/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:713:13287)\n at Jy2 (file:///C:/Users/direc/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1087:37066)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-09-27T23:21:06.132Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n at AK (file:///C:/Users/direc/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1774:1183)\n at file:///C:/Users/direc/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1774:911\n at Array.map (<anonymous>)\n at WJ (file:///C:/Users/direc/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1774:902)\n at pJB (file:///C:/Users/direc/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:2912:14271)\n at KC (file:///C:/Users/direc/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:34:19415)\n at Mp (file:///C:/Users/direc/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:36:42814)\n at V9 (file:///C:/Users/direc/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:36:38355)\n at jh (file:///C:/Users/direc/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:36:38283)\n at LC (file:///C:/Users/direc/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:36:38137)","timestamp":"2025-09-27T23:22:22.483Z"},{"error":"SyntaxError: Unexpected token 'I', \"I apologiz\"... is not valid JSON\n at JSON.parse (<anonymous>)\n at file:///C:/Users/direc/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:747:9932\n at Q (file:///C:/Users/direc/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:713:13287)\n at Jy2 (file:///C:/Users/direc/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1087:37066)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-09-27T23:
Note: Error logs were truncated.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗