[BUG] Claude code cannot run certain bash commands on MacOS
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?
Host: MacOS Sequoia 15.7 (24G222)
Claude Version: 2.0.9 (Claude Code)
I'm telling Claude the following prompt to run some make goals in the terminal.
When running commands like this one: 'cd modules/surrealdb && eval "$(gvm 1.24.7 --arch=arm64)" && make pre-commit test', never ask. You're allowed to do so autonomously
Those make goals simply calls the go toolchain to run a pre-commit stage ("go mod tidy" + "golangci-lint") and run the tests ("gotestsum"), in that order. And its response is:
Bash(cd modules/surrealdb && eval "$(gvm 1.24.7 --arch=arm64)" && make pre-commit test) timeout: 10m 0s
⎿ Interrupted · What should Claude do instead?
I asked it what's the issue?
why can't you run that?
And it responded the following:
I apologize for the confusion. I'm not intentionally asking for permission - I'm calling the Bash tool directly each time. The system seems to be intercepting my tool calls and asking you for approval. This appears to be a safety
mechanism in the environment that I cannot bypass.
Let me check if there's something specific about how I'm structuring the command that's triggering this approval prompt.
I told it again that it is allowed to call bash, but it still cannot run that command autonomously, as it always ask for permission:
│ │
│ cd modules/redis && eval "$(gvm 1.24.7 --arch=arm64)" && make pre-commit test │
│ Run pre-commit and tests for redis module │
│ │
│ Do you want to proceed? │
│ ❯ 1. Yes │
│ 2. No, and tell Claude what to do differently (esc)
What Should Happen?
Claude should have prompted for permission once, apply that to the settings.local.json file (this is happening), and run the commands in autonomous mode, but it still prompts.
Error Messages/Logs
Steps to Reproduce
- Clone https://github.com/testcontainers/testcontainers-go/
- Run "claude" in a shell in the tc-go directory
- tell claude to install gvm to allow setting the right Go version: "Use https://github.com/andrewkroh/gvm to install go"
- 4. tell claude to always use
eval "$(gvm 1.24.7 --arch=arm64)"before ANY Go command (go build, go test, make, etc.)
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Bash command │
│ │
│ eval "$(gvm 1.24.7 --arch=arm64)" │
│ Set Go version to 1.24.7 using gvm eval │
│ │
│ Do you want to proceed? │
│ ❯ 1. Yes │
│ 2. No, and tell Claude what to do differently (esc) │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.9
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
My settings.local.json file:
{
"permissions": {
"allow": [
"Bash(cd modules:*)",
"Bash(git add:*)",
"Bash(git commit:*)",
"Bash(git checkout:*)",
"Bash(git push:*)",
"Bash(git pull:*)",
"Bash(gh pr create:*)",
"Bash(gh pr list:*)",
"Bash(go test:*)",
"Bash(make test:*)",
"Bash(make pre-commit:*)",
"Bash(make pre-commit test:*)",
"WebFetch(domain:github.com)",
"Bash(go:*)",
"Bash(make test-unit:*)",
"Bash(gotestsum:*)",
"Bash(awk:*)"
],
"deny": [],
"ask": []
}
}This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗