Preflight Checklist
What's Wrong?
When using the Task tool with subagent_type: "Bash" and run_in_background: true, all Bash commands are auto-denied without prompting the user. This is especially counterintuitive because the "Bash" agent type is described as a "Command execution specialist for running bash commands" — yet it cannot execute any bash commands when running in the background.
Actual Behavior
- All Bash commands are silently auto-denied
- The error message says "Permission to use Bash has been denied"
- No prompt is shown to the user
- The agent cannot accomplish anything and returns a failure message
Context
I was using 4 parallel background Bash agents to collect GitHub PR review comments via gh api. All 4 agents failed identically because they could not run any Bash commands.
// All 4 of these agents failed
Task({
subagent_type: "Bash",
run_in_background: true,
prompt: "Run this python script that calls gh api..."
})
Environment
- Claude Code Version: 2.1.39
- Platform: Linux (WSL2)
- OS: Linux 5.15.146.1-microsoft-standard-WSL2
Workaround
Related issue #18172 suggests using PreToolUse hooks to override the auto-deny behavior, but this should not be necessary for an agent type whose only purpose is running Bash commands.
Related Issues
What Should Happen?
Expected Behavior
A "Bash" agent type should be able to execute bash commands — that is its entire purpose. At minimum, one of the following should apply:
- Background Bash agents inherit the permissions already granted in the parent session
- Background Bash agents prompt the user for permission (forwarding the prompt to the foreground)
- The
subagent_type: "Bash" agent has implicit Bash tool permission, since that is its sole capability
Error Messages/Logs
Steps to Reproduce
Steps to Reproduce
- Call the
Task tool with:
subagent_type: "Bash"
run_in_background: true
- A prompt that instructs the agent to run a bash command (e.g.,
gh api ... or python3 ...)
- The agent attempts to use the
Bash tool
- The command is auto-denied with:
"Permission to use Bash has been denied"
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
No response
Claude Code Version
2.1.68
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
WSL (Windows Subsystem for Linux)
Additional Information
No response
Preflight Checklist
What's Wrong?
When using the
Tasktool withsubagent_type: "Bash"andrun_in_background: true, all Bash commands are auto-denied without prompting the user. This is especially counterintuitive because the "Bash" agent type is described as a "Command execution specialist for running bash commands" — yet it cannot execute any bash commands when running in the background.Actual Behavior
Context
I was using 4 parallel background Bash agents to collect GitHub PR review comments via
gh api. All 4 agents failed identically because they could not run any Bash commands.Environment
Workaround
Related issue #18172 suggests using PreToolUse hooks to override the auto-deny behavior, but this should not be necessary for an agent type whose only purpose is running Bash commands.
Related Issues
What Should Happen?
Expected Behavior
A "Bash" agent type should be able to execute bash commands — that is its entire purpose. At minimum, one of the following should apply:
subagent_type: "Bash"agent has implicit Bash tool permission, since that is its sole capabilityError Messages/Logs
Steps to Reproduce
Steps to Reproduce
Tasktool with:subagent_type: "Bash"run_in_background: truegh api ...orpython3 ...)Bashtool"Permission to use Bash has been denied"Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
No response
Claude Code Version
2.1.68
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
WSL (Windows Subsystem for Linux)
Additional Information
No response