[BUG] Agents don't respect CLAUDE.md tool usage rules - use bash commands instead of specialized tools
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?
When using the Task tool to launch specialized agents, the agents do not consistently follow the tool usage rules defined in the user's CLAUDE.md configuration file.
Expected Behavior:
Agents launched via the Task tool should follow all rules defined in CLAUDE.md, specifically:
- Use Glob instead of bash find
- Use Grep instead of bash grep/rg
- Use Read instead of bash cat/head/tail
- Use Edit instead of bash sed/awk
The CLAUDE.md explicitly states: "This rule applies to ALL agents and ALL situations without exception"
Actual Behavior:
Agents use bash commands like find which then trigger approval requests, even though:
- The specialized tools (Glob, Grep, Read, Edit) don't require approval
- The CLAUDE.md clearly prohibits using these bash commands
- The rules explicitly state they apply to all agents
Impact:
- Agents require unnecessary user approvals
- Inconsistent behavior between main conversation and agent tasks
- Reduced efficiency when agents are used
- User configuration rules are not respected by agents
Reproduction:
- Add tool usage rules to CLAUDE.md prohibiting bash find/grep/cat/etc
- Launch any agent using the Task tool
- Agent uses bash commands instead of specialized tools
- System requests approval despite rules
Suggested Fix:
Ensure all agents inherit and respect CLAUDE.md configuration rules, particularly tool usage policies.
What Should Happen?
Agents launched via the Task tool should follow all rules defined in CLAUDE.md, specifically:
- Use Glob instead of bash find
- Use Grep instead of bash grep/rg
- Use Read instead of bash cat/head/tail
- Use Edit instead of bash sed/awk
Error Messages/Logs
Steps to Reproduce
Reproduction:
- Add tool usage rules to CLAUDE.md prohibiting bash find/grep/cat/etc
- Launch any agent using the Task tool
- Agent uses bash commands instead of specialized tools
- System requests approval despite rules
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.24
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗