claude-code - 💡(How to fix) Fix [Bug] Agent mishandles branch creation, uses worktree instead of checkout and performs unsafe resets

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…

Error Message

[{"error":"Error: Request was aborted.\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3449)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-05-15T10:38:28.934Z"},{"error":"McpToolCallError: ### Error\nTimeoutError: browserBackend.callTool: Timeout 5000ms exceeded.\nCall log:\n\u001b[2m - waiting for locator('aria-ref=e521')\u001b[22m\n\u001b[2m - locator resolved to <button role="radio" type="button" tabindex="-1" value="encrypt" aria-checked="false" data-state="unchecked" id="storage-mode-encrypt" data-radix-collection-item="" class="aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 sr-only"></button>\u001b[22m\n\u001b[2m - attempting click action\u001b[22m\n\u001b[2m 2 × waiting for element to be visible, enabled and stable\u001b[22m\n\u001b[2m - element is visible, enabled and stable\u001b[22m\n\u001b[2m - scrolling into view if needed\u001b[22m\n\u001b[2m - done scrolling\u001b[22m\n\u001b[2m - <rect x="3" y="11" rx="2" ry="2" width="18" height="11"></rect> from <div class="flex items-center gap-2">…</div> subtree intercepts pointer events\u001b[22m\n\u001b[2m - retrying click action\u001b[22m\n\u001b[2m - waiting 20ms\u001b[22m\n\u001b[2m 2 × waiting for element to be visible, enabled and stable\u001b[22m\n\u001b[2m - element is visible, enabled and stable\u001b[22m\n\u001b[2m - scrolling into view if needed\u001b[22m\n\u001b[2m - done scrolling\u001b[22m\n\u001b[2m - <rect x="3" y="11" rx="2" ry="2" width="18" height="11"></rect> from <div class="flex items-center gap-2">…</div> subtree intercepts pointer events\u001b[22m\n\u001b[2m - retrying click action\u001b[22m\n\u001b[2m - waiting 100ms\u001b[22m\n\u001b[2m 9 × waiting for element to be visible, enabled and stable\u001b[22m\n\u001b[2m - element is visible, enabled and stable\u001b[22m\n\u001b[2m - scrolling into view if needed\u001b[22m\n\u001b[2m - done scrolling\u001b[22m\n\u001b[2m - <rect x="3" y="11" rx="2" ry="2" width="18" height="11"></rect> from <div class="flex items-center gap-2">…</div> subtree intercepts pointer events\u001b[22m\n\u001b[2m - retrying click action\u001b[22m\n\u001b[2m - waiting 500ms\u001b[22m\n\n at xr5 (/$bunfs/root/src/entrypoints/cli.js:4905:63)\n at Fc7 (/$bunfs/root/src/entrypoints/cli.js:4905:1409)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-05-15T11:09:49.169Z"},{"error":"McpToolCallError: ### Error\nError: browserBackend.callTool: Error: strict mode violation: locator('[title="PII Type: IL_BANK_ACCOUNT (encrypted) — click to reveal"]') resolved to 4 elements:\n 1) <span data-pii-type="IL_BANK_ACCOUNT" data-encrypted="7_spvZnr5QJ_dyUHuRB8H3uX2nKIkYgVNQso3Q8kOoA=" title="PII Type: IL_BANK_ACCOUNT (encrypted) — click to reveal" class="inline-flex items-center px-1.5 py-0.5 mx-0.5 rounded text-xs font-medium border bg-muted text-muted-foreground border-border cursor-pointer hover:opacity-80 gap-1">…</span> aka getByText('IL BANK').first()\n 2) <span data-pii-type="IL_BANK_ACCOUNT" data-encrypted="4Yw4B8c9B93-qNVIRjrxfXLJJpDRPMJ1FRaULfOR77k=" title="PII Type: IL_BANK_ACCOUNT (encrypted) — click to reveal" class="inline-flex items-center px-1.5 py-0.5 mx-0.5 rounded text-xs font-medium border bg-muted text-muted-foreground border-border cursor-pointer hover:opacity-80 gap-1">…</span> aka getByText('IL BANK').nth(1)\n 3) <span data-pii-type="IL_BANK_ACCOUNT" data-encrypted="HueBpx0opEwAfkflHGt6tcr98MvCdYjb7kscFwX0Lm8=" title="PII Type: IL_BANK_ACCOUNT (encrypted) — click to reveal" class="inline-flex items-center px-1.5 py-0.5 mx-0.5 rounded text-xs font-medium border bg-muted text-muted-foregrou…

Code Example

[{"error":"Error: Request was aborted.\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3449)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-15T10:38:28.934Z"},{"error":"McpToolCallError: ### Error\nTimeoutError: browserBackend.callTool: Timeout 5000ms exceeded.\nCall log:\n\u001b[2m  - waiting for locator('aria-ref=e521')\u001b[22m\n\u001b[2m    - locator resolved to <button role=\"radio\" type=\"button\" tabindex=\"-1\" value=\"encrypt\" aria-checked=\"false\" data-state=\"unchecked\" id=\"storage-mode-encrypt\" data-radix-collection-item=\"\" class=\"aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 sr-only\"></button>\u001b[22m\n\u001b[2m  - attempting click action\u001b[22m\n\u001b[2m    2 × waiting for element to be visible, enabled and stable\u001b[22m\n\u001b[2m      - element is visible, enabled and stable\u001b[22m\n\u001b[2m      - scrolling into view if needed\u001b[22m\n\u001b[2m      - done scrolling\u001b[22m\n\u001b[2m      - <rect x=\"3\" y=\"11\" rx=\"2\" ry=\"2\" width=\"18\" height=\"11\"></rect> from <div class=\"flex items-center gap-2\">…</div> subtree intercepts pointer events\u001b[22m\n\u001b[2m    - retrying click action\u001b[22m\n\u001b[2m    - waiting 20ms\u001b[22m\n\u001b[2m    2 × waiting for element to be visible, enabled and stable\u001b[22m\n\u001b[2m      - element is visible, enabled and stable\u001b[22m\n\u001b[2m      - scrolling into view if needed\u001b[22m\n\u001b[2m      - done scrolling\u001b[22m\n\u001b[2m      - <rect x=\"3\" y=\"11\" rx=\"2\" ry=\"2\" width=\"18\" height=\"11\"></rect> from <div class=\"flex items-center gap-2\">…</div> subtree intercepts pointer events\u001b[22m\n\u001b[2m    - retrying click action\u001b[22m\n\u001b[2m      - waiting 100ms\u001b[22m\n\u001b[2m    9 × waiting for element to be visible, enabled and stable\u001b[22m\n\u001b[2m      - element is visible, enabled and stable\u001b[22m\n\u001b[2m      - scrolling into view if needed\u001b[22m\n\u001b[2m      - done scrolling\u001b[22m\n\u001b[2m      - <rect x=\"3\" y=\"11\" rx=\"2\" ry=\"2\" width=\"18\" height=\"11\"></rect> from <div class=\"flex items-center gap-2\">…</div> subtree intercepts pointer events\u001b[22m\n\u001b[2m    - retrying click action\u001b[22m\n\u001b[2m      - waiting 500ms\u001b[22m\n\n    at xr5 (/$bunfs/root/src/entrypoints/cli.js:4905:63)\n    at Fc7 (/$bunfs/root/src/entrypoints/cli.js:4905:1409)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-15T11:09:49.169Z"},{"error":"McpToolCallError: ### Error\nError: browserBackend.callTool: Error: strict mode violation: locator('[title=\"PII Type: IL_BANK_ACCOUNT (encrypted) — click to reveal\"]') resolved to 4 elements:\n    1) <span data-pii-type=\"IL_BANK_ACCOUNT\" data-encrypted=\"7_spvZnr5QJ_dyUHuRB8H3uX2nKIkYgVNQso3Q8kOoA=\" title=\"PII Type: IL_BANK_ACCOUNT (encrypted) — click to reveal\" class=\"inline-flex items-center px-1.5 py-0.5 mx-0.5 rounded text-xs font-medium border bg-muted text-muted-foreground border-border cursor-pointer hover:opacity-80 gap-1\"></span> aka getByText('IL BANK').first()\n    2) <span data-pii-type=\"IL_BANK_ACCOUNT\" data-encrypted=\"4Yw4B8c9B93-qNVIRjrxfXLJJpDRPMJ1FRaULfOR77k=\" title=\"PII Type: IL_BANK_ACCOUNT (encrypted) — click to reveal\" class=\"inline-flex items-center px-1.5 py-0.5 mx-0.5 rounded text-xs font-medium border bg-muted text-muted-foreground border-border cursor-pointer hover:opacity-80 gap-1\"></span> aka getByText('IL BANK').nth(1)\n    3) <span data-pii-type=\"IL_BANK_ACCOUNT\" data-encrypted=\"HueBpx0opEwAfkflHGt6tcr98MvCdYjb7kscFwX0Lm8=\" title=\"PII Type: IL_BANK_ACCOUNT (encrypted) — click to reveal\" class=\"inline-flex items-center px-1.5 py-0.5 mx-0.5 rounded text-xs font-medium border bg-muted text-muted-foregrou…
RAW_BUFFERClick to expand / collapse

Bug Description Agent made a mess out of a simple request. I asked to take changes to a new branch off main. The right answer was 3 commands (git stash, git checkout -b ... main, git stash pop) — exactly what I eventually had to do myself.
Instead the agent created a worktree (!!) I didn't ask for, then tried to clean it up with destructive ops that got hook-blocked, then made the working tree show 100+ changes by resetting blindly to main without thinking about what would happen and no recovery plan.

Environment Info

  • Platform: darwin
  • Terminal: vscode
  • Version: 2.1.132
  • Feedback ID: 0b182889-ab74-40fb-b430-3415625e1264

Errors

[{"error":"Error: Request was aborted.\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3449)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-15T10:38:28.934Z"},{"error":"McpToolCallError: ### Error\nTimeoutError: browserBackend.callTool: Timeout 5000ms exceeded.\nCall log:\n\u001b[2m  - waiting for locator('aria-ref=e521')\u001b[22m\n\u001b[2m    - locator resolved to <button role=\"radio\" type=\"button\" tabindex=\"-1\" value=\"encrypt\" aria-checked=\"false\" data-state=\"unchecked\" id=\"storage-mode-encrypt\" data-radix-collection-item=\"\" class=\"aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 sr-only\"></button>\u001b[22m\n\u001b[2m  - attempting click action\u001b[22m\n\u001b[2m    2 × waiting for element to be visible, enabled and stable\u001b[22m\n\u001b[2m      - element is visible, enabled and stable\u001b[22m\n\u001b[2m      - scrolling into view if needed\u001b[22m\n\u001b[2m      - done scrolling\u001b[22m\n\u001b[2m      - <rect x=\"3\" y=\"11\" rx=\"2\" ry=\"2\" width=\"18\" height=\"11\"></rect> from <div class=\"flex items-center gap-2\">…</div> subtree intercepts pointer events\u001b[22m\n\u001b[2m    - retrying click action\u001b[22m\n\u001b[2m    - waiting 20ms\u001b[22m\n\u001b[2m    2 × waiting for element to be visible, enabled and stable\u001b[22m\n\u001b[2m      - element is visible, enabled and stable\u001b[22m\n\u001b[2m      - scrolling into view if needed\u001b[22m\n\u001b[2m      - done scrolling\u001b[22m\n\u001b[2m      - <rect x=\"3\" y=\"11\" rx=\"2\" ry=\"2\" width=\"18\" height=\"11\"></rect> from <div class=\"flex items-center gap-2\">…</div> subtree intercepts pointer events\u001b[22m\n\u001b[2m    - retrying click action\u001b[22m\n\u001b[2m      - waiting 100ms\u001b[22m\n\u001b[2m    9 × waiting for element to be visible, enabled and stable\u001b[22m\n\u001b[2m      - element is visible, enabled and stable\u001b[22m\n\u001b[2m      - scrolling into view if needed\u001b[22m\n\u001b[2m      - done scrolling\u001b[22m\n\u001b[2m      - <rect x=\"3\" y=\"11\" rx=\"2\" ry=\"2\" width=\"18\" height=\"11\"></rect> from <div class=\"flex items-center gap-2\">…</div> subtree intercepts pointer events\u001b[22m\n\u001b[2m    - retrying click action\u001b[22m\n\u001b[2m      - waiting 500ms\u001b[22m\n\n    at xr5 (/$bunfs/root/src/entrypoints/cli.js:4905:63)\n    at Fc7 (/$bunfs/root/src/entrypoints/cli.js:4905:1409)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-15T11:09:49.169Z"},{"error":"McpToolCallError: ### Error\nError: browserBackend.callTool: Error: strict mode violation: locator('[title=\"PII Type: IL_BANK_ACCOUNT (encrypted) — click to reveal\"]') resolved to 4 elements:\n    1) <span data-pii-type=\"IL_BANK_ACCOUNT\" data-encrypted=\"7_spvZnr5QJ_dyUHuRB8H3uX2nKIkYgVNQso3Q8kOoA=\" title=\"PII Type: IL_BANK_ACCOUNT (encrypted) — click to reveal\" class=\"inline-flex items-center px-1.5 py-0.5 mx-0.5 rounded text-xs font-medium border bg-muted text-muted-foreground border-border cursor-pointer hover:opacity-80 gap-1\">…</span> aka getByText('IL BANK').first()\n    2) <span data-pii-type=\"IL_BANK_ACCOUNT\" data-encrypted=\"4Yw4B8c9B93-qNVIRjrxfXLJJpDRPMJ1FRaULfOR77k=\" title=\"PII Type: IL_BANK_ACCOUNT (encrypted) — click to reveal\" class=\"inline-flex items-center px-1.5 py-0.5 mx-0.5 rounded text-xs font-medium border bg-muted text-muted-foreground border-border cursor-pointer hover:opacity-80 gap-1\">…</span> aka getByText('IL BANK').nth(1)\n    3) <span data-pii-type=\"IL_BANK_ACCOUNT\" data-encrypted=\"HueBpx0opEwAfkflHGt6tcr98MvCdYjb7kscFwX0Lm8=\" title=\"PII Type: IL_BANK_ACCOUNT (encrypted) — click to reveal\" class=\"inline-flex items-center px-1.5 py-0.5 mx-0.5 rounded text-xs font-medium border bg-muted text-muted-foregrou…

Note: Content was truncated.

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 [Bug] Agent mishandles branch creation, uses worktree instead of checkout and performs unsafe resets