code-graph

A persistent map of a project's code structure and relationships. It records things such as syntax-tree elements, dependencies, related code groups, and model-provided explanations of purpose and impact.

In plain words
What is it for?
It helps build, query, and incrementally update a code or dependency graph. It supports tasks such as impact analysis, finding module boundaries, and checking dependencies.
Why use it?
It makes it easier to understand how parts of a codebase connect and which areas may be affected by a change, without relying on rough text searches.

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/yugasun/aiops/code-graph
Any agent
npx skills add yugasun/aiops --skill code-graph
Clone the repo
git clone --depth 1 https://github.com/yugasun/aiops

Made for: Claude Code, Codex.

Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 555 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.00068 $0.00555
Opus 5 $0.00034 $0.00278
Sonnet 5 $0.00014 $0.00111
Haiku 4.5 $0.00007 $0.00056

Measured yesterday against content hash 9b4c070265a5, 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 · 56 lines

What it actually says

Code Graph

Build, query, and incrementally update a persistent knowledge graph for the target project. Infrastructure — other skills consume it via query; Flow Conductor checks freshness on session start.

Two-tier extraction

Tier Tool Role
Structural graphify AST nodes, edges, communities, confidence — deterministic
Semantic Model Purpose, depth, impact — contextual

graphify parses; the model annotates. Never replace graphify structural data with grep guesses.

Prerequisites

prerequisites.md — install graphifyy via uv/pipx/pip. Non-blocking if user declines.

Storage

Path Source Purpose
graphify-out/graph.json graphify Structural graph
.scratch/graph/annotations.json Model Semantic layer

Do not copy graph.json into .scratch/. Schema: graph-schema.md.

Operations

Detailed steps: build-steps.md.

  • /code-graph build — full scan + semantic annotation
  • /code-graph query <subcommand> — read-only; patterns in query-patterns.md
  • /code-graph update — incremental via graphify cache

Constraints

  • graphify is the structural backbone — no grep-based dependency guessing
  • Model adds semantic layer only; never override graphify edges
  • Prefer update over build when graph exists
  • Non-blocking on graphify failure — warn and continue
  • Confidence-aware: EXTRACTED (1.0) vs INFERRED (0.5) vs AMBIGUOUS (0.2)

Flow Conductor

aiops-graph.js hook suggests /code-graph build when stale. Architecture health runs graph_build phase first (phases.py) — build when missing/stale, skip when fresh, user may decline (organic fallback in /improve-codebase-architecture).

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 56 lines · 68 tokens per session scan A 9b4c070265a5

Subscribe to this mod's changes

code-graph is a skill published in the GitHub repository yugasun/aiops (4 stars, last pushed 12d ago), licensed Apache-2.0. It adds 68 tokens to every session and 555 once invoked, about $0.0003 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.