Open source · MIT · Rust

A code knowledge graph built for agents

Stop making your coding agent grep in the dark. rgctl indexes call paths and dependencies once, then answers impact questions in compact JSON — so Cursor, Claude Code, and Codex use fewer tokens and make fewer confident mistakes.

curl -fsSL https://rgctl.io/install.sh | sh
$ rgctl --version
$ rgctl install --skill --tools cursor,claude,codex,antigravity,agents

Prefer a release tarball or a source build? See install options.

rgctl › discover .
✓ graph built · reachability cached
rgctl › -f json blast-radius "priceShoppingCart" --depth 2
{
"schema_version": 2,
"target": { "symbol": "priceShoppingCart" },
"metrics": { "score": 14.2, "impact_zone_size": 4, "caller_depth_limit": 2 },
"topology": { "direct_callers": [{ "name": "CartController" }] }
}
main.rsCartControllerpriceShoppingCart()PaymentGatewayInventoryServiceOrderRepositoryTaxCalculator
Fig. blast radius, depth 25 edges · 4 impacted

See it run in a real terminal

77-second VHS walkthrough on the in-tree ecommerce-java fixture — sub-second indexing, call-graph lookups, upstream blast radius, Fast-Leiden communities, Hybrid CPG program slicing, structural clones, offline semantic search, policy gates, and AI agent skill installation.

CLI walkthrough (VHS)
Recorded from docs/videos/user-guide-cli.tape — discover, status, find, callers, blast-radius, communities, PageRank, CPG slicing, clones, semantic search, policy gates & agent skills.

Why rgctl instead of grep?

Text search shows where a string appears — not what breaks when you change it. Give your agent precomputed structure instead of raw file dumps.

Typical agentAgent with rgctl
Finding dependenciesRepeated grep + file reads1–2 graph lookups (discover once, then query)
Context window costWhole files into the promptCompact -f json rows
Refactoring safetyIndirect callers missed or guessedExact upstream blast radius at any depth
Answer reliabilityRelationships inferred from namesDeterministic facts from the typed graph

Battle-tested at scale

  • Linux kernel (72.4k files, 1.76M nodes) cold discover in ~48.1 s · rustc in ~23.5 s · metasfresh in ~9.3 s
  • Zero-cold-touch mmap queries on RGCL v2 columnar snapshots + content-addressed FileFacts cache & rgctl watch
  • 69 languages across two tiers — 24 Tier-1 deep CFG/PDG plugins + Mainframe (COBOL/PL/I/JCL) + 42 Tier-2 tags.scm packs

What sets it apart

Most code graphs stop at symbols, callers, and impact. rgctl adds precomputed reachability, on-demand CFG/PDG slicing, subsystem clustering, centrality and churn rankings, and migration/CI artifacts — served as deterministic -f json so your agent gets a verified answer instead of reading the tree.

Index & ask

Give your agent a map of the repo instead of making it read every file.

discover

Index once, query later. A single Rust pass builds the graph and reachability caches, so follow-up questions are lookups, not fresh greps.

find · callers

Exact relationships, no guesswork. Get callers and typed symbol references in stable -f json with schema_version.

semantic

Search by intent when you don’t know the name. Opt-in offline embeddings over functions or communities, paired with structural facts so similar names aren’t mistaken for real dependencies.

Program analysis

Trace what breaks, what changes state, and where untrusted data goes.

blast-radius

Know what a refactor will break. Deterministic upstream impact at any depth — the call sites an agent must update, in compact JSON it can gate edits on.

cpg · slice · inspect

See which lines actually touch a value. Statement slices, field mutations, and branch dominance without reading the whole file; slice builds CFG/PDG lazily, discover --with-cfg prebuilds the archive.

taint · security

Follow untrusted input to the sink. Source→sink paths with --with-taint / --with-security; pair with vuln for OSV/CVE reachability — not just “who calls whom.”

Architecture & change

Help your agent see the big picture — and keep risky PRs in check.

communities

Automatic subsystem boundaries. Hub-stripped Fast-Leiden clustering groups tightly coupled code so agents reason about modules, not a flat bag of functions.

metrics

Rank load-bearing code with centrality, not guesses. FastPageRank, betweenness, harmonic centrality, and git churn identify the files most likely to hurt when changed.

migration · review

Plan the refactor, then guard it. Export a dependency-ordered migration_plan.json, or gate PRs with review check / check --policy-file.

From prompt → graph facts → edit

Install the agent pack (rgctl install --skill): core skill rgctl plus /rgctl:review, /rgctl:vuln, and /rgctl:migrate — or drop AGENTS.md into your repo. The model calls rgctl instead of grepping blindly — then reasons on structured impact.

Agent guide
cd your-repo
$ rgctl install --skill --tools cursor
$ rgctl discover .
$ rgctl -f json blast-radius "priceShoppingCart" --depth 2

Help grow the project

Questions and ideas are welcome on Discord. Star the repo, try the ecommerce-java fixture, and share what you build.