[BUG] "'/^??/" in Bash(git status --porcelain | awk '/^??/ {print $2}') is interpreted as a path outside the project dir
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
At one point during its flow, Claude Code wanted to run:
Bash(git status --porcelain | awk '/^??/ {print $2}')
But it interpreted /^??/ as some malformed-looking path outside the project directory and asked for some Read(...) permission that I forgot.
Looks like the parser/grammar for finding/interpreting paths in the Bash command is buggy and broken.
What Should Happen?
CC shouldn't ask for Read(...) permission to a weird looking path due to the presence of /^??/ as an argument to awk in the Bash(git status --porcelain | awk '/^??/ {print $2}') command.
Error Messages/Logs
Steps to Reproduce
I can't say for sure, but create a brand new project and instruct CC to run git status --porcelain | awk '/^??/ {print $2}' and it will ask you for permission.
Ensure Sonnet 4.5 is the selected model.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.30
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Other
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗