claude-code - 💡(How to fix) Fix [MODEL] Near-miss: Claude nearly confirmed "Delete Server" instead of "Delete Snapshot" in autonomous browser agent [1 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#50737Fetched 2026-04-20 12:14:27
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
labeled ×5

The snapshot was created as rollback insurance before attempting a server rescale. CX33 was unavailable at the Nuremberg datacenter. The server was restarted successfully, all 14+ services verified running, and the snapshot was to be deleted to avoid ongoing storage costs (0.73 EUR/Mo).

Error Message

Between clicking the wrong "Löschen" link (step 2) and recognizing the error (step 3), 4 chrome-devtools tool calls were made. Claude committed to an action ("Deleting the snapshot now") before verifying what dialog had actually opened. This is a commit-before-verify anti-pattern.

Root Cause

The snapshot was created as rollback insurance before attempting a server rescale. CX33 was unavailable at the Nuremberg datacenter. The server was restarted successfully, all 14+ services verified running, and the snapshot was to be deleted to avoid ongoing storage costs (0.73 EUR/Mo).

Code Example



---
RAW_BUFFERClick to expand / collapse

Preflight Checklist

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

Type of Behavior Issue

Other unexpected behavior

What You Asked Claude to Do

Task

Delete the "pre-rescale-cx33-2026-04-19" snapshot from a Hetzner Cloud CX23 server ("fabiconnect", ID 122271345) after a failed CX23→CX33 rescale attempt.

Setup

  • Agent: Claude Code CLI on Windows 11, operating as autonomous browser agent
  • Tool: chrome-devtools MCP connector via Chrome DevTools Protocol (CDP), Port 9222
  • Target UI: Hetzner Cloud Console (console.hetzner.cloud)
  • Mode: Autonomous — operator (Fabian) observes but does not manually intervene in browser actions
  • Orchestration: Claude-to-Claude (Controller-Claude in web chat directs Agent-Claude in CLI)

Context

The snapshot was created as rollback insurance before attempting a server rescale. CX33 was unavailable at the Nuremberg datacenter. The server was restarted successfully, all 14+ services verified running, and the snapshot was to be deleted to avoid ongoing storage costs (0.73 EUR/Mo).

What Claude Actually Did

Step-by-step chronology

  1. Navigation (3 tool calls): Claude navigated to the server detail page and located the snapshot section. Correct so far.

  2. Wrong click (4 tool calls): Claude announced "Server is ON, snapshot exists. Deleting the snapshot now." — then opened a dropdown and clicked the wrong "Löschen" (Delete) link. The announcement was factually incorrect: the dialog that opened was "Delete Server", not "Delete Snapshot".

  3. Self-correction (2 tool calls): Claude read the DOM snapshot and recognized the dialog title said "Server löschen" (Delete Server) instead of "Snapshot löschen" (Delete Snapshot). Output: "STOP — this is the SERVER delete dialog, not the snapshot! Aborting immediately." Clicked "Abbrechen" (Cancel).

  4. Recovery (3 tool calls): Claude used JavaScript evaluate_script to inspect the DOM and positively identify the correct dropdown by contextual features (the dropdown containing a "Rebuild" option belongs to a snapshot, not a server).

  5. Correct deletion (3 tool calls + 1 file read): Found the correct "Delete Snapshot" dialog, entered the snapshot name, confirmed deletion.

  6. Verification (post-hoc): Checked three independent signals — server status indicator (green/ON), empty snapshot list ("No snapshots exist"), and deletion confirmation message.

Key failure point

Between clicking the wrong "Löschen" link (step 2) and recognizing the error (step 3), 4 chrome-devtools tool calls were made. Claude committed to an action ("Deleting the snapshot now") before verifying what dialog had actually opened. This is a commit-before-verify anti-pattern.

Expected Behavior

Expected: Pre-interaction dialog verification

Before interacting with any confirmation dialog during a destructive action, Claude should:

  1. Click the action trigger (e.g., "Delete" button)
  2. Take a DOM snapshot as a dedicated verification step
  3. Extract and log the dialog title verbatim
  4. Compare the dialog title to the intended action type
  5. Only if the title matches the intended action: proceed with confirmation
  6. If mismatch: abort immediately and report to operator

This adds one tool call of latency but eliminates the commit-before-verify failure mode entirely.

Additionally expected: Abort-and-ask for ambiguous UI

When multiple UI elements of the same type exist for different resource scopes (e.g., "Delete" for server vs. "Delete" for snapshot), the agent should stop and ask the operator rather than proceeding with best-guess selection. The cost of a false pause is far lower than the cost of deleting the wrong resource.

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

High - Significant unwanted changes

Claude Code Version

2.1.114

Platform

Anthropic API

Additional Context

No response

extent analysis

TL;DR

To prevent the commit-before-verify anti-pattern, Claude should verify the dialog title after clicking the action trigger and before proceeding with confirmation.

Guidance

  • Implement a dedicated verification step to take a DOM snapshot after clicking the action trigger.
  • Extract and log the dialog title verbatim to compare it with the intended action type.
  • Abort immediately and report to the operator if the dialog title does not match the intended action.
  • Consider adding a feature to stop and ask the operator when encountering ambiguous UI elements to avoid incorrect actions.

Example

No code example is provided as the issue is related to the logic and workflow of the Claude Code CLI, and the exact implementation details are not specified.

Notes

The proposed solution focuses on addressing the commit-before-verify anti-pattern and improving the handling of ambiguous UI elements. However, the effectiveness of this solution may depend on the specific implementation and the overall design of the Claude Code CLI.

Recommendation

Apply the workaround by implementing the dedicated verification step and aborting when the dialog title does not match the intended action. This approach can help prevent similar issues in the future by ensuring that Claude verifies the dialog title before proceeding with destructive actions.

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