Agent skill
ripgrep
Efficient text search using ripgrep (rg) with one-shot patterns that minimize iterations by getting files, line numbers, and context in a single call
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/ripgrep
SKILL.md
ripgrep: Powerful, one-shot text search
Default Strategy
For content search: use Bash(rg) with -e 'pattern' -n -C 2 for one-shot results.
This gives files, line numbers, and context in a single call - minimizes iterations and context usage.
Always prefer getting line numbers and surrounding context over multiple search attempts.
Tool Selection
Grep tool (built on ripgrep) - Use for structured searches:
- Basic pattern matching with structured output
- File type filtering with
typeparameter - When special flags like
-F,-v,-w, or pipe composition are not needed - Handles 95% of search needs
Bash(rg) - Use for one-shot searches needing special flags or composition:
- Fixed string search (
-F) - Invert match (
-v) - Word boundaries (
-w) - Context lines with patterns (
-n -C 2) - Pipe composition (
| head,| wc -l,| sort) - Default choice for efficient one-shot results
Glob tool - Use for file name/path matching only (not content search)
When to Load Detailed Reference
Load ripgrep guide when needing:
- One-shot search pattern templates
- Effective flag combinations for complex searches
- Pipe composition patterns
- File type filters reference (
-tflags) - Pattern syntax examples
- Translation between Grep tool and rg commands
- Performance optimization for large result sets
The guide focuses on practical patterns for getting targeted results in minimal calls.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?