/interlock:graphfrom Interlock
Builds and queries a local, deterministic codebase knowledge graph indexing imports, symbols, and OpenSpec specs. Useful for repo navigation, finding symbol consumers, and tracing module dependencies without re-grepping.
Ships in Interlock. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Build and query a local, deterministic codebase knowledge graph. No vector store, no external service, no network.
What gets indexed: JS/TS, Python (.py/.pyi), shell (.sh/.bash), C# (.cs, and .csproj project references), Bicep (.bicep), and curated small config JSON (package.json, tsconfig*.json — not lockfiles). Markdown stays on the bounded-retrieval path (DOCS_DIGEST.md / context / docs) plus the OpenSpec overlay — never dump every *.md into graph.json.
Languages outside that set (Go, Rust, Java, Ruby) are not structurally indexed: you still get the docs and OpenSpec overlays, but no import/symbol edges. Say so plainly rather than implying the graph is complete.
C# is inferred, not resolved. A .csproj ProjectReference is an EXTRACTED project-to-project edge. A C# type reference and a test-to-type link are INFERRED: they come from identifier matching against the namespaces a file can see, not from a compiler. Treat them as hints to verify. Four limits are known and not worked around:
using, is not seen.global using applies to the file that holds it, not to its project.Unreadable paths do not stop a build. A file or directory the build cannot read is skipped, and each one is named on stderr as GRAPH SKIPPED UNREADABLE: <path> (<code>). build and update still finish and exit 0; the summary line carries skipped=<n> and GRAPH_REPORT.md lists the paths under a "Not indexed" heading. Report those paths to the user rather than treating the graph as complete.
A query says when its graph is partial. query, consumers, path, explain and context print one line on stderr, GRAPH PARTIAL: <n> path(s) were unreadable when this graph was built…, whenever the graph they read was built past skipped paths. Their stdout and exit code are unchanged. When you see it, an empty or short answer is not evidence about the skipped paths: read GRAPH_REPORT.md for which they are, then Read or grep those paths directly before claiming a symbol has no other consumers.
Artifacts, all project-local under .claude/graph/:
| Path | Role |
|---|---|
graph.json | Node-link graph — the query source of truth |
GRAPH_REPORT.md | Cheap bootstrap: hubs, modules, inferred edges |
docs-index.json | Deterministic docs TOC + content hashes |
DOCS_DIGEST.md | Agent-only prose bootstrap (written by /interlock:docs-digest) |
manifest.json | File hashes powering incremental update |
Add .claude/graph/ to .gitignore — these are generated per-checkout and should never be committed.
interlock-graph is on PATH whenever this plugin is enabled. Do not probe for it, do not build a fallback path, do not shell out to node with an absolute path.
interlock-graph --help # full subcommand list
interlock-graph which # print the resolved CLI path, if you need to report it
interlock-graph build .
Then read .claude/graph/GRAPH_REPORT.md and summarize the top hub nodes and module boundaries. Do not rebuild on every query. If graph.json already exists, query it or update it.
interlock-graph update .
No-ops when file hashes still match manifest.json.
For "where is X", "what connects to Y", "how does A reach B", "who uses Z":
query or from GRAPH_REPORT.md).interlock-graph query "<tokens>" --budget 1500
interlock-graph consumers <symbol-or-file>
interlock-graph path <A> <B>
interlock-graph explain <node>
source_file:source_location.Never read all of docs/*.md upfront.
.claude/graph/DOCS_DIGEST.md exists, read it once. Rebuild with /interlock:docs-digest when it is missing or stale.interlock-graph docs-index . --write
interlock-graph context "<task tokens>" --budget 2000 --changed path/a.ts,path/b.ts
interlock-graph docs "<domain terms>" --budget 800 --dirs docs,openspec/specs
context combines a structural subgraph (~45% of budget) with ranked Markdown sections (~55%). Sections cite file — heading (Lstart-Lend).
This skill takes free text, treated as a query. Two forms are recognized ahead of that:
| Input | Action |
|---|---|
| "index the repo" / "build the graph" / "rebuild" | build ., summarize the report, stop |
| "update the graph" | update ., report what changed, stop |
| anything else | Query mode |
Note these map to CLI subcommands, not flags. There is no --rebuild or --consumers flag; interlock-graph --rebuild is an error.
| Situation | Command |
|---|---|
| Session explore / architecture mapping | Read GRAPH_REPORT.md, then query per subsystem |
| Domain prose bootstrap | Read DOCS_DIGEST.md; rebuild via /interlock:docs-digest if stale |
| Invariant sweep, structural layer | consumers <field-or-symbol> first, then grep for string-keyed readers |
| explain-code "called by" / "calls into" | explain / consumers / path |
| Brownfield onboarding | build, then seed the architecture doc from report hubs and modules |
Follow ${CLAUDE_PLUGIN_ROOT}/shared/TOOL-ECONOMY.md and ${CLAUDE_PLUGIN_ROOT}/shared/INVARIANT-SWEEP.md.
EXTRACTED edges. Treat INFERRED edges (OpenSpec, memory overlays) as hints to verify, not facts.build and update write only under .claude/graph/.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub renzrollon/interlock --plugin interlock16 skills in this plugin
/bootstrapOnboard a brownfield project into OpenSpec — analyze the existing codebase with parallel explorer agents, write an initial architecture document, then generate one spec per discovered feature describing what is already built. Use when adopting spec-driven development on a repo that has code but no specs./commitCreate a single feature-level commit after a change is implemented. Reads the OpenSpec change artifacts to write a verb-phrase conventional-commit message with an outcome summary and optional issue reference. Commit only — never runs tests, typecheck, lint or build, and never pushes./dispatchRoute a request to the right interlock skill, after one batched pre-flight that loads git state, OpenSpec status, open tasks and graph presence in a single pass. Use when you are not sure which skill applies, or at the start of a session to orient before doing anything else./docs-digestCompress a repo's docs and OpenSpec specs into one token-dense, agent-only primer at .claude/graph/DOCS_DIGEST.md — the prose twin of GRAPH_REPORT.md. Use when docs context is too large to load, after substantial docs or spec edits, or when asked to rebuild or refresh the docs digest. Not for producing human-readable documentation./evalsAuthor an Interlock eval case from an observed model-behaviour failure, and read a completed eval results run. Use when you have a reproduced failure — an archived proposal, a changelog entry, a run artifact, or a transcript — worth regression-testing against a real model, or when an eval run has finished and you need to know whether it is a regression, run-to-run variance, or no signal. Authoring needs cited evidence; the verdict comes from `interlock evals triage`, never from your own reading./explain-codeExplain code to a beginner in that stack — either a module walkthrough (what each function does, how calls link, where data flows, which patterns recur) or a commit teach-in (why each file changed, what changed, blast radius, what would break if it were left out). Use when asked to explain code, walk through a directory, or explain the last commit.Other plugins' skills for the same job