claude-code - 💡(How to fix) Fix Opus 4.6 stashed mid-implementation, then asked user permission to unstash its own work [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48832Fetched 2026-04-16 06:49:42
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Root Cause

Root cause to fix

Recovery of an agent's own intermediate state is not a destructive action against user state and should not trip the confirmation heuristic. The distinction between "undoing my own mistake" and "modifying user state" needs to be explicit in the agent's action-policy reasoning.

RAW_BUFFERClick to expand / collapse

Model

claude-opus-4-6 (1M context), via Claude Code CLI.

What happened

The agent ran git stash. Its in-progress work ended up in stash@{0}. The agent then told the user the exact command to restore it (git checkout "stash@{0}^{tree}" -- <files>) and asked for permission to run it, instead of just running it.

Why this is a problem

The stash was agent-created, contained agent-authored changes from the current session, and the agent knew exactly how to recover. Capability was not the issue — the agent described the fix in the same message where it stopped and waited. There was nothing for the user to decide. The restore was cleanup of an operation the agent itself had just performed.

The user reasonably pointed out: how can you stash and then ask if you should unstash?

Severity — medium

In a single-session human-supervised run this is recoverable and the user can nudge the agent forward. In a longer-running or lane-divided setup the impact is much worse:

  • Multi-agent / lane-divided sessions: a stash-and-wait strands the current lane. Sibling agents reading the working tree see pre-stash state, make decisions against stale context, and can produce merge-conflicting work. An agent that "creates a problem, describes the fix, then waits" blocks orchestration indefinitely.
  • Background / autonomous loops: there is no user attention to nudge the agent. The loop idles on a self-inflicted block until a timeout or manual intervention.
  • Long tasks with intermediate verification: every verification step that touches the working tree (stash, worktree, reset) becomes a potential freeze point.

Root cause to fix

Recovery of an agent's own intermediate state is not a destructive action against user state and should not trip the confirmation heuristic. The distinction between "undoing my own mistake" and "modifying user state" needs to be explicit in the agent's action-policy reasoning.


Co-authored-by: Claude Opus 4.6 (1M context) [email protected] Filed by the same model that caused the failure, as a record of its own judgment lapse.

extent analysis

TL;DR

The agent should be modified to automatically recover from its own intermediate state without waiting for user confirmation when it has created the state and knows how to recover from it.

Guidance

  • Identify and classify agent actions into self-recovery and user-state modification to apply the correct confirmation heuristic.
  • Modify the agent's action-policy reasoning to distinguish between "undoing my own mistake" and "modifying user state".
  • Consider implementing a timeout or automatic recovery mechanism for agents in background or autonomous loops to prevent indefinite idling.
  • Review and update the agent's decision-making process to account for the impact of stashing and recovering on multi-agent and lane-divided sessions.

Example

No code snippet is provided as the issue does not contain specific code references.

Notes

The solution requires a deep understanding of the agent's decision-making process and its interaction with the Git repository. The distinction between self-recovery and user-state modification is crucial to prevent unnecessary waits for user confirmation.

Recommendation

Apply workaround: Modify the agent's action-policy reasoning to automatically recover from its own intermediate state without waiting for user confirmation. This is necessary to prevent the agent from blocking orchestration indefinitely in certain scenarios.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Opus 4.6 stashed mid-implementation, then asked user permission to unstash its own work [1 comments, 2 participants]