Explore agent ignores custom CLAUDE.md rules about tool preferences (uses grep instead of rg)
Problem
The Explore agent (subagent_type=Explore) uses grep -ri for searching, completely ignoring user-defined rules in CLAUDE.md and .claude/rules/ that explicitly require rg or ugrep --ignore-files instead.
Environment
Rules are clearly defined in CLAUDE.md and project rule files:
- Search file contents → Use ugrep --ignore-files or rg in Bash. grep/ack are forbidden.
- Bash limited to: which/git/gh/uv/rg/bfs/ugrep and other system commands
Reproduction
When the main agent spawns an Explore agent via Agent(subagent_type=Explore, ...), the Explore agent internally uses grep -ri for searches, completely ignoring the user's configured rules.
Expected Behavior
The Explore agent should inherit the main agent's CLAUDE.md and .claude/rules/ configuration, using rg or ugrep instead of grep.
Impact
- Violates user-defined tool preferences explicitly set in project rules
grepdoes not respect.gitignore, potentially scanningnode_modules/and other large directories, wasting resources- Users must repeatedly correct this behavior, reducing efficiency
- Undermines the purpose of having configurable rules if subagents ignore them
Suggestion
All subagents (including Explore, Plan, code-reviewer, etc.) should read and respect the project's CLAUDE.md and .claude/rules/ configuration, especially tool preference settings. If a user has banned grep in favor of rg, that preference should propagate to all spawned agents.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗