crab-graph is a Claude Code plugin. It reads your git history with a small local model and records where the model's attention goes: token to token, between the code you changed and everything that changed with it. When Claude renames or deletes something, whatever is attached to it shows up during the edit.
WHY IT WORKS
A commit is evidence of association: things that change together are usually related. A function and the paragraph that documents it. A kernel and its test. An English doc and its translation.
At each commit, a 0.8B-parameter model runs locally and reads the change against
the files it changed with. crab-graph doesn’t ask the model for an opinion; it
records the model’s attention, which tokens it reads while looking at which
others, and stores the strong pairs as edges. Grep can tell you two files share the
word config. Attention can tell you
parse_config and a doc heading called
“Resolution order” refer to the same thing.
Edges carry a score and a support count. They’re leads, not verdicts: enough to make Claude look before it breaks something, not a substitute for reading the code. The graph mirrors your last commit โ deletions remove edges, renames re-point them, rebases reconcile.
/cg-explore opens
the graph. Underlined tokens have edges; clicking one lists its partners. This is
unsloth’s first twenty commits, indexed in about two minutes.WHAT IT’S MADE OF
One Rust binary. The model runs through llama.cpp on your hardware, and the attention comes off the inference graph’s softmax tensors. The graph is a DuckDB file per repo, indexed incrementally at commit time. Nothing leaves your machine; there’s no cloud, account, or telemetry.
Install it from inside Claude Code, run
/cg-init in a repo, and rename something on
purpose.