Load this skill first for repository graphs: callers, dependency paths, cycles, change impact, snapshot or PR comparisons, startup dependencies and CI dependency rules. Builds, queries and checks graph evidence.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Octocode Graph?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/bgauryy-octocode-graph)
---
name: octocode-graph
description: "Load this skill first for repository graphs: callers, dependency paths, cycles, change impact, snapshot or PR comparisons, startup dependencies and CI dependency rules. Builds, queries and checks graph evidence."
---
# Octocode Graph
Use graph evidence to answer a structural question, then inspect the source behind the claim. Run `octocode-graph <command>` if installed, or `npx -y @octocodeai/octocode-graph <command>`. In the Octocode source checkout, use `node packages/octocode-graph/bin/octocode-graph.mjs <command>`.
Choose the source scope first: build a workspace from its root for relationships across its packages; a file build covers only that file. The default build shares one native binding snapshot across packages. Check the saved graph’s `bindingScope` coverage field: `partitioned` means a native limit forced separate snapshots and cross-package completeness is partial. Reuse an explicit saved result when the task names one. For current-code questions, query with `--refresh`; a plain query is an offline snapshot answer with unverified freshness. If no graph exists, run the returned build suggestion. For a PR or two revisions, start with the [merge-base/head workflow](references/diff-review.md).
```sh
octocode-graph build . --out .octocode/graph-review
octocode-graph query .octocode/graph-review "search cycles"
octocode-graph query .octocode/graph-review "impact src/worker.ts depth 2" --refresh
octocode-graph check .octocode/graph-review --format sarif
```
## Ask
| Question | Run |
|---|---|
| Find code by name or by what it does | `search <words>`; filter with `--kind`, `--lang`, `--role`, `--path`, `--exported`, `--param`, `--returns` |
| What surrounds a file or symbol | `about <file\|symbol>`; `context <file\|symbol...> --tokens N` ranks the neighbourhood under a token budget (`more:` continues) |
| Who depends on it or calls it, what it uses | `impact`, `dependents`, `deps`, `callers`, `callees`; for a hub file (a module root such as `cli.rs`, an `index` file) file-level `impact` reaches most of the package, so ask `callers <file>#<item>` per public item |
| Every caller of one function | `lspSearch callers`; a graph `callers` answer without full probes is `isPartial` (`callersNotProbed`) and carries that call as `confirm` |
| How A reaches B, loops, prerequisite order | `path [--all]`, `cycle`, `order`, `trace` |
| What an entry loads, why, at what cost | `reach <entry\|dir>`, `why <entry> <target>`, `hubs [<dir>]` |
| What is critical | `critical functions`, `critical points`, `critical path [<file>] [--up]`, `top <metric>`, `community` |
| A fresh scope, or native detectors (`issues`, `cochange`, `drift`, `witnesses`, `unresolved`) | `octocode-graph graphQuery '{"queries":[{"path":".","operation":"issues"}]}'` · [Operations](references/operations.md) · [Builds and pagination](references/build-and-read.md) |
| A spelling or literal text | `localSearch` (or `rg`), not the graph |
Add `--runtime` (drops `import type`) or `--eager` (startup only) to any walk. Follow every `next.query` (`more:`) unchanged against the same saved graph; a page with no rows can still carry edges or other evidence. [Saved queries](references/query.md) owns delivery budgets, flags and each query's fields. Batch questions in one load, one per line: `printf '%s\n' 'search x' 'about a.ts' | octocode-graph query . --stdin --json`. An ambiguous name returns re-runnable candidates.
## Go further
| Need | Read |
|---|---|
| CI dependency rules: forbidden, allowed, required, reachable, circular; baseline, SARIF, `--since <rev>` | [Rules](references/rules.md) · [fields](references/rule-fields.md) · [CI](references/rules-ci.md) |
| Bundle bytes, CPU and heap profiles (`hot`), minified frames (`locate`), SARIF or path-flow evidence | [Providers](references/providers.md) · [bundles](references/provider-bundle.md) · [profiles, locate](references/provider-profiles.md) · [data flow](references/provider-data-flow.md) |
| What a metric means · quality, risk, retest and migration order | [Algorithms](references/algorithms.md) · [Quality checks](references/quality-checks.md) |
| A PR, branch or refactor comparison | [Review workflow](references/diff-review.md) · [diff evidence](references/diff.md) |
| Docs, configs and manifests linked to code (`links`); record a missed link | [Links](references/links.md) |
| Build options, replay · build phases, cache, registry · viewer server, events | [Commands](references/commands.md) · [Pipeline](references/build-pipeline.md) · [Viewer and events](references/viewer-events.md) |
| Saved files, coverage lines, HTML export | [Output](output.md) |
| Viewer chat · durable notes · architecture layers | [Chat](references/chat.md) · [Wiki](references/wiki.md) · [Modeling](references/modeling.md) |
Read returned source locations with `localFetch` or an available source reader ([evidence](references/evidence.md)); run the `confirm:` call before claiming every caller. Finish with the answer, the source or witness locations supporting it, and the coverage gaps that limit it. Aggregates and rankings are graph measurements, not source citations; `brief.txt` describes coverage ([output](output.md)).
MCP: `octocode-graph mcp` serves `build_graph`, `query_graph`, `refresh_graph`, `diff_graph`, `check_graph` and `link_graph`; `channel` adds the live viewer. Native `graphBuild` and `graphQuery` run through the graph CLI only. The JavaScript API exports `buildGraph`, `openGraph`, `openFreshGraph` and `refreshGraph`; an opened graph has `.query(text)` and `.diffFrom(before)`. [Surface arguments and freshness](references/query-surfaces.md)