claude-code - 💡(How to fix) Fix Explore agent ignores custom CLAUDE.md rules about tool preferences (uses grep instead of rg)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Code Example

- 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
RAW_BUFFERClick to expand / collapse

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
  • grep does not respect .gitignore, potentially scanning node_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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Explore agent ignores custom CLAUDE.md rules about tool preferences (uses grep instead of rg)