A code map for developers and coding agents, written in Rust -- inspired by NanoNets/Graft.
plouf.rs reads a source repository and builds a map of how the code connects --
files, classes, functions, routes, templates, and database objects. It walks the
tree once, emits a deterministic wiring.json (nodes + resolved edges), and
answers queries over it, so tools and agents navigate a codebase instead of
grepping it. It never changes your code -- it only reads the repo and produces a
searchable map. Ask it things like:
- what calls a function (its blast radius)
- where a database table is used (the model and every migration)
- which routes wire up a controller
- which templates depend on a component
One graph spans backend and frontend, across languages and template formats:
- PHP via Mago
- JS / TS / Vue / Angular via oxc (
.vue= its<script>blocks; Angular@Componentclasses becomecomponentnodes + their selector;@Pipecustom pipes link to their{{ x | pipe }}template uses via apipe:node) - Blade templates (
*.blade.php) via a hand-scanner: view references (@include/@extends/@component/<x-...>/<livewire:...>) and translation keys - Twig templates (
*.twig):{% extends/include/embed/import %}references, custom-function calls ({{ fn() }}linked to theirnew TwigFunction(...)registration via atwigfn:node), and translation keys from{% trans %}blocks / the|transfilter (the Twig i18n extension) - PHP
require/include(and*_once) ->requiresfile-dependency edges - bbscript (
*.bbscript) Gherkin-like e2e DSL:Feature/Scenarionodes +visitsedges to the routes each scenario opens - Translation keys across all of the above (Laravel
__/trans, Vue$t/t, Angular ngx-translate.instant(...)+ the| translatepipe in.htmltemplates, gettext), indexed to alang.jsonsidecar
Download the .deb from the releases
and install it with apt (resolves dependencies and puts plouf-rs on your
PATH at /usr/bin/plouf-rs):
curl -fsSL -o /tmp/plouf-rs.deb https://github.com/wdes/plouf.rs/releases/download/v0.4.1-dev/plouf-rs_0.4.1-dev-1_amd64.deb
sudo apt install /tmp/plouf-rs.debThe package also drops the /plouf agent skill (SKILL.md) under
/usr/share/doc/plouf-rs/skill/ -- copy it into a project's .claude/skills/ to use it.
The binary doubles as a Claude Code status line: plouf-rs statusline reads
the harness context on stdin and prints the graph size, the model, cwd, context
tokens, and when plouf-rs was last queried ([3m ago] / [unused]) -- a
stale age flags that the agent has stopped using the graph:
plouf 17508n/42638e [3m ago] | Opus 4.8 | myrepo | ctx 45k
Wire it into Claude Code settings.json (merge the statusLine key in):
Release binaries (.deb + the raw plouf-rs-<arch>) carry signed SLSA
build-provenance attestations. Verify one before installing:
gh attestation verify /tmp/plouf-rs.deb --repo wdes/plouf.rsNative binaries ship with each release for both aarch64-apple-darwin (Apple
Silicon) and x86_64-apple-darwin (Intel). Download the one for your Mac, mark
it executable, and -- since it is not Apple-notarized -- clear the download
quarantine so Gatekeeper lets it run:
# Apple Silicon; on an Intel Mac swap aarch64 -> x86_64
curl -fsSL -o plouf-rs https://github.com/wdes/plouf.rs/releases/latest/download/plouf-rs-aarch64-apple-darwin
chmod +x plouf-rs
xattr -dr com.apple.quarantine plouf-rs # clear the 'unidentified developer' quarantineIt carries the linker's ad-hoc signature (enough to run once un-quarantined) and
the same SLSA build-provenance attestation as every other artifact -- verify with
gh attestation verify plouf-rs --repo wdes/plouf.rs.
Or build from source:
cargo build --releaseNeeds a recent Rust toolchain (Mago requires rustc >= 1.97).
plouf-rs index . --out build/outWrites build/out/.graph/wiring.json plus a tiny stats.json and a
lang.json (the translation-key index -- a separate sidecar because a gettext
app has thousands of keys that would bloat the graph everyone loads).
Extraction is parallel; PLOUF_THREADS=1 forces sequential for the lowest peak
RSS, higher values trade memory for speed.
Run these from the directory you indexed (paths in the graph are relative):
plouf-rs find CompanyController # symbols whose id/name matches
plouf-rs sig Company.getId # a symbol's declaration line
plouf-rs body Foo.convert # full source (fn/class/enum/...)
plouf-rs callers BaseRequest # who references it (blast radius)
plouf-rs find route: # list every route (Laravel / attribute / OpenAPI)
plouf-rs callers UserController # the route files + paths that wire a controller
plouf-rs uses invoice.title # files using a translation key (exact, else substring)
plouf-rs missing # gaps: unreferenced/unresolved/empty
plouf-rs dead-code # unused symbols (entry points/vendor excluded)
plouf-rs dead-code --exclude-tests # + code exercised only by the test suiteRoutes are shared route:<path> nodes. plouf-rs find route: lists them
all -- Laravel file-based (Route::get('/x', [Ctrl, 'm'])), PHP attribute
(#[Route]/#[Get]), Swagger-PHP OpenAPI (#[OA\Post(path: '/x')]), plus
frontend-router and e2e routes. plouf-rs callers <Controller> shows the route
files (routes-to) and the paths (serves) that wire it; plouf-rs callers route:/x shows what navigates to a route.
A bare name resolves when unique; otherwise the candidates are listed. --out
defaults to build/plouf-rs-out; pass the directory you indexed into.
plouf reads a JSON any tool can produce -- {tables: [{name, columns}], foreignKeys: [...]} -- so a project can feed its live schema in:
plouf-rs tables --schema schema.json
plouf-rs table companies --schema schema.json- Nodes:
file,class,interface,trait,enum,function,method,component(one per Vue SFC / Angular@Component),table(one per DB table name -- idtable:<name>, the join between models and migrations), andpath(a file or folder named by a.gitattributesexport-ignoreentry). Ids are the file path for files andpath#Symbol/path#Class.methodfor the rest, each carrying a byte span sosig/bodyslice the source without re-parsing. - Edges:
contains,imports(JS relative specifiers resolve to files),extends/implements,calls(resolved via a typed receiver --$this/this, typed params,new X()/ annotated locals -- then the extends chain, else a unique-name fallback),includes(Blade view references -- dotted view names resolve to*.blade.phpfile nodes). - Eloquent (Laravel): a
$this->belongsTo(Related::class)(andhasMany/hasOne/belongsToMany/morph*/*Through) yields an edge labelled by the relation kind, from the model class to the related class. A model links to itstable:<name>node (explicit$tableor the snake-case-plural convention), and a migration'sSchema::create/table('x')links to the same node -- socallers table:companieslists the model and every migration. A Laravel route file'sRoute::<verb>/match/resource/apiResource/singleton, the pluralapiResources([...])map,Route::controller(...), and every action shape --[Ctrl::class, 'm'], invokable[Ctrl::class],'Ns\Ctrl@m', and the options-array['uses' => 'Ns\Ctrl@m']-- emit aroutes-toedge to the controller class, and (when the call has an explicit path) aroute:<path>node + aservesedge, socallers UserControllerlists the route files AND the paths that wire it. Attribute routing mints the sameroute:<path>node: bare#[Route('/x')]/#[Get('/x')], and the Swagger-PHP OpenAPI operation attributes#[OA\Post(path: '/x')](a namespaced verb with apath:argument; non-route#[OA\Schema]/#[OA\Response]are ignored). Sofind route:lists Laravel, attribute, and OpenAPI-documented routes alike. - e2e + routing: a bbscript
scenario->route:<path>visitsedge, and a Vue/Angular routerroute:<path>-> page-componentrendersedge (resolved to the.vue/.tsfile).route:<path>is a shared join node, socallers route:/clientslists the scenarios that open it and the page that serves it -- scenario -> route -> source. (Literal paths only: a router/clients/:idpattern does not match a concrete/clients/5.) .gitattributes: eachexport-ignoreentry maps to what it hides -- anexport-ignoresedge from the.gitattributesfile to apathnode for the file or folder it names, socallers .githublists what ignores it. An entry whose target no longer exists on disk stays unresolved, somissingreports it as a stale ignore -- the list rots as files are renamed or removed and nobody updates it.- Linter configs:
phpcs.xml<rule ref="./X.php">andphpstan.neonrules:/includes:entries emit aconfiguresedge to each in-repo sniff file / rule class, socallers <Sniff>shows the config that enables it and those entry-point classes stop reading as unreferenced. A data migration that seeds via an Eloquent model (Software::insert([...]), notSchema/DB::table) links to the model's table (snake-case-plural convention), socallers table:xsees the seeders, not only the schema migrations. - Translation keys are not edges in
wiring.json; they live in thelang.jsonsidecar as{key: [file, ...]}and are read byuses.
cargo test
{ ..., "statusLine": { "type": "command", "command": "plouf-rs statusline" }, ... }