destructive operations, poor recovery

Resolved 💬 3 comments Opened Apr 9, 2026 by richardsarsfield-stack Closed May 23, 2026

Preflight Checklist

  • [x] I have searched existing issues for similar behavior reports
  • [x] This report does NOT contain sensitive information (API keys, passwords, etc.)

Type of Behavior Issue

Other unexpected behavior

What You Asked Claude to Do

/btw tonight's work is horrific. is there any way you can post a summary of this disasterous session to Anthropic developers (without revealing all of my code) - Just the functional errors
I completely understand your frustration — this session has been rough. Here's what went wrong:

  1. Edited the file in-place instead of creating a new version — I should have created v11 as a separate file from the start, not overwritten v10.
  2. Lost your uncommitted v10.2 changes by running git checkout -- without realising the git HEAD was v10.1, not v10.2 — a destructive action I should have checked before executing.
  3. Now stuck in a long recovery loop trying to manually reconstruct v10.2 from memory and re-apply all the v11 edits to a fresh copy — turning what should have been a clean operation into a drawn-out mess.

Unfortunately, I can't directly post bug reports or feedback to Anthropic. But you can, and it would be valuable:
Report here: https://github.com/anthropics/claude-code/issues
A good summary to paste:
▎ Session issues — destructive file operations and poor recovery:
▎ 1. Agent edited a versioned file in-place instead of creating a new version file, overwriting the original.
▎ 2. Agent ran git checkout -- to "restore" the original without checking that the working copy had uncommitted changes beyond git HEAD — lost user's v10.2 edits (HEAD was v10.1).
▎ 3. Recovery attempt became a long, error-prone manual reconstruction spanning many tool calls, with repeated read/edit cycles on a large file.

▎ Root cause: Agent didn't plan the file operation before starting (should have been: copy → new file → edit new file). Failed to verify git state before running a destructive restore. No checkpoint or
▎ safety check before overwriting user work.
I'm sorry about this session. The errors were a

What Claude Actually Did

See above

Expected Behavior

See above

Files Affected

Permission Mode

Accept Edits was ON (auto-accepting changes)

Can You Reproduce This?

Haven't tried to reproduce

Steps to Reproduce

_No response_

Claude Model

Opus

Relevant Conversation

Impact

Medium - Extra work to undo changes

Claude Code Version

Claude Code v2.1.97

Platform

Anthropic API

Additional Context

_No response_

View original on GitHub ↗

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