ripwire
CLAUDE.md2.4k starsChanged 3 months agoApache-2.0View on GitHub
You are working on ripwire's own source. This file is the orientation an agent needs before it touches this repo; it is not a manual for using the tool. ripwire is a zero-runtime-dependency C++23 CLI. It crawls a codebase, extracts symbols with tree-sitter, resolves references into a call graph, ranks the graph with Personalized PageRank, and streams a deterministic minified XML map to stdout. Around that core sits the verb catalog in docs/COMMANDS.md — navigation, diff-awareness, quality, retrieval — and…
Trending
More talk lately.thin dataabout the whole repository
Who's talking about redhat-et/ripwire
- A Hacker News story“ripwire: ripgrep of AI context (CLI+MCP) giving coding agents a map of any repo”Hacker News · Sep 7, 2026 · 19 points
- @icecodenew.bsky.social“#TIL github.com/redhat-et/ri... > Point it at any repository and your agent gets a ranked, deterministic …”Bluesky · Sep 6, 2026 · 3 likes
- A Hacker News story“The Ripgrep of AI Context”Hacker News · Sep 8, 2026 · 2 points
- @akanoa.bsky.social“On se débarrasse enfin du code! On descend à l'AST et bientôt plus bas. Ce n'est qu'une question de temps. …”Bluesky · Sep 8, 2026 · 1 likes
- @hn100.bsky.social“ripwire: ripgrep of AI context (CLI+MCP) giving coding agents a map of any repo Discussion”Bluesky · Sep 7, 2026 · 1 likes
The biggest 5 of 14 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 14
Talked about on GitHub, Bluesky and Hacker News (14 times).
On GitHub · 9
- Oct 3, 2026agent-skills.github.redhat-et.ripwire: 0.6.2 → 0.6.5 — sudosubin/agents.nix0 reactions
- Oct 1, 2026agent-skills.github.redhat-et.ripwire: init at 0.6.2 — sudosubin/agents.nix0 reactions
- Sep 29, 2026ripwire: 0.6.1 -> 0.6.5 — NixOS/nixpkgs0 reactions · 1 comment
- Sep 24, 2026docs(non-cc): screenshot-lead research batch 13 (plan 0008 row 20) — qte77/ai-agents-research0 reactions
- Sep 21, 2026feat(setup): the ripwire hint names the upstream repository, in setup and both installers (D178) — dimitritholen/tasqx0 reactions · 3 comments
4 more on GitHub
- Sep 20, 2026Candidate: ripwire, a repo map for coding agents — cinjoff/firehorse0 reactions
- Sep 19, 2026ripwire: 0.5.0 -> 0.6.1 — NixOS/nixpkgs0 reactions · 4 comments
- Sep 10, 2026Static analyzer flags prompt-injection example text inside fenced code blocks as CRITICAL — runkids/skillshare0 reactions · 2 comments
- Sep 7, 2026Qualify ripwire as local code-intelligence/context source candidate — TheHalfMoon/Golam0 reactions
On Bluesky · 3
- Sep 6, 2026#TIL github.com/redhat-et/ri... > Point it at any repository and your agent gets a ranked, deterministic call graph — what to touch, what… — @icecodenew.bsky.social3 likes and reposts · 1 reply
- Sep 8, 2026On se débarrasse enfin du code! On descend à l'AST et bientôt plus bas. Ce n'est qu'une question de temps. github.com/redhat-et/ri... — @akanoa.bsky.social1 likes and repost · 1 reply
- Sep 7, 2026ripwire: ripgrep of AI context (CLI+MCP) giving coding agents a map of any repo Discussion — @hn100.bsky.social1 likes and repost
On Hacker News · 2
- Sep 7, 2026ripwire: ripgrep of AI context (CLI+MCP) giving coding agents a map of any repo19 points · 14 comments
- Sep 8, 2026The Ripgrep of AI Context2 points
In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- emitting-outputSkill
- ripwire-repo-mapSkill
- ripwire-before-you-buildSkill
- ripwire-change-checkSkill
- ripwire-find-bugSkill
- ripwire-fresh-eyesSkill
- ripwire-graph-querySkill
- ripwire-handoffSkill
- ripwire-layersSkill
- ripwire-mcpSkill
- ripwire-navigateSkill
- ripwire-opt-remarksSkill
- ripwire-orientSkill
- ripwire-perf-targetSkill
- ripwire-quality-barSkill
- ripwire-reuse-firstSkill
- ripwire-routerSkill
- ripwire-security-scanSkill
- ripwire-write-testsSkill
The file
We split this CLAUDE.md into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 70
If sources may have moved under a build — after any branch switch, or if you are unsure — do not trust an incremental rebuild:
- Very specific: line 101
Run gates in the foreground.
- Very specific: line 154
CONTRIBUTING.md§3: Read that before writing C++ here.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
ripwire — guide for coding agents
You are working on ripwire's own source. This file is the orientation an agent needs before it touches this repo; it is not a manual for using the tool.
ripwire is a zero-runtime-dependency C++23 CLI. It crawls a codebase, extracts symbols with
tree-sitter, resolves references into a call graph, ranks the graph with Personalized PageRank, and
streams a deterministic minified XML map to stdout. Around that core sits the verb catalog in
docs/COMMANDS.md — navigation, diff-awareness, quality, retrieval — and an MCP server so an agent
can call them mid-task.
Where to look
| Question | File |
| What does the tool do? Which flag answers which question? | README.md, docs/COMMANDS.md, ./build/ripwire --help |
| How is it built internally? Pipeline, data model, determinism contract | docs/ARCHITECTURE.md |
| How is any published number measured? | docs/EVALS.md |
| Changing a DEFAULT, a legend, a ceiling or a cut? Read this first | docs/METHODOLOGY.md §9 — terminality is the objective, the ceiling is a constraint, honesty lives in attributes |
| C++ style, guardrails, gate discipline, submission checklist | CONTRIBUTING.md |
Index of everything under docs/ | docs/README.md |
./build/ripwire --help is generated from the binary's own flag table and is always current. When
--help and a document disagree, --help wins and the document is a bug.
Build
cmake -S . -B build && cmake --build build -j # dev build — no build type, deliberately
cmake -S . -B asan -DRIPWIRE_ASAN=ON && cmake --build asan -jDo not configure a local dev tree with -DCMAKE_BUILD_TYPE=Release. Release defines NDEBUG,
which compiles the DISCLOSE( msg ) trace out; any gate that asserts a degrade path then passes blind.
CI builds both flavours on purpose — Release catches optimizer-only bugs, the plain build catches
degrade paths. If you add a degrade path, the plain run is what proves it.
Never edit the tree while a build is running, and never background a build you then edit around. This is not a style preference — it silently produces a binary that cannot exist from any single commit, and it costs hours to diagnose because every symptom points somewhere else.
Make decides what to recompile by comparing mtimes. Header tracking is correct and complete (the
compiler writes real depfiles: build/CMakeFiles/ripwire.dir/src/ingest.cpp.o.d lists src/model.h
among ~1100 headers, and pagerank.cpp.o.d correctly lists none). But mtime ordering is only
meaningful if the sources hold still. If you edit src/model.h — or git checkout a branch that
does — while a build is in flight, that build writes .o files whose mtime is newer than the
header but whose content predates it. Make then correctly concludes "up to date" and never
recompiles them again. cmake --build build -j reports success, exit 0, no warnings, forever.
Three ways this was hit, all from building across (or editing under) a branch switch:
- A
cmake --build asanstarted on one branch and finished after agit checkoutto another that changedSymbol. Half the objects hadsizeof(Symbol)==96, half104. ASan reported a heap-buffer-overflow iningest— a real report, of a fake bug. The tell: the overflowing buffer was 1344 bytes = 14 × 96, an exact multiple of the previous struct size. If a sanitizer report's region size divides evenly by an oldsizeof, stop debugging and rebuild. src/quality.h'skIngestParserVerMirroredited while a clean rebuild ran. The binary kept emitting the old value through repeated successful rebuilds;qextractionkeycheckfailed withparserVer=41, expected 12/42and looked like a missed mirror update.touching the header fixed it, which is the diagnosis: the object was newer than the source it disagreed with.- The same
sizeof(Symbol)mix can surface as an uncaughtstd::length_error— SIGABRT withvector<unsigned int>::__appendin the stack, thrown from aresize( symbols.size() )deep iningest(triaged 2026-08-07:--quality-delta'scomputeHeadSnapshotre-ingest, ten identical reports in one morning of worktree churn). A.size()of avector<Symbol>whose element size half the objects disagree on is garbage; the resize that consumes it is just the first bounds check it fails. Zero repro in 38 runs on clean rebuilds of the same commit. If an "impossible" length_error/bad_alloc comes from a resize fed by.size()of a struct that changed size across a recent branch switch, rebuild--clean-firstbefore debugging the exception.
If sources may have moved under a build — after any branch switch, or if you are unsure — do not trust an incremental rebuild:
cmake --build build --clean-first -j # and the same for asan/ if that tree is in playtest/g1freshcheck.sh catches the ordinary stale binary (binary older than source) and is worth
believing when it fires — it is not noise. It cannot catch this variant, because here the binary is
newer than the source and only its contents are stale. Nothing in CMake can repair a source that
changed mid-compile; the discipline is the fix. When this variant is suspected, --doctor's layout
row reports the cross-translation-unit sizeof/alignof evidence; treat state="disagree" as a
clean-rebuild requirement. state="agree" compares only the types= registered in src/model.h; a
same-size layout change or a stale constant is invisible, so agree does not rule out a mixed binary.
Verify
./build/ripwire . --quality-delta --legend=compact # the "am I done" checkpoint — see the note below
python3 test/pargates.py . ./build/ripwire -j 6 # the full gate suite, in parallel
test/regression.sh # the same set, sequentially (authoritative list)
LSAN_OPTIONS=suppressions=lsan_suppressions.txt ./asan/ripwire <dir> >/dev/null
t=$(mktemp -d); ./build/ripwire <dir> >"$t/a"; ./build/ripwire <dir> >"$t/b"; diff -q "$t/a" "$t/b" # determinism gate (outputs outside <dir>)
./build/ripwire <dir> | xmllint --noout - # well-formedness gate--legend=compact on the checkpoint run is not cosmetic: on a clean report the legend is nearly the
whole document, and dropping it takes the run from 2,776 B to 454 B (measured 2026-09-10 on a
two-function fixture; 15,601 B to 8,775 B on this repo mid-change). The findings are byte-identical
either way — only the dictionary in front of them is shorter, and you already know it.
Run gates in the foreground. A new test/*check.sh must be listed in test/regression.sh in
the same commit — test/manifestcheck.sh fails otherwise.
The five guardrails
- G1 — memory safety, adversarially verified.
-fsanitize=address,undefined,integer,float-divide-by-zero,float-cast-overflow -fno-sanitize-recover=all -O2 -g. The-fno-sanitize-recover=allis the linchpin: without it a run with undefined behavior still exits 0. LeakSanitizer uses the committedlsan_suppressions.txt(tree-sitter grammars never free their static parse tables). ThreadSanitizer is a separate, mutually exclusive target. - G2 — cache locality over abstraction. DOD, POD, SoA, 32-bit handles, no generic graph library. The no-allocation rule is scoped to our own code inside the PageRank power-iteration loop; tree-sitter allocates internally and is out of scope.
- G3 — one deterministic build step. CMake only, dependencies pinned and vendored, tree-sitter
linked statically, no host-installed dependencies, no OpenMP. "Self-contained", not "static" — a
fully static binary is impossible on macOS, so never pass
-static. Platforms: Unix/Linux/macOS first, native Windows second (clang-cl primary; MSVCcl.exemust also build). Acl.exeportability finding is worth fixing but does not block a POSIX-only code path. - G4 — maximum token density. Minified XML, no inter-tag whitespace, terse attributes. The legend is emitted
once per answer on the CLI (
--legend=full|compact) or once per session on agent surfaces (--legend=ref, served only after the session dictionary was delivered in that process; the answer then ends with<about … legend="ref" dict= dictv=/>). Every attribute a default answer emits is defined in that answer's own legend — gateslegendcoveragecheck(G) andcompactlegendcheck(UG); a ref answer carries the same attributes as its inline twin, and every definition it leans on is bytes that session was already sent or that the answer carries itself — gatelegendrefcheck. Output pipes clean throughxmllint --noout; no newline outside CDATA. - G5 — modular zero-dependency CLI. Hand-rolled argument parser; a flagless run is the core map; every flag is purely additive.
Non-negotiables
- Write the gate before the code it measures. A ranking, a token estimate, and a call graph all look plausible whether or not they are correct.
- Determinism is a contract, not a nicety. Crawl order is sorted before IDs are assigned; reductions use fixed block partials in canonical order; the PageRank translation unit is compiled without floating-point reassociation. Anything that makes output depend on thread timing is a bug even when the ranking still "looks right".
- Honesty in output is a feature. Counts that cannot be totals are labelled floors
(
counts_floor="1"); a zero means "none found", never "none exists"; every truncation is disclosed in the header. Do not add a surface that quietly rounds, guesses, or omits. - Never
ASSUME( false )(or anEXPECTS/ENSURESof false) on a degrade path. Release deletes the fallback behind it. Guard the path and disclose it:DISCLOSE( sink, why ), whose sink sets the output field the reader sees, orDISCLOSE( Diagnostics::answerUnchanged, "reason" )when the answer truly cannot change. A one-argumentDISCLOSE( msg )ships nothing and may not be added. External input isVALIDATEd, neverASSUMEd. - Never
std::map/std::unordered_map— see the container rule inCONTRIBUTING.md.
Style
Allman braces, braces on every control-statement body (no braceless if( x ) f(); — inline
{ … } inside one-line lambdas), spaces inside parens (f( x )), ~160–200 column wraps, index-vs-count naming,
structured-binding returns, tolerance-band float tests. Output goes through rw::emitTo (src/infra/emit.h:
std::print, falling back to std::format+fputs by feature test, and --version says which as emit=) —
never a new printf-family call site; a not-yet-converted help/legend string is still a printf FORMAT, so a
literal % in it must be %%. The full rules — with the reasoning — are in
CONTRIBUTING.md §3. Read that before writing C++ here; it is self-contained.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

