File Edit Failure: String Not Found in Target File
Bug Description when modifying claude.md, error occured.
@CLAUDE.md#L144-160 이 부분을 모호한 부분을 좀더 명확하게 작성하고 간결하게 작성하고 싶어. ⎿ Read CLAUDE.md (17 lines)
⏺ 해당 Rules 섹션을 더 명확하고 간결하게 수정하겠습니다.
⏺ Update(CLAUDE.md)
╭────────────────────────────────────────────────────────────────╮ │ │ │ Opened changes in Cursor ⧉ │ │ Save file to continue… │ │ │ │ Do you want to make this edit to CLAUDE.md? │ │ ❯ 1. Yes │ │ 2. Yes, and don't ask again this session (shift+tab) │ │ 3. No, and tell Claude what to do differently (esc) │ │ │ ╰────────────────────────────────────────────────────────────────╯
node:internal/process/promises:394 triggerUncaughtException(err, true /* fromPromise */); ^
Error: String not found in file. Failed to apply edit. at uT (file:///Users/jeongjunhyeon/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1636:728) at iR6 (file:///Users/jeongjunhyeon/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1969:12134) at J (file:///Users/jeongjunhyeon/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1969:11112) at file:///Users/jeongjunhyeon/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1969:11378 at hD (file:///Users/jeongjunhyeon/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:67:21377) at oF (file:///Users/jeongjunhyeon/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:67:40875) at file:///Users/jeongjunhyeon/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:67:39071 at KT1 (file:///Users/jeongjunhyeon/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:61:78877) at Immediate.FT1 [as _onImmediate] (file:///Users/jeongjunhyeon/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:61:79295) at process.processImmediate (node:internal/timers:491:21)
Node.js v22.14.0
Environment Info
- Platform: darwin
- Terminal: cursor
- Version: 1.0.51
- Feedback ID: 632b3042-891e-43e2-b5fa-e287c5b6d48c
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:882:11)\n at execSync (node:child_process:954:15)\n at eD (file:///Users/jeongjunhyeon/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:712:4489)\n at file:///Users/jeongjunhyeon/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:624:13989\n at Q (file:///Users/jeongjunhyeon/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:526:14406)\n at QF (file:///Users/jeongjunhyeon/.nvm/versions/node/v22.14.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:624:13129)\n at cC (file:///Users/jeongjun
Note: Error logs were truncated.
I have same issue on my Linux machine. When I past my paper into the readme.md, and ask Claude-code to rewrite it into a README file, I got the same issue.
I have this same issue on windows. It seems to happen anytime it needs me to confirm an action
Same error message on Mac with Claude Code 1.0.56
Hello, same error on Linux Ubuntu with Node.js v18.19.1 and Claude 1.0.57. Also, I executed several times /doctor and it seems all correct. Thanks.
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.