Repository avatar
Search & Data Extraction
v1.4.0
active

ivygrep

io.github.bvolpato/ivygrep

Local code search and task context packs for coding agents

Documentation

ivygrep logo

grep finds what you typed. ivygrep finds what you meant.
Local search for code and notes, and context packs for coding agents.

Latest release CI Security MIT license

Website · User guide · Coding agents · Benchmarks · Architecture · Discussions

ig answers "which thread count does it pick by default" on the ripgrep source with the function default_thread_count. The keyword thread matches 201 lines in 20 files.

Recorded with ig 1.3.6 on the ripgrep 16.0.0 source.

What it does

  • Answers questions about code. Ask in plain words and get ranked files, line numbers, and previews. Exact text, symbols, references, and callers use the same index.
  • Feeds coding agents. ig context builds one evidence pack for a task: the code, its definitions, callers, dependencies, and tests, within a token budget. Claude Code, Codex, Cursor, Gemini CLI, OpenCode, and other MCP clients can call it.
  • Stays on your machine. Files, queries, embeddings, and indexes are local. There is no account and no telemetry. The default model downloads 33.5 MB of pinned assets on first use and runs on CPU.
  • Keeps up. A daemon watches your files and updates what changed. Git worktrees share one base index.

ivygrep runs on macOS, Linux, and Windows. It supports 45 language and file types.

Install

PlatformCommand
macOS, Linuxbrew install bvolpato/tap/ivygrep
macOS, Linuxcurl -fsSL https://raw.githubusercontent.com/bvolpato/ivygrep/main/install.sh | sh
Windowswinget install --id BrunoVolpato.ivygrep --exact
Windowsirm https://raw.githubusercontent.com/bvolpato/ivygrep/main/install.ps1 | iex

Every method installs one binary, ig. The installers select a compatible build and verify its SHA-256 checksum. WinGet can lag GitHub releases. The guide covers builds, source installation, upgrades, and removal.

Start in one minute

Open a repository and ask a question. The first query builds the index.

cd your-project
ig "where is refresh token rotated?"

Build context for a task. On a branch, --since main adds your changes.

ig context "fix refresh-token races" --since main --budget 8000

Connect your coding agent.

ig agent install claude     # or: codex, cursor

Search

You wantCommand
Code by intentig "where is authentication handled?"
An exact stringig --literal "handleAuth"
A definitionig --symbol calculate_tax
Every use of a symbolig --refs calculate_tax
Functions that call itig --callers calculate_tax
One directory or fileig "database migrations" src/api/
One languageig "retry policy" --type rust
A match without a termig "settings NOT render"
All indexed projectsig --all "retry policy"
A terminal UIig --interactive
A Web UIig --web

Use -n to limit result files, -C for context lines, --include and --exclude for path globs, and --json for scripts. Use --hash to search without a model download. ig --help lists every option, and the user guide explains the rules.

Build context for a task

ig context "fix refresh-token races" --since main --budget 8000
pytest 2>&1 | ig context -

A context pack starts from your task, from paths in pasted text, and from your Git changes. It adds definitions, callers, references, dependencies, dependents, tests, configuration, and docs. It stops at the token budget.

Each item names its file and lines, its role, and the reason for its selection. This one is from a pack for ripgrep:

### 1. crates/ignore/src/gitignore.rs:986-1014 [primary, test]
Why: rank 1 for primary retrieval; rank 2 for anchor test retrieval.
Signals: lexical, neural, semantic.

A pack is evidence to read. It does not generate an answer or change files. See how --since selects changes.

Connect a coding agent

The setup command keeps your existing configuration, verifies the MCP handshake, and runs a search. Restart an open client afterward.

ig agent install claude
ig agent install codex
ig agent install cursor
ig agent doctor

Plugins for Claude Code and Codex also install a task-context skill:

claude plugin marketplace add bvolpato/ivygrep
claude plugin install ivygrep@ivygrep

codex plugin marketplace add bvolpato/ivygrep
codex plugin add ivygrep@ivygrep
Manual MCP setup
claude mcp add -s user ig -- ig --mcp
codex mcp add ig -- ig --mcp
gemini mcp add --scope user --transport stdio ig ig --mcp

Cursor, in .cursor/mcp.json:

{"mcpServers":{"ig":{"type": "stdio", "command": "ig", "args": ["--mcp"]}}}

OpenCode, in opencode.json:

{"mcp":{"ig":{"type": "local", "command": ["ig", "--mcp"], "enabled": true}}}

Add this to your agent instructions:

Use ivygrep before broad filesystem scans. Pass the absolute active worktree path.
Use natural-language queries for concepts and literal=true for identifiers.
For implementation, request output=context_pack with budget_tokens=8000.

Guides: Claude Code, Codex, Cursor, Gemini CLI, OpenCode, MCP.

Search notes

Index a notes directory once. The watcher keeps it current.

ig --add ~/notes --wait-for-enhancement
ig "what did we decide about cache invalidation?" ~/notes

Privacy

DataLeaves your machine
Source, notes, queries, and resultsNo
Embeddings and indexesNo
TelemetryNone exists
The default modelOne download of pinned assets. --hash avoids it.
The Web UIBinds to loopback by default and requires a session token

Read Web UI security before you bind the Web UI to another address. Report vulnerabilities through a private security advisory.

How it works

  1. A Git-aware walker finds changed and indexable files.
  2. Tree-sitter splits 24 languages into functions and classes. Other files use heuristic or text chunks.
  3. SQLite stores metadata and relationships, Tantivy stores keywords, and USearch stores vectors.
  4. Keyword and exact search work first. Background workers then add hash vectors and neural vectors.
  5. A query runs bounded exact, keyword, symbol, hash, and neural passes, then ranks the files.

Read the architecture for storage, retrieval, worktrees, protocols, and security boundaries.

Measured results

WhatResultScope
Issue text to a fixed fileTop 1: 47%, top 5: 70%30 issues from 10 open source projects, v1.3.5 (method and losses)
Context pack contains a fixed file77%Same issues, 4,172 tokens on average, v1.3.5
Notes retrieval74.9% recall@20MemoryQuest, v1.2.7 (report)
One million chunks6.19 ms warm CLI p95Synthetic corpus, hash-only, v1.2.7 (data, method)

The million-chunk result measures scale and footprint, not retrieval quality or coding-task accuracy. See the dashboard and the cost of the current model under concurrent load.

Get help

ig --status          # workspaces, index health, vector coverage, disk usage
ig --doctor          # diagnose index, daemon, watcher, and model
ig --doctor --fix    # repair a broken or stale index
ig hardware          # installed build and the best build for this machine

The guide has a troubleshooting section. Ask questions in Discussions.

Contribute

Start with a good first issue. Read CONTRIBUTING.md and run ./test.sh --quick.

MIT licensed. Maintained by Bruno Volpato.

MCPB
https://github.com/bvolpato/ivygrep/releases/download/v1.4.0/ivygrep-mcp-v1.4.0.mcpb
Install Command
# mcpb: https://github.com/bvolpato/ivygrep/releases/download/v1.4.0/ivygrep-mcp-v1.4.0.mcpb