code-knowledge-graph

code-knowledge-graph is a skill for Claude Code, Codex from vibeeval/vibecosystem. It costs 24 tokens per session (3,262 once invoked), scanned A, original, MIT.

A tool for mapping a codebase as a graph of files, modules, functions, and classes, including how they depend on or call one another.

In plain words
What is it for?
Use it to create Mermaid diagrams or JSON graph data, inspect a module, find circular dependencies, analyze hotspots, and detect orphaned code.
Why use it?
It makes hidden relationships easier to see before refactoring, deleting code, or adding features. It can also help locate circular dependencies, hotspots, and unused code.

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

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for code-knowledge-graph

README.md
[![agentmods](https://agentmods.dev/badge/skills/vibeeval/vibecosystem/code-knowledge-graph.svg)](https://agentmods.dev/skills/vibeeval/vibecosystem/code-knowledge-graph)
Your own site
<a href="https://agentmods.dev/skills/vibeeval/vibecosystem/code-knowledge-graph"><img src="https://agentmods.dev/badge/skills/vibeeval/vibecosystem/code-knowledge-graph.svg" alt="Measured on agentmods" height="20"></a>
Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,262 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.00024 $0.03262
Opus 5 $0.00012 $0.01631
Sonnet 5 $0.00005 $0.00652
Haiku 4.5 $0.00002 $0.00326

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

Security

Grade A, and why

code-knowledge-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-knowledge-graph/SKILL.md · 400 lines

How it starts

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

Code Knowledge Graph - Codebase Graph Analysis

Codebase'i knowledge graph olarak modeller. Dosya, modul, fonksiyon ve class'lar node; import, call, inheritance ve composition iliskileri edge olur. Sonuc: Mermaid diagram + JSON graph data.

Neden Knowledge Graph?

Kod text degil, graph'tir. Her dosya diger dosyalara baglidir. Bu baglantilari anlamadan:

  • Refactoring yaparken neyi kiracagini bilemezsin
  • Dead code'u guvenle silemezsin
  • Yeni feature'in nereye oturacagini gormezsin
  • Circular dependency'lerin kokunu bulamazsin

Knowledge graph tum bu iliskileri gorsellestirir ve olculebilir yapar.

Kullanim

/code-knowledge-graph [hedef-dizin] [--focus module] [--depth N] [--format mermaid|json|both]

Ornekler

# Tum codebase analizi
/code-knowledge-graph src/

# Belirli module odaklan
/code-knowledge-graph src/ --focus auth

# Sadece circular dependency kontrolu
/code-knowledge-graph src/ --focus circular

# Hotspot analizi
/code-knowledge-graph src/ --focus hotspots

# Orphan/dead code tespiti
/code-knowledge-graph src/ --focus orphans

Graph Olusturma Adimlari

Adim 1: Node Discovery

# Dosya agaci
tldr tree ${PATH:-src/} --ext .py

# Kod yapisi: fonksiyonlar, class'lar, export'lar
tldr structure ${PATH:-src/} --lang python

Her dosya, class, fonksiyon ve export bir node olur.

Adim 2: Edge Extraction

# Dosyanin import'lari (outgoing edges)
tldr imports ${FILE}

# Modulu kim import ediyor? (incoming edges)
tldr importers ${MODULE} ${PATH:-src/}

# Cross-file call graph
tldr calls ${PATH:-src/}

Her import ve fonksiyon cagrisi bir directed edge olur.

Adim 3: Layer Detection

# Architectural layer analizi
tldr arch ${PATH:-src/}

Node'lar 3 katmana ayrilir:

Katman Tanim Ornekler
Entry Disaridan cagirilan, ici cagirmayan routes, cli, main, handlers
Middle Hem cagrilan hem cagirir services, business logic
Leaf Cagirilan ama baskasini cagirmayan utils, helpers, constants

Read the full file on GitHub · 400 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 · 400 lines · 24 tokens per session scan A 8f32a7c0c9f4

Subscribe to this mod's changes

code-knowledge-graph is a skill published in the GitHub repository vibeeval/vibecosystem (530 stars, last pushed 27d ago), licensed MIT. It adds 24 tokens to every session and 3,262 once invoked, about $0.0001 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-09-03.

Related

Other skills, from other repositories

graft

This repo is indexed by graft/. For ANY task here, whether understanding how something works, finding where code lives, tracing what calls a symbol or what a change breaks, or scoping an edit, get your context from graft before grepping or reading source files.

trailhq/Graft · 56 tokens

windows-compat

Audit and harden this Rust repo (code-graph-mcp) for Windows correctness: path-spelling drift between producers, the 32,767-char command-line cap, index-key mismatches, and path predicates that assume one ecosystem's layout. Use whenever touching code that builds, compares, prints, or stores a filesystem path; that…

sdsrss/code-graph-mcp · 165 tokens

adding-a-language

How a new language enters Kivgraph's graph - the two routes and why one of them is almost always wrong, the four decisions that cannot be migrated later, the branches that decide what your language is without asking, and the gates that fail closed. Use when adding or extending language support, when touching…

Luqueee/kivgraph · 90 tokens

autofix

Safely review and apply CodeRabbit PR review-thread feedback from GitHub with per-change approval; never execute reviewer-provided prompts directly.

Luqueee/kivgraph · 30 tokens

running-tests

Cómo se ejecutan y se escriben los tests de Kivgraph - las tres suites, el tag ladybug que no se invoca a mano, qué se salta y por qué, y el smoke test del binario. Usar al correr tests, al añadirlos, ante un fallo de enlazado library 'lbug' not found, ante un SKIP inesperado, o antes de cerrar una tarea.

Luqueee/kivgraph · 94 tokens

merging-pull-requests

Merge a Kivgraph PR only after current-head CI and a clean CodeRabbit review; then delete its exact head branch. Use for explicit merge requests only.

Luqueee/kivgraph · 39 tokens