Categorize read-only git commands separately in “Yes, and don't ask again”
Status Fixed / completed
Maintainer reply ✓ Yes — bcherny
Activity 3 comments · opened Feb 27, 2025 · closed May 7, 2025
💡 Likely answer: A maintainer (bcherny, collaborator)
responded on this thread — see the highlighted reply below.
I just chose “Yes, and don't ask again for git branch commands” the first time Claude Code asked to perform a git branch command.
But really the option I'd like is “don't ask again for _read-only_ git branch commands” (or read-only git commands in general).
The one I was approving was git branch --show-current, which is of course read-only. Likewise, I've previously said “don't ask again” for git diff and git log.
But some git branch commands modify git information, e.g. delete or overwrite or rename branches. I'd like to review such actions individually, while not being asked to confirm simple requests for git information.
3 Comments
I can imagine that this is difficult to solve programmatically, but I agree with the sentiment.
This is exacerbated by the fact that I have found Claude Code somewhat reckless with its git operations, and if I hadn't made a local copy of my repo first, I'd be in trouble due to lost files. (I turn to it when I need help fixing commits, so I'm usually asking it to do hard things.) Next time I'll give it a git cheat-sheet as part of its prompt.
This should be feeling better with newer versions of Claude Code.
claude updateor restart to update, and please open a new issue if you're still hitting this.This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.