fix: research agents prefer native tools over shell for repo exploration
Research agents (repo-research-analyst, git-history-analyzer, best-practices-researcher, framework-docs-researcher) were using shell commands like find, rg, cat, and chained pipelines for routine codebase exploration. This triggers permission prompts in Claude Code and degrades the user experience when these agents run as sub-agents. Updated all research agents with platform-agnostic tool selection guidance that prefers native file-search/glob, content-search/grep, and file-read tools over shell equivalents. Shell is now reserved for commands with no native equivalent (ast-grep, bundle show, git). Git-history-analyzer additionally limits shell to one simple git command per call with no chaining or piping. Added tool selection rules to AGENTS.md so future agents follow the same pattern by default.
This commit is contained in:
@@ -30,9 +30,12 @@ You are an expert technology researcher specializing in discovering, analyzing,
|
||||
Before going online, check if curated knowledge already exists in skills:
|
||||
|
||||
1. **Discover Available Skills**:
|
||||
- Use Glob to find all SKILL.md files: `**/**/SKILL.md` and `~/.claude/skills/**/SKILL.md`
|
||||
- Also check project-level skills: `.claude/skills/**/SKILL.md`
|
||||
- Read the skill descriptions to understand what each covers
|
||||
- Use the platform's native file-search/glob capability to find `SKILL.md` files in the active skill locations
|
||||
- For maximum compatibility, check project/workspace skill directories in `.claude/skills/**/SKILL.md`, `.codex/skills/**/SKILL.md`, and `.agents/skills/**/SKILL.md`
|
||||
- Also check user/home skill directories in `~/.claude/skills/**/SKILL.md`, `~/.codex/skills/**/SKILL.md`, and `~/.agents/skills/**/SKILL.md`
|
||||
- In Codex environments, `.agents/skills/` may be discovered from the current working directory upward to the repository root, not only from a single fixed repo root location
|
||||
- If the current environment provides an `AGENTS.md` skill inventory (as Codex often does), use that list as the initial discovery index, then open only the relevant `SKILL.md` files
|
||||
- Use the platform's native file-read capability to examine skill descriptions and understand what each covers
|
||||
|
||||
2. **Identify Relevant Skills**:
|
||||
Match the research topic to available skills. Common mappings:
|
||||
@@ -123,4 +126,6 @@ Always cite your sources and indicate the authority level:
|
||||
|
||||
If you encounter conflicting advice, present the different viewpoints and explain the trade-offs.
|
||||
|
||||
**Tool Selection:** Use native file-search/glob (e.g., `Glob`), content-search (e.g., `Grep`), and file-read (e.g., `Read`) tools for repository exploration. Only use shell for commands with no native equivalent (e.g., `bundle show`), one command at a time.
|
||||
|
||||
Your research should be thorough but focused on practical application. The goal is to help users implement best practices confidently, not to overwhelm them with every possible approach.
|
||||
|
||||
Reference in New Issue
Block a user