[BUG] Claude Code crashes when editing CLAUDE.md - 'String not found in file. Failed to apply edit'

Resolved 💬 3 comments Opened Jul 1, 2025 by psylector Closed Aug 20, 2025

Bug Description:
Claude Code crashes with 'String not found in file. Failed to apply edit' error when attempting to edit its own CLAUDE.md file. The application terminates completely after this error.

Error Details:

  • Error: String not found in file. Failed to apply edit.
  • Node.js stack trace shows crash in edit operation
  • Application exits completely after the error

Steps to Reproduce:

  1. Claude Code attempts to edit CLAUDE.md (its own project instructions file)
  2. Edit operation fails with string matching error
  3. Application crashes and exits

Expected Behavior:
Claude Code should be able to reliably edit its own CLAUDE.md file, or at minimum handle edit failures gracefully without crashing.

Environment:

  • Node.js v24.3.0
  • macOS (Darwin 24.5.0)

Impact:
This causes complete application termination and loss of work session, requiring restart.

View original on GitHub ↗

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