[BUG] Error: String not found in file. Failed to apply edit. node:internal/process/promises:394

Resolved 💬 2 comments Opened Jan 9, 2026 by enesmaster Closed Jan 13, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Claude-code session collapsed right after it offered an edit.

╭─────────────────────────────────────────────────────────────────────────╮
│ │
│ Opened changes in Visual Studio Code ⧉ │
│ Save file to continue… │
│ │
│ Do you want to make this edit to __init__.py? │
│ ❯ 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 sO (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1610:728)
at Iz5 (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1924:11518)
at F (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1924:10496)
at file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:1924:10762
at KI (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:82:21374)
at EY (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:82:40861)
at file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:82:39057
at HS1 (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:76:79278)
at Immediate.WS1 [as _onImmediate] (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:76:79696)
at process.processImmediate (node:internal/timers:485:21)

Node.js v22.20.0
enes@enes-MCLG-XX:~/Desktop/<hidden>$
<img width="2299" height="791" alt="Image" src="https://github.com/user-attachments/assets/bde34d88-accf-4c12-bff0-b67695f905e8" />

What Should Happen?

The expected beavior was either selecting an option from one of these three options or wait without collapsing

Error Messages/Logs

Here are the logs:
● Read(<hidden>/base/libraries/deepl/__init__.py)
  ⎿  Read 20 lines (ctrl+r to expand)

● That doesn't show the old method calls. There might be multiple versions of the file or the error is coming from cached code. Let me check what version Python is actually importing by looking at the error again more carefully.

  The error mentions line 363 and 119, but also indicates it's from both /home/enes/Desktop/<hidden>/base/libraries/deepl/__init__.py. Let me completely rewrite the DeepL init file to be sure there are no old references:

● Write(<hidden>/base/libraries/deepl/__init__.py)

Steps to Reproduce

The error happened once and I can not predict the same enviroment since the session was two days old and several files changed in a big project

Claude Model

Opus

Is this a regression?

No, this never worked

Last Working Version

2.0.76

Claude Code Version

2.1.0

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗