File Edit Conflict: Substring Prevents Modification
Bug Description
Claude crashed with the following stack trace:
node:internal/process/promises:394
triggerUncaughtException(err, true / fromPromise /);
^
Error: Cannot edit file: old_string is a substring of a new_string from a previous edit.
at UT (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1631:530)
at fU5 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1959:11518)
at F (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1959:10496)
at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1959:10762
at SI (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:67:21374)
at vY (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:67:40862)
at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:67:39058
at VO1 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:61:78877)
at Immediate.ZO1 [as _onImmediate] (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:61:79295)
at process.processImmediate (node:internal/timers:505:21)
Node.js v24.2.0
Environment Info
- Platform: darwin
- Terminal: intellij
- Version: 1.0.41
- Feedback ID: dc5cd242-2796-4059-b1aa-c2d9626e68b1
Errors
[{"error":"Error: Command failed: security find-generic-password -a $USER -w -s \"Claude Code\"\nsecurity: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n\n at genericNodeError (node:internal/errors:983:15)\n at wrappedFn (node:internal/errors:537:14)\n at checkExecSyncError (node:child_process:892:11)\n at execSync (node:child_process:964:15)\n at JI (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:702:3921)\n at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:623:9038\n at Q (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:526:13327)\n at _X (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:623:8184)\n at w_ (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:623:7265)\n at U9 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:623:11432)","timestamp":"2025-07-03T13:46:28.379Z"}]This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗