[BUG] Subagent with declared Bash tool should not ask user for permission
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?
The subagent has tools: Bash declared in its definition, but when it attempts to execute a shell script, it still asks the user for permission instead of running autonomously. The tools declaration should implicitly grant the subagent permission to use those tools without user confirmation.
What Should Happen?
The subagent should execute the shell script without asking the user for permission, since tools: Bash is explicitly declared in its definition.
Error Messages/Logs
Steps to Reproduce
Directory structure:
.claude/
├── agents/
│ └── test.md
└── scripts/
└── test.sh
.claude/agents/test.md:
---
name: test
description: test
tools: Bash
---
Execute ~/work/tmp/cc-agent-test/.claude/scripts/test.sh
.claude/scripts/test.sh:
echo "Hello World!"
Steps:
- Set up the above directory structure and files
- Start a Claude Code session in the project directory
- Prompt Claude:
@"test (agent)" - The subagent attempts to execute
test.shvia Bash
Result: The subagent asks the user for permission before executing the shell script instead of running it autonomously.
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.86 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗