[Bug] Anthropic API Error: Context Length Exceeded During Compaction

Resolved 💬 3 comments Opened Sep 22, 2025 by yashasvigirdhar Closed Jan 8, 2026

Bug Description
Error during compaction: Error: API Error: 400 . input_length and max_tokens exceed context limit: 199211+20000 > 2000000, decrease input length or max_tokens and tryr again

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 1.0.120
  • Feedback ID: 176ca99c-7b12-4c07-9261-640c6643860a

Errors

[{"error":"Error: EISDIR: illegal operation on a directory, read\n    at Module.readFileSync (node:fs:434:20)\n    at Object.readFileSync (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:719:6848)\n    at x9B (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3563:9983)\n    at Object.call (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1724:978)\n    at call.next (<anonymous>)\n    at VJ5 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3350:21057)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async WNB (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3350:17339)\n    at async f9B (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1729:3422)\n    at async rJB (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1972:1631)","timestamp":"2025-09-20T21:46:52.560Z"},{"error":"Error: Request was aborted.\n    at IP.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1009:3864)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-09-20T21:52:23.147Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n    at iV (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1794:1184)\n    at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1794:912\n    at Array.map (<anonymous>)\n    at TX (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1794:903)\n    at cNB (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3368:13746)\n    at QC (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:84:19415)\n    at Jp (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:42814)\n    at W9 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:38355)\n    at Hh (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:38283)\n    at zC (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:38137)","timestamp":"2025-09-20T21:53:01.202Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n    at iV (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1794:1184)\n    at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1794:912\n    at Array.map (<anonymous>)\n    at TX (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1794:903)\n    at cNB (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3368:13746)\n    at QC (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:84:19415)\n    at Fy (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:3227)\n    at Jp (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:43595)\n    at W9 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:38355)\n    at Hh (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:38283)","timestamp":"2025-09-20T21:53:04.350Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n    at iV (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1794:1184)\n    at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1794:912\n    at Array.map (<anonymous>)\n    at TX (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1794:903)\n    at Sb1 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1925:399)\n    at QC (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:84:19415)\n    at Jp (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:42814)\n    at W9 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:38355)\n    at Hh (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:38283)\n    at zC (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:86:38137)","timestamp":"2025-09-20T21:53:38.250Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n    at iV (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1794:1184)\n    at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1794:912\n    at Array.map (<anonymous>)\n    at TX (f

Note: Error logs were truncated.

View original on GitHub ↗

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