Skip to main content
WarpGrep is a subagent your coding agent calls as a tool. The flow:
  1. Your agent (Claude, Codex, GPT-4o, Gemini) needs to find code
  2. It calls WarpGrep with a natural language query
  3. WarpGrep searches in its own isolated context window, multiple turns, 8 parallel tool calls per turn
  4. It returns only the relevant file/line-range spans
  5. Your agent continues with clean context
The parent agent never sees the intermediate search steps, the rejected files, or the dead-end greps. On SWE-Bench Pro, this makes Opus 15.6% cheaper and 28% faster than searching on its own. SDK adapters for Anthropic, OpenAI, Vercel AI SDK, and Gemini.
See complete agent examples for each framework — copy-paste ready.

Quick Start

Platform Examples

Your sandbox needs ripgrep (rg) installed for the grep function. Most sandbox providers support apt-get install ripgrep (Ubuntu/Debian). On Amazon Linux 2023 (Vercel Sandbox), download the static binary instead.

Configuration

Default Excludes

WarpGrep excludes common non-source directories by default:
  • Dependencies: node_modules, bower_components, .pnpm, .yarn, vendor, Pods, .bundle
  • Build output: dist, build, .next, .nuxt, out, target, .output
  • Python: __pycache__, .pytest_cache, .mypy_cache, .ruff_cache, .venv, venv, site-packages
  • Version control: .git, .svn, .hg
  • Lock files, minified files, source maps, and common binary formats
Pass excludes to override these defaults. Your list replaces the defaults entirely — it does not merge with them.

Searching node_modules

By default, node_modules is excluded. To search inside dependencies (e.g., debugging a library or finding how a package implements something), pass an empty excludes list:
WarpGrep runs faster with less context to search over. Only include node_modules in your search when you need it. See the node_modules example.

GitHub Search Options

createGitHubSearchTool() accepts: Search public GitHub repositories. No local clone or ripgrep needed — Morph indexes the repo remotely. See the GitHub search example.

Client API

Agent Tool

Each SDK adapter provides createGitHubSearchTool():
Usage is identical to the Quick Start above — pass githubTool in your tools array.
GitHub search returns the same WarpGrepResult format as local search.

Remote Execution (Sandboxes)

When your code lives in a remote sandbox (E2B, Modal, Daytona, Docker), provide three functions that execute commands remotely. The SDK handles all parsing.
Replace sandbox.run(...) with your provider’s exec method (E2B’s sandbox.commands.run, Modal’s sandbox.exec, etc).
The SDK parses the raw output for you:
  • grep expects ripgrep format (path:line:content) with -C 1 context lines
  • read expects raw file content (SDK adds line numbers)
  • listDir expects one path per line (from find command)
Your sandbox needs ripgrep (rg) installed. Most providers support apt-get install ripgrep.

API Reference

Input (WarpGrepInput):
Returns (WarpGrepResult):
Tool methods (when using as agent tool):

Error Handling

Type Exports