[Bug] Unintended text injection corrupting code files during edits
Description:
During a code edit operation, random unrelated text about geometry/parabolas was injected into a TypeScript file. The injected content had no relation to:
- The user's prompt
- The codebase
- The task being performed
Steps to Reproduce:
- User asked to fix an issue
- Claude attempted to edit code
- The Edit tool was called with old_string and new_string parameters
- Result: Random geometry text was inserted into the file
Injected Content (excerpt):
- A line with a specified midpoint: Infinite lines (rotating around the midpoint).
- A line with a specified footpoint of perpendicular from a specific point...
### Focus on the Parabola:
For a parabola, specific tangent or normal properties...
Theorem: For each point P on π, there exist exactly two lines...
Expected Behavior:
Only the specified new_string content should be written to the file.
Actual Behavior:
Unrelated text was injected, corrupting the source file.
Environment Info
- Platform: darwin
- Terminal: vscode
- Version: 2.0.76
- Feedback ID: 613b7244-5698-4058-9b5c-b838783106c9
Errors
[{"error":"AggregateError\n at m3A.from (file:///Users/yusuf/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:43:63985)\n at VU.<anonymous> (file:///Users/yusuf/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:57:10016)\n at VU.emit (node:events:508:28)\n at VU.emit (node:domain:489:12)\n at bw1.<computed> (file:///Users/yusuf/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:56:3432)\n at ClientRequest.emit (node:events:508:28)\n at ClientRequest.emit (node:domain:489:12)\n at emitErrorEvent (node:_http_client:107:11)\n at TLSSocket.socketErrorListener (node:_http_client:574:5)\n at TLSSocket.emit (node:events:508:28)\n at fzA.request (file:///Users/yusuf/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:59:2130)\n at processTicksAndRejections (node:internal/process/task_queues:105:5)\n at runNextTicks (node:internal/process/task_queues:69:3)\n at listOnTimeout (node:internal/timers:569:9)\n at process.processTimers (node:internal/timers:543:7)\n at async UT2 (file:///Users/yusuf/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1845:3609)","timestamp":"2026-01-04T08:47:18.103Z"},{"error":"AggregateError\n at m3A.from (file:///Users/yusuf/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:43:63985)\n at VU.<anonymous> (file:///Users/yusuf/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:57:10016)\n at VU.emit (node:events:508:28)\n at VU.emit (node:domain:489:12)\n at bw1.<computed> (file:///Users/yusuf/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:56:3432)\n at ClientRequest.emit (node:events:520:35)\n at ClientRequest.emit (node:domain:489:12)\n at emitErrorEvent (node:_http_client:107:11)\n at TLSSocket.socketErrorListener (node:_http_client:574:5)\n at TLSSocket.emit (node:events:508:28)\n at fzA.request (file:///Users/yusuf/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:59:2130)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async L17 (file:///Users/yusuf/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2614:9071)\n at async file:///Users/yusuf/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2614:9964","timestamp":"2026-01-04T08:47:18.105Z"},{"error":"Error: EISDIR: illegal operation on a directory, read\n at Module.readFileSync (node:fs:440:20)\n at file:///Users/yusuf/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:9:429\n at oI (file:///Users/yusuf/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:8:8084)\n at Object.readFileSync (file:///Users/yusuf/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:9:404)\n at zdB (file:///Users/yusuf/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:4739:22342)\n at Object.call (file:///Users/yusuf/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1027:942)\n at Au5 (file:///Users/yusuf/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2207:17446)","timestamp":"2026-01-04T08:59:38.206Z"},{"error":"Error: Request was aborted.\n at _0A._createMessage (file:///Users/yusuf/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:514:3157)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2026-01-04T14:57:29.584Z"},{"error":"Error: Request was aborted.\n at _0A._createMessage (file:///Users/yusuf/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:514:3157)\n at processTicksAndRejections (node:internal/process/task_queues:105:5)\n at runNextTicks (node:internal/process/task_queues:69:3)\n at process.processTimers (node:internal/timers:540:9)","timestamp":"2026-01-04T14:59:54.279Z"},{"error":"Error: Request was aborted.\n at _0A._createMessage (file:///Users/yusuf/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:514:3157)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2026-01-04T15:00:24.077Z"}]
<img width="673" height="1120" alt="Image" src="https://github.com/user-attachments/assets/1ec90af4-03f2-46f7-b1c6-4ed0bdf80124" />
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗