You'll notice
Bash-tool permission logic parses git commands more carefully before approving them
What
When Claude Code decides whether a git command in the Bash tool can be auto-approved, it now parses the command line more carefully. New internal helpers correctly:
- split combined short options (like
-abcmeaning-a -b -c) - extract
--work-treeand-Cvalues, which change which directory a git command operates on - recognize glob bracket-expression syntax, including character classes with an embedded
] - exclude commands that use
GIT_CONFIGor other environment-based redirection, since those could make it unsafe to reason about the command just by looking at its text
Why
Git commands can change their target directory or configuration through options and environment variables in ways that are easy to misparse. Handling these cases correctly avoids auto-approving a git command whose real effect isn't what a simple text scan would suggest.