code-graph

A set of tools for answering questions about a repository’s structure, architecture, and frontend-to-backend connections through a pre-built code graph.

In plain words
What is it for?
Use it to find definitions, inspect component relationships, trace routes to handlers, review possible refactor impact, view code flows, and refresh the graph after edits.
Why use it?
It reduces the need to grep through files and read many of them before making changes or tracing a flow.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/dorkian/code-graph-mcp/code-graph
Any agent
npx skills add dorkian/code-graph-mcp --skill code-graph
Clone the repo
git clone --depth 1 https://github.com/dorkian/code-graph-mcp

Made for: Claude Code, Codex.

Per session 157 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 895 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00157 $0.00895
Opus 5 $0.00078 $0.00447
Sonnet 5 $0.00031 $0.00179
Haiku 4.5 $0.00016 $0.00089

Measured yesterday against content hash c8601ffca0ae, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

code-graph scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/code-graph/SKILL.md · 73 lines

How it starts

The opening of the file, as written. The whole thing — 73 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Code Graph

The code-graph-mcp server holds a pre-built knowledge graph of this repo: packages, files, components, frontend routes, HTTP calls, backend routes, and handler functions, with the edges between them. One tool call against the graph replaces a grep plus several file reads — use it first, read files second.

Question → tool mapping

The user asks… Call
"Where does login land in the backend?" / "Which handler serves /users/:id?" map_frontend_to_backend with the component, route, or path
"What uses Button?" / "What does Dashboard depend on?" find_component_relations
"What's in this repo?" / "Which packages/services exist?" repo_summary
"Where is X defined?" search_symbols (never grep for this)
"What breaks if I change X?" / before a refactor impact_of_change
"Show me the component tree / the flow" visualize_graph
Results look stale after edits reindex (incremental, cheap)

Workflow: answering a structural question

  1. Call the single most specific tool from the table — not repo_summary first "for context" unless the question is actually repo-wide.
  2. Answer from the tool output. Only read_file the specific files the graph named, and only if the user needs code-level detail beyond structure.
  3. If a name isn't found, the tool returns closest matches — pick the right one and retry rather than switching to grep.

Workflow: adding a feature or fixing a bug

  1. repo_summary — identify the right package/service.
  2. find_component_relations on the nearest existing component/route — see its hooks, children, and endpoints so the new code matches local patterns.
  3. map_frontend_to_backend if the change crosses the FE/BE boundary — know the handler before touching the client call (and vice versa).
  4. impact_of_change on anything you're about to modify — list the blast radius and check the dependents after editing.
  5. Only now read/edit the specific files identified. After substantial edits, call reindex so later questions in the session stay accurate.

Read the full file on GitHub · 73 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 73 lines · 157 tokens per session scan A c8601ffca0ae

Subscribe to this mod's changes

code-graph is a skill published in the GitHub repository dorkian/code-graph-mcp (0 stars, last pushed 11d ago), licensed MIT. It adds 157 tokens to every session and 895 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…

openai/codex · 114 tokens

imagegen

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…

openai/codex · 113 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens