Skip to main content
The user describes what to locate in the codebase; the agent runs grep and glob with safe caps. Give your agent two zero-config primitives — grep to find text, glob to find files — bounded, path-safe, and ripgrep-accelerated when available.

Quick Start

1

Agent-Centric Usage

Attach grep and glob to an agent — no configuration needed.
2

Direct Usage

Call both tools directly outside an agent.

How It Works


Configuration Options

grep Parameters

Returns: path:line: matched line entries (newline-joined), hard-capped with a truncation hint. Returns "No matches found." or "Error: …" on error.

glob Parameters

Returns: Newline-joined workspace-relative file paths, sorted by modification time (newest first), hard-capped with a truncation hint. Returns "No files found." on empty results.

Common Patterns

Case-insensitive search across .py files only:
Recursive TypeScript file listing:
Bounded search in a large repo:

Choosing Between grep, glob, and AST-Grep


Best Practices

ripgrep is an optional accelerator — the tools always work without it. Install for significantly faster searches on large codebases.
Both tools default to a cap of 100 results. Use glob and path to narrow the search before hitting the limit.
When results are capped, the last line contains a truncation hint like:
Agents can detect this string and automatically refine their query.
Both tools automatically respect .gitignore (including negation patterns like !keep.log and directory-only rules like build/). Noise directories like .git, node_modules, __pycache__, and .venv are always skipped.

User Interaction Flow

A typical agent conversation using grep and glob:

AST-Grep Tools

Structural code search and rewrite using AST patterns

File Tools

File system operations and management utilities