[BUG] Fails to confirm git actions execute sucessfuly before continuing

Resolved 💬 3 comments Opened Aug 14, 2025 by jeffsf Closed Aug 16, 2025

Environment

  • Platform (select one):
  • [ X ] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 1.0.81 (Claude Code)
  • Operating System: macOS 15.5
  • Terminal: iTerm2

Bug Description

master is checked out in another worktree. Several times Claude has assumed git checkout master has worked, resulted in corrupting branches. Not only should git actions be confirmed to succeed, but the safer way to checkout a new branch from an existing reference would be git branch <new> <reference>

⏺ I see the first commit still shows the artifacts as Added. Let me completely redo this more carefully. I need to create a clean branch
  from master:

⏺ Bash(git checkout master)
  ⎿  Error: fatal: 'master' is already used by worktree at '/Users/jeff/build/ch552g_mini_keyboard-master'

⏺ Bash(git branch -D retry-2025-08)
  ⎿  No (tell Claude what to do differently)

Even after I removed the conflicting worktree from master, Claude deleted the active branch and I had to instruct it to recover it

⏺ Bash(git branch -D retry-2025-08)
  ⎿  Deleted branch retry-2025-08 (was 7298339).

Definitely needs some lessons in using git safely

Steps to Reproduce

  • Checkout branchX in a worktree
  • Ask to rebase onto branchX
  • Watch Claude make a mess of things

Expected Behavior

Rebased onto master without checking out master

Actual Behavior

Failed to checkout so just put changes on HEAD

Deleted active branch

Additional Context

<!-- Add any other context about the problem here, such as screenshots, logs, etc. -->

View original on GitHub ↗

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