Edit tool returns '[Tool result missing due to internal error]' — silent freeze, no retry possible

Resolved 💬 3 comments Opened May 10, 2026 by Jakobholmelundtackmann Closed May 14, 2026

Description

The Edit tool intermittently returns [Tool result missing due to internal error] with no further detail. When this happens, the assistant retries the same Edit call, which fails again identically — causing a ~30-minute freeze per retry as the user waits.

Reproduction

  • File: a regular .md file (~4.4KB, not a symlink)
  • Edit: replacing ~5 lines of content (well within normal limits)
  • The exact same change applied via the Write tool succeeds instantly
  • No PreToolUse hook blocked it (edit-size-guard passed; a hook block would show a reason, not "internal error")
  • File was open in VS Code IDE at the time (may or may not be relevant)
  • Observed twice in sequence on the same file in one session

Environment

  • Claude Code CLI on Linux (Pop!_OS / Ubuntu-based)
  • Model: claude-opus-4-6 (1M context)
  • File contained markdown with template syntax ([placeholder] patterns) inside a fenced code block

Workaround

PostToolUse(Edit) hook that detects the error string and injects a systemMessage telling the assistant to fall back to Write. Works, but shouldn't be necessary.

Expected behavior

Edit should either succeed or return a diagnostic error. "Internal error" with no detail and no recovery path is the worst outcome — the assistant has no signal to change strategy and loops.

View original on GitHub ↗

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