Skip to content

grep tool: prefer ripgrep (rg) when available #19

Description

@stefanthearchitect

Context

The grep tool shells out to grep -rEIn (internal/tools/exec.go, grepTool.Execute). ripgrep (rg) is dramatically faster on large repos and respects .gitignore by default, which usually matches what a coding agent wants to search.

The task

When rg is on PATH, use it; otherwise fall back to the current grep invocation unchanged. Keep the tool's output shape (path:line:match) identical so nothing downstream changes.

Notes / constraints

  • Fallback must be exact — a machine without rg behaves exactly as today.
  • Keep it project-agnostic: detect the binary, don't assume a repo type.

Acceptance

  • With rg present, searches use it; output format unchanged.
  • Without it, behavior is byte-identical to now.
  • Tests for both paths. Coverage ≥90%.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions