# ripwire

> A ranked call-graph map of your repo for coding agents, plus checks on what the agent changed

- Category: Retrieval & Knowledge (RAG) / Code Indexing & Search
- Language: C++
- Licence: Apache-2.0
- Repository: https://github.com/redhat-et/ripwire
- Canonical page: https://ai-tldr.dev/tools/ripwire/
- Updated: 2026-09-21

## In short

ripwire bills itself as "the ripgrep of AI context": a single self-contained binary that reads a source tree and writes a ranked symbol map to standard output, sized for a coding agent to read. It sits in the Code Indexing & Search category of the Retrieval & Knowledge (RAG) tools and is open-source, written in C++ and licensed Apache-2.0.

## Overview

ripwire bills itself as "the ripgrep of AI context": a single self-contained binary that reads a source tree and writes a ranked symbol map to standard output, sized for a coding agent to read. Instead of grepping and opening whole files, the agent asks one question — where is this handled, who calls this function, is it safe to change, which tests reach this diff — and gets the relevant symbols, their callers, the change risks and the tests back in one answer. It is open source under the Apache-2.0 licence, published in the redhat-et GitHub organisation.

Under the hood it crawls the tree, extracts symbols with tree-sitter, resolves references into a call graph, ranks it with Personalized PageRank and streams a deterministic, minified XML map. There is no API key, no embeddings, no index server and no daemon; every dependency, including 25 tree-sitter grammars, is vendored in the source tree, so it builds and runs offline. The first call on a tree parses it and later calls read a cache, and two runs over the same tree are byte-identical.

The second half of the tool checks the edit rather than the lookup: blast radius, the tests that reach a change, a quality panel that reports only what got worse, forgotten co-changes from git history, and a check on whether a function's contract changed. The project's "honesty contract" labels any count it cannot prove is complete as a floor, discloses every truncation, and treats a zero as "none found" rather than "none exists". A `--html` mode renders the ranked graph as one self-contained HTML page, with dashed edges marking calls the resolver could not pin to a single target.

## What it does

- Ranked, deterministic call-graph map built with tree-sitter and Personalized PageRank, emitted as compact XML sized for an agent
- Task lenses such as `--for`, `--pack-task` and `--help-task` that return what to touch for a change described in words
- Navigation verbs: `--callers`, `--callees`, `--uses`, `--impact` (blast radius), `--from-trace` for stack traces, and `--test-gate` for the tests a change must run
- Change review: `--quality-delta`, `--edit-check`, `--situ`, `--pr-context` and `--merge-scout`, drawing on git history for churn and co-change
- Optional stdio MCP server (`ripwire --mcp`) exposing 33 verbs, including span-addressed edit verbs with staleness and ambiguity refusal
- Seventeen task-shaped agent skills, and `ripwire wrap` recipes for Claude Code, Codex, Cursor, Windsurf, Gemini, opencode, aider and others
- 25 vendored grammars covering languages including Rust, C++, Python, Go, TypeScript, Java, Kotlin, Elixir, Dart and CUDA, plus Markdown, JSON, TOML and YAML
- `--scan-skills` security scanner for agent skill files, run automatically before `wrap` prints a recipe

## Getting started

Install the prebuilt binary (macOS on Apple silicon, Linux arm64/x86-64 for RHEL 8+) or build from source with CMake 3.24+ and a C++23 compiler. The installer also activates the agent skills for every agent it detects, so most people only need to tell their agent: "Use ripwire on this repo."

1. Install the prebuilt binary

   The installer downloads the latest GitHub release, verifies its SHA-256, installs to ~/.local/bin and stages the agent skills. It does not edit your shell profile.

```bash
RIPWIRE_REPO=redhat-et/ripwire bash -c "$(curl -fsSL https://raw.githubusercontent.com/redhat-et/ripwire/main/scripts/install.sh)"
export PATH="$HOME/.local/bin:$PATH"
ripwire --version
```

2. Or build from source

   Every dependency is vendored, so the build completes with the network off. Use a Release tree for the fast binary.

```bash
git clone https://github.com/redhat-et/ripwire.git
cd ripwire
cmake -S . -B build-release -DCMAKE_BUILD_TYPE=Release
cmake --build build-release -j
```

3. Map a repository and ask it questions

   Start with the ranked map under a token budget, then ask task-shaped questions. Output is compact XML meant for your agent. If the first call looks wrong, `ripwire . --doctor` checks the binary, grammars, cache and git identity.

```bash
cd your-repo
ripwire . --max-tokens=3000                        # the ranked map
ripwire . --for="incremental cache invalidation"   # what to touch, ranked
ripwire . --callers=someFunction                   # who calls it
ripwire . --test-gate                              # which tests must run
```

4. Render the map as HTML

   `--html` writes one self-contained HTML file with no server or CDN; `--color-by` picks the initial lens (lang, community, cx, churn or tested) and the page keeps a live selector.

```bash
ripwire path/to/django/db/migrations --rank-by=rrf --top-k=120 --color-by=cx --html=map.html
```

5. Wire it into your agent (MCP optional)

   The CLI is the recommended interface. `ripwire wrap` prints, but never applies, the setup recipe for your client; the MCP server is a plain stdio process for clients that want it.

```text
ripwire wrap claude     # or: ripwire wrap --all

# any MCP client:
{
  "mcpServers": {
    "ripwire": { "command": "ripwire", "args": ["--mcp"] }
  }
}
```

## When to use it

- Reach for it when a coding agent burns tokens grepping and reading whole files to orient itself in a large repository
- Reach for it before a refactor to see a symbol's callers, use sites and blast radius in one call
- Reach for it after an edit to find the tests that must run and what the change made worse in the quality panel
- Reach for it when code context must stay fully local and offline, with no embeddings service or index server

## Version history

- 2026-09-21 v0.6.2: Calls that live outside any named function now have a caller, the compact output legend became the default, and native Windows x64 builds with both clang-cl and MSVC.
