[MODEL] agent tools+disallowedTools incompatibility
Preflight Checklist
- [x] I have searched existing issues for similar behavior reports
- [x] This report does NOT contain sensitive information (API keys, passwords, etc.)
Type of Behavior Issue
Claude ignored my instructions or configuration
What You Asked Claude to Do
I think maybe the behavior is correct, but it is confusing.
When using a sub-agent I want to do have very controlled the commands that can be executed. So, I am trying things like:
tools:
- Edit
- Write(.temp/**)
- Bash
disallowedTools:
- Bash(git *)
That means, whatever bash command but git related things. This is not working, as soon as I use disallowedTools with the tool bash. bash tool is absolutly disabled .
Is this the proper behavior? I think the point is
My point: " I want to use bash commands but git"
but Claude Code interprets this as: "you told me to use whatever command but then you set limitations.
If the expected behavior is the expected... not sure if this is explained in some way anywyhere.
Other things I tried that neither worked:
tools:
- Edit
- Write(.temp/**)
- Bash(.claude/scripts/*)
disallowedTools:
- Bash(git *)
this again disables everything. I guess Claude Code interprets as, why you tell me to disable git commands if you only allowed some scripts. And disables everything.
This example, I see more clear that from a reading point is clear, but functionally makes maybe nonsense.
### What Claude Actually Did
if you allow the tool Bash, but then you use disallowedTools with whatever Bash expression, it disables to use Bash.
### Expected Behavior
if you have bash on allowed and disallowed. You can use the bash in the way of (+allowed-dissallowed expressions)
### Files Affected
```shell
N/A
Permission Mode
I don't know / Not sure
Can You Reproduce This?
Yes, every time with the same prompt
Steps to Reproduce
N/A
Claude Model
Sonnet
Relevant Conversation
N/A
Impact
Low - Minor inconvenience
Claude Code Version
2.1.12
Platform
Anthropic API
Additional Context
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗