[Bug] Claude randomly inserts unexpected code during generation
Resolved 💬 3 comments Opened Dec 10, 2025 by NearlyNormal Closed Dec 14, 2025
Bug Description
Horrible random addition to code from both Opus 4.5 and Sonnet 4.5, Very disappointed. I pay for "max"!
Environment Info
- Platform: darwin
- Terminal: Apple_Terminal
- Version: 2.0.62
- Feedback ID:
Errors
[{"error":"SyntaxError: Unexpected non-whitespace character after JSON at position 73 (line 6 column 1)\n at JSON.parse (<anonymous>)\n at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:59:693\n at B (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:6526)\n at z12 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1436:2645)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-12-09T20:47:09.546Z"},{"error":"MaxFileReadTokenExceededError: File content (47062 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 x12 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1446:10603)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Object.call (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1455:963)\n at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1678:1465","timestamp":"2025-12-09T23:26:15.418Z"},{"error":"Error: Request was aborted.\n at Fo._createMessage (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:125:3151)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-12-10T01:32:01.989Z"},{"error":"MaxFileReadTokenExceededError: File content (26425 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 x12 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1446:10603)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Object.call (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1455:963)\n at async rv7 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3108:16768)","timestamp":"2025-12-10T02:11:19.410Z"},{"error":"yQ1: Failed to install new version of claude: npm error code ENOTEMPTY\nnpm error syscall rename\nnpm error path /opt/homebrew/lib/node_modules/@anthropic-ai/claude-code\nnpm error dest /opt/homebrew/lib/node_modules/@anthropic-ai/.claude-code-2DTsDk1V\nnpm error errno -66\nnpm error ENOTEMPTY: directory not empty, rename '/opt/homebrew/lib/node_modules/@anthropic-ai/claude-code' -> '/opt/homebrew/lib/node_modules/@anthropic-ai/.claude-code-2DTsDk1V'\nnpm error A complete log of this run can be found in: /Users/shanx/.npm/_logs/2025-12-10T02_55_58_228Z-debug-0.log\n at PMA (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1489:459)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Object.current (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2783:9773)","timestamp":"2025-12-10T02:55:58.578Z"},{"error":"yQ1: Failed to install new version of claude: npm error code ENOTEMPTY\nnpm error syscall rename\nnpm error path /opt/homebrew/lib/node_modules/@anthropic-ai/claude-code\nnpm error dest /opt/homebrew/lib/node_modules/@anthropic-ai/.claude-code-2DTsDk1V\nnpm error errno -66\nnpm error ENOTEMPTY: directory not empty, rename '/opt/homebrew/lib/node_modules/@anthropic-ai/claude-code' -> '/opt/homebrew/lib/node_modules/@anthropic-ai/.claude-code-2DTsDk1V'\nnpm error A complete log of this run can be found in: /Users/shanx/.npm/_logs/2025-12-10T02_59_34_936Z-debug-0.log\n at PMA (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1489:459)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2783:9773","timestamp":"2025-12-10T02:59:35.138Z"},{"error":"Error: ENOENT: no such file or directory, open '/error_trace3.png'\n at Object.openSync (node:fs:563:18)\n at Module.readFileSync (node:fs:447:35)\n at Object.readFileBytesSync (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:9:369)\n at BRB (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:881:86407)\n at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:931:3992\n at i8 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:739:24089)\n at r4 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:739:25007)\n at H4 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:739:24129)\n at Object.useState (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:739:101608)\n at e34.useState (file:///opt/homebrew/li
Note: Error logs were truncated.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗