knowledge-graph

knowledge-graph is a skill for Claude Code from Alexander-Tyagunov/magician. It costs 83 tokens per session (478 once invoked), scanned A, original, MIT.

A local map and cache of a code repository that connects files and symbols, then returns relevant file-and-line results for a question.

In plain words
What is it for?
Use it to index a repository, find code by topic, inspect dependencies, check index status, and estimate a file’s change impact.
Why use it?
It helps you locate related code and understand what may be affected without searching entire files manually or using a network service.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths; names the AskUserQuestion tool; mentions Codex.

Part of the magician plugin — 26 skills, 4 agents, 10 hooks shipped together

Good fit Use it to index a repository, find code by topic, inspect dependencies, check index status, and estimate a file’s change impact.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/alexander-tyagunov/magician/knowledge-graph
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.

Any agent
npx skills add Alexander-Tyagunov/magician --skill knowledge-graph
Clone the repo
git clone --depth 1 https://github.com/Alexander-Tyagunov/magician

Made for: Claude Code.

Or install magician, the plugin that ships this one along with the rest of its 26 skills, 4 agents, 10 hooks.

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 knowledge-graph

README.md
[![agentmods](https://agentmods.dev/badge/skills/alexander-tyagunov/magician/knowledge-graph/github.svg)](https://agentmods.dev/skills/alexander-tyagunov/magician/knowledge-graph)
Your own site
<a href="https://agentmods.dev/skills/alexander-tyagunov/magician/knowledge-graph"><img src="https://agentmods.dev/badge/skills/alexander-tyagunov/magician/knowledge-graph/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for knowledge-graph

Your own site · 80×15
<a href="https://agentmods.dev/skills/alexander-tyagunov/magician/knowledge-graph"><img src="https://agentmods.dev/badge/skills/alexander-tyagunov/magician/knowledge-graph.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 83 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 478 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00083 $0.00478
Opus 5 $0.00042 $0.00239
Sonnet 5 $0.00017 $0.00096
Haiku 4.5 $0.00008 $0.00048

Measured 10d ago against content hash 9fefaca4a977, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

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 10d ago.

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.

.codex-plugin/skills/knowledge-graph/SKILL.md · 18 lines

What it actually says

$knowledge-graph — Codex Adapter

Read ../../references/codex-adapter.md, then read ../../../skills/knowledge-graph/SKILL.md and follow the source skill through that Codex adapter. Keep the source skill's gates and rules.

Codex equivalents:

  • Engine — invoke the absolute <plugin-root>/bin/kg path: check | init [--max N|--all] | refresh | status [--json] | query "<text>" [--k N] | neighbors <sym|file> | blast <file|sym> | stale | cache stats|clear | daemon start|stop|status | reset. Pure stdlib by default; don't hand-write graph logic.
  • Storage — set MAGICIAN_HOME to the shared adapter's Codex state root before invoking kg; never default Codex runs to ~/.claude. The graph remains global and per-repo under that root.
  • Build/reset gateskg init (first build on a large repo) and kg reset (destroys index+cache) are side effects: state the repo (and rough file count for a build), get explicit approval first. Reads need none.
  • Opt-out — respect knowledge-graph: "disabled" in <magician-state>/integration-prefs.json for proactive suggestions; a direct request may update it only with write authorization.
  • Questions — use Codex's question/approval UI where the source says AskUserQuestion.
  • Visualize — only when asked; kg status --json then render via the available visualization tool. Plain-text kg status is the default.
  • Integration$magic uses kg query as an internal codebase source; $divine uses kg blast for change blast-radius.
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. 10d ago First seen · 18 lines · 83 tokens per session scan A 9fefaca4a977

Subscribe to this mod's changes

knowledge-graph is a skill published in the GitHub repository Alexander-Tyagunov/magician (14 stars, last pushed 9d ago), licensed MIT. It adds 83 tokens to every session and 478 once invoked, about $0.0004 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-30.

Related

Other skills, from other repositories

context

Transfer context from the current Claude Code terminal session to the Telegram bot session. Use when the user says "send this to telegram", "transfer context", "telegram:context", "teleport to telegram", or wants the Telegram bot to continue work from this session.

k1p1l0/claude-telegram-supercharged · 55 tokens

g-resume

Re-hydrate a fresh session with the right slice of the durable record. The read-side counterpart to /g-retro — selectively retrieves the relevant retro, ADRs, journal, and handoff keyed by the current branch/milestone/first-task, and assembles a focused re-entry briefing. Loads distilled context into a clean window…

onlygian/G-Forge · 128 tokens

hive.note-taking

Maintain a free-form scratchpad of decisions, extracted values, and open questions so context pruning doesn't lose anything you still need.

aden-hive/hive · 30 tokens

caveman-compress

Compress natural language memory files (CLAUDE.md, todos, preferences) into caveman format to save input tokens. Preserves all technical substance, code, URLs, and structure. Compressed version overwrites the original file. Human-readable backup saved as FILE.original.md. Trigger: /caveman-compress FILEPATH or…

stevesolun/ctx · 77 tokens

continuous-learning-v2

Instinct-based learning system that observes sessions via hooks, creates atomic instincts with confidence scoring, and evolves them into skills/commands/agents.

sangrokjung/claude-forge · 33 tokens

lat-md-knowledge-graph

Design or audit a repo-local markdown knowledge graph with wiki links, source-code backlinks, drift checks, and searchable sections. Use when AGENTS.md/CLAUDE.md is too flat for a large codebase or when a custom harness needs durable structured project memory.

stevesolun/ctx · 60 tokens