tools-codegraph

A codebase graph tool that maps symbols, references, function calls, dependencies, cycles, and connections between files. It stores this map so it can be queried without rebuilding it each time.

In plain words
What is it for?
Use it for architecture reviews, tracing callers and callees, finding dependency cycles and highly used code, and checking a change's likely blast radius.
Why use it?
It shows how code is connected, making it easier to spot tightly linked modules and estimate which parts may be affected by a change.

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/alexei-led/architect/tools-codegraph
Any agent
npx skills add alexei-led/architect --skill tools-codegraph
Clone the repo
git clone --depth 1 https://github.com/alexei-led/architect

Made for: Claude Code, Codex.

Per session 107 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 979 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.00107 $0.00979
Opus 5 $0.00053 $0.00490
Sonnet 5 $0.00021 $0.00196
Haiku 4.5 $0.00011 $0.00098

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

Security

Grade A, and why

tools-codegraph 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.

src/skills/tools-codegraph/SKILL.md · 99 lines

How it starts

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

codegraph

codegraph builds a persistent graph of the codebase — symbols, references, and call edges — that you query without re-parsing each time. It answers graph-shaped questions ast-grep can't: what depends on this, what does a change affect, where are the hubs and cycles.

Evidence dimensions: dependency and semantic.

When to use

Use to map observed module structure against declared modules, to find import or call cycles, high-fan-in hubs, wrong-way dependencies, and to size the blast radius of a proposed change. Build the graph during the system-map step; query it during evidence gathering.

Commands

codegraph init                 # set up graph store; prefer an external cache/store if supported
codegraph index                # full parse → build the graph
codegraph sync                 # incremental update after changes
codegraph status               # index health + commit it was built at
codegraph query "<expr>"       # query symbols / edges
codegraph context <symbol>     # neighbors of a symbol (callers, callees, refs)
codegraph affected <path>      # what a change to <path> reaches (blast radius)
codegraph files <symbol>       # files defining/referencing a symbol

Typical flow: init once, index, then status to confirm freshness, then query / context / affected for evidence.

Stale-index handling

Run codegraph status before each scoring query batch. If the index commit does not match the working tree, the graph describes an old repo:

  • Run codegraph sync (incremental) or codegraph index (full) to refresh.
  • If you cannot refresh (read-only target, time budget, or no approved writable cache), the stale graph is not evidence — record the dependency dimension tools_failed with reason "stale index," and do not score dependency health from it.

Evidence output

Record:

  • dimension: dependency or semantic.
  • source: codegraph status freshness, query/context/affected command, and scope.
  • facts: cycles, hubs, fan-in/out, callers/callees, affected paths, or confirmed absence.
  • limits: stale index, partial language coverage, unsupported files, or failed indexing.

Read the full file on GitHub · 99 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 · 99 lines · 107 tokens per session scan A c812e536f15c

Subscribe to this mod's changes

tools-codegraph is a skill published in the GitHub repository alexei-led/architect (2 stars, last pushed 1mo ago), licensed MIT. It adds 107 tokens to every session and 979 once invoked, about $0.0005 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

brooks-sweep

Full-sweep mode: runs a unified analysis across all quality dimensions — code decay, architecture, tech debt, and test quality — then applies fixes directly to the codebase. Safe changes are auto-applied; risky changes are confirmed before execution. Drawing on twelve classic engineering books. Triggers when: user…

hyhmrright/brooks-lint · 178 tokens

codex-autoresearch

Run autonomous, measurable experiments in a Git repository: change one hypothesis, verify a numeric metric, keep improvements, and revert failures. Use when the user wants Codex to keep iterating toward a numeric target in the foreground or as a detached background run. Do not use for ordinary one-shot coding…

leo-lilinxiao/codex-autoresearch · 80 tokens

map-wayfind

Decision-frontier wayfinding: build and work a durable map of open design decisions BEFORE planning, for large or foggy efforts where /map-plan would force premature decomposition. Use when a task is too big or too vague to decompose — many unknowns, tangled decisions, or "I'm not even sure what to build yet" — and…

azalio/map-framework · 182 tokens

clipboard

Copy text to clipboard with optional rich formatting. Triggers on "copy to clipboard", "copy that", "pbcopy", "copy formatted", "copy rich text".

CodeAlive-AI/ai-driven-development · 36 tokens

neo4j-modeling-skill

Design, review, and refactor Neo4j graph data models. Use when choosing node labels vs relationship types vs properties, migrating relational/document schemas to graph, detecting anti-patterns (generic labels, supernodes, missing constraints), designing intermediate nodes for n-ary relationships, enforcing schema with…

neo4j-contrib/neo4j-skills · 152 tokens

alphafold-database

Access AlphaFold 200M+ AI-predicted protein structures. Retrieve structures by UniProt ID, download PDB/mmCIF files, analyze confidence metrics (pLDDT, PAE), for drug discovery and structural biology.

agent-skills-hub/agent-skills-hub · 54 tokens