[Bug] Edit tool false positive "File has been unexpectedly modified" detection
Status Fixed / completed
Maintainer reply None cached
Activity 2 comments · opened Dec 14, 2025 · closed Dec 14, 2025
Bug Description
Edit tool repeatedly fails with "File has been unexpectedly modified" even when file hasn't changed. Verified via certutil -hashfile and Get-Item LastWriteTime - file timestamp was hours old, no actual modification occurred.
Repro:
- Read file (succeeds)
- Edit file in same response (fails with "unexpectedly modified")
- Re-read and retry (still fails)
- File timestamp confirms no actual modification
Observations:
- Affects some files but not others in same session
- Agent subprocesses (Task tool) can sometimes edit when main conversation cannot
- Closing VS Code doesn't fix it
- Restarting VS Code doesn't fix it
- Issue persists across multiple read/edit cycles
Environment: Windows, VS Code extension + CLI, Claude Code latest
Environment Info
- Platform: win32
- Terminal: vscode
- Version: 2.0.69
- Feedback ID: 48f41c22-0974-48cb-8cc5-82f3798ff9b5
Errors
[{"error":"Error: Error parsing line in C:\\Users\\Lex\\.claude\\projects\\D--Dev-deleteme-test\\6b92645a-1dd4-45ba-a7b3-b7a2311cd87e.jsonl: SyntaxError: JSON Parse error: Invalid escape character D\n at <anonymous> (B:/~BUN/root/claude.exe:77:84)\n at map (native:1:11)\n at AR (B:/~BUN/root/claude.exe:77:29)\n at async <anonymous> (B:/~BUN/root/claude.exe:3861:3838)\n at async bwH (B:/~BUN/root/claude.exe:3861:3683)\n at async <anonymous> (B:/~BUN/root/claude.exe:3861:9283)\n at async TBA (B:/~BUN/root/claude.exe:3861:141)\n at async Z_I (B:/~BUN/root/claude.exe:3861:9079)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-12-14T17:27:48.336Z"},{"error":"Error: Error parsing line in C:\\Users\\Lex\\.claude\\projects\\D--Dev-deleteme-test\\6b92645a-1dd4-45ba-a7b3-b7a2311cd87e.jsonl: SyntaxError: JSON Parse error: Invalid escape character D\n at <anonymous> (B:/~BUN/root/claude.exe:77:84)\n at map (native:1:11)\n at AR (B:/~BUN/root/claude.exe:77:29)\n at async <anonymous> (B:/~BUN/root/claude.exe:3861:3838)\n at async bwH (B:/~BUN/root/claude.exe:3861:3683)\n at async <anonymous> (B:/~BUN/root/claude.exe:3861:9283)\n at async TBA (B:/~BUN/root/claude.exe:3861:141)\n at async Z_I (B:/~BUN/root/claude.exe:3861:9079)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-12-14T17:27:48.336Z"},{"error":"Error: Error parsing line in C:\\Users\\Lex\\.claude\\projects\\D--Dev-deleteme-test\\6b92645a-1dd4-45ba-a7b3-b7a2311cd87e.jsonl: SyntaxError: JSON Parse error: Invalid escape character D\n at <anonymous> (B:/~BUN/root/claude.exe:77:84)\n at map (native:1:11)\n at AR (B:/~BUN/root/claude.exe:77:29)\n at async <anonymous> (B:/~BUN/root/claude.exe:3861:3838)\n at async bwH (B:/~BUN/root/claude.exe:3861:3683)\n at async <anonymous> (B:/~BUN/root/claude.exe:3861:9283)\n at async TBA (B:/~BUN/root/claude.exe:3861:141)\n at async Z_I (B:/~BUN/root/claude.exe:3861:9079)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-12-14T17:27:48.336Z"},{"error":"Error: Error parsing line in C:\\Users\\Lex\\.claude\\projects\\D--Dev-deleteme-test\\6b92645a-1dd4-45ba-a7b3-b7a2311cd87e.jsonl: SyntaxError: JSON Parse error: Invalid escape character D\n at <anonymous> (B:/~BUN/root/claude.exe:77:84)\n at map (native:1:11)\n at AR (B:/~BUN/root/claude.exe:77:29)\n at async <anonymous> (B:/~BUN/root/claude.exe:3861:3838)\n at async bwH (B:/~BUN/root/claude.exe:3861:3683)\n at async <anonymous> (B:/~BUN/root/claude.exe:3861:9283)\n at async TBA (B:/~BUN/root/claude.exe:3861:141)\n at async Z_I (B:/~BUN/root/claude.exe:3861:9079)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-12-14T17:27:48.337Z"},{"error":"Error: Error parsing line in C:\\Users\\Lex\\.claude\\projects\\D--Dev-deleteme-test\\6b92645a-1dd4-45ba-a7b3-b7a2311cd87e.jsonl: SyntaxError: JSON Parse error: Invalid escape character D\n at <anonymous> (B:/~BUN/root/claude.exe:77:84)\n at map (native:1:11)\n at AR (B:/~BUN/root/claude.exe:77:29)\n at async <anonymous> (B:/~BUN/root/claude.exe:3861:3838)\n at async bwH (B:/~BUN/root/claude.exe:3861:3683)\n at async <anonymous> (B:/~BUN/root/claude.exe:3861:9283)\n at async TBA (B:/~BUN/root/claude.exe:3861:141)\n at async Z_I (B:/~BUN/root/claude.exe:3861:9079)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-12-14T17:27:48.337Z"},{"error":"Error: Error parsing line in C:\\Users\\Lex\\.claude\\projects\\D--Dev-deleteme-test\\6b92645a-1dd4-45ba-a7b3-b7a2311cd87e.jsonl: SyntaxError: JSON Parse error: Invalid escape character D\n at <anonymous> (B:/~BUN/root/claude.exe:77:84)\n at map (native:1:11)\n at AR (B:/~BUN/root/claude.exe:77:29)\n at async <anonymous> (B:/~BUN/root/claude.exe:3861:3838)\n
Note: Error logs were truncated.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗