Agent skill

Code Graph

by alinaqi in alinaqi/maggy

AST-based code graph for fast symbol lookup, dependency analysis, and blast radius via codebase-memory-mcp MCP server

MITAuto-check passedAgent Workflows

Install Code Graph

skills CLI
$ npx skills add alinaqi/maggy --skill code-graph -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install alinaqi/maggy code-graph --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/alinaqi/maggy.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/code-graph .claude/skills/code-graph && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
code-graph
GitHub stars
707
Token cost
~2k tokens
SKILL.md length
663 words
Files
1
Skills in repo
71
Repo updated
First seen
Licence
MIT

At a glance

AST-based code graph for fast symbol lookup, dependency analysis, and blast radius via codebase-memory-mcp MCP server

  • Tasks that involve MCP servers
  • SKILL.md covers Core Principle, When to Use Graph vs Direct Read, Available MCP Tools and Workflow: Before Any Code Change, plus 4 more sections
  • Calls git

What it does

Code Graph is an agent skill from alinaqi/maggy. AST-based code graph for fast symbol lookup, dependency analysis, and blast radius via codebase-memory-mcp MCP server

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Agent Workflows, covering MCP servers. It works with Model Context Protocol. The repository describes itself as: What started as an opinionated Claude Code setup kit is now an autonomous AI engineering command center. The licence is MIT.

When your agent uses it

  • Tasks that involve MCP servers

Example prompts

  • “/code-graph”

What it can do on your machine

Read from SKILL.md and the folder at commit 72a456e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Code Graph loads about 2k tokens when it runs. Until then it costs about 32 tokens; SKILL.md has 663 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~32
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from alinaqi/maggy at commit 72a456e, republished under its MIT licence (© alinaqi). 663 words, ~2,033 tokens.

Download SKILL.mdSave it as .claude/skills/code-graph/SKILL.md (or your agent's skills folder).
name
code-graph
description
AST-based code graph for fast symbol lookup, dependency analysis, and blast radius via codebase-memory-mcp MCP server
when-to-use
Before reading files — query the graph first for symbol lookup, call tracing, and blast radius
user-invocable
false
effort
medium

Code Graph Skill

Purpose: Use the code graph (codebase-memory-mcp) for sub-millisecond symbol lookup, function search, dependency analysis, and blast radius detection. This replaces brute-force grep and file reading for code navigation.


Core Principle

Graph first, file second. Before reading files or grepping, query the code graph. Only read full files when you need to modify them or need context beyond what the graph provides.

Consider graph when planning. When planning any change — feature, refactor, bug fix — start by querying the graph to understand scope, dependencies, and blast radius. This applies to thinking and planning phases, not just implementation. Grep is still the right tool for searching string literals, log messages, config values, and content that lives outside code structure.

┌────────────────────────────────────────────────────────────────┐
│  GRAPH FIRST, FILE SECOND                                      │
│  ─────────────────────────────────────────────────────────────│
│  The code graph indexes your entire codebase as a persistent   │
│  knowledge graph. Claude queries it via MCP for instant         │
│  symbol lookup, dependency chains, and blast radius — instead   │
│  of reading hundreds of files.                                 │
│                                                                │
│  14 MCP tools │ 64 languages │ sub-ms queries │ zero deps      │
│  ~99% fewer tokens for navigation vs brute-force file reads    │
├────────────────────────────────────────────────────────────────┤
│  AUTO-UPDATED                                                  │
│  ─────────────────────────────────────────────────────────────│
│  File watcher keeps graph in sync. Post-commit hook ensures    │
│  freshness. No manual rebuild needed.                          │
└────────────────────────────────────────────────────────────────┘

When to Use Graph vs Direct Read

TaskUse Graph ToolUse Direct Read?
Find function/class definitionsearch_graphNo
Get function signature + docsget_code_snippetNo
Find all callers of a functiontrace_call_pathNo
Trace dependency chainquery_graphNo
Determine blast radius of changedetect_changesNo
Understand project architectureget_architectureNo
Search for code patternssearch_codeNo
Read full implementation to modifysearch_graph to locate, then Read fileYes
Understand business logic contextget_code_snippet for overview, then ReadYes

Rule: If a graph tool can answer the question, use it. Only open files when you need the full source to make edits.


Available MCP Tools

Indexing & Status
ToolPurposeWhen to Use
index_repositoryBuild/rebuild graph for a projectFirst setup, or after major restructure
index_statusCheck if graph is currentBefore querying, if unsure of freshness
list_projectsList all indexed projectsMulti-project navigation
Querying & Navigation
ToolPurposeWhen to Use
search_graphFind symbols by name (fuzzy)"Find auth-related functions"
search_codeText search across indexed codebase"Find TODO comments", pattern matching
get_code_snippetGet source code for a specific symbolNeed signature, docstring, implementation
get_graph_schemaUnderstand graph structure and relationshipsExploring what data is available
query_graphRun structured graph queriesComplex dependency/relationship queries
Analysis
ToolPurposeWhen to Use
trace_call_pathTrace caller/callee chains"Who calls sendEmail?", "What does init() trigger?"
detect_changesIdentify changed files and blast radiusBefore/after code changes, PR review
get_architectureHigh-level module/package structureOnboarding, understanding project layout
Management
ToolPurposeWhen to Use
delete_projectRemove a project from the graphCleanup, project restructure
manage_adrArchitecture decision recordsDocument architectural decisions
ingest_tracesImport runtime tracesPerformance analysis, dead code detection

Show full SKILL.md (275 more words)Show less

Workflow: Before Any Code Change

0. PLAN       → get_architecture + search_graph to understand scope before planning
1. LOCATE     → search_graph to find the symbol
2. UNDERSTAND → get_code_snippet for context
3. BLAST      → detect_changes to assess impact
4. TRACE      → trace_call_path to find all affected callers
5. CHANGE     → Read file, make edit
6. VERIFY     → detect_changes again to confirm scope

Step 0 applies to planning, not just coding. When the user asks you to plan a feature, refactor, or fix — query the graph first to understand what exists, what depends on what, and what the scope looks like. This prevents plans based on wrong assumptions about the codebase.

Never skip step 3. Blast radius analysis prevents unexpected breakage from changes to shared code.


Graph Data & Freshness

The graph stays fresh automatically through 3 layers — no manual rebuild needed:

LayerTriggerWhat Happens
File watcherEvery file savecodebase-memory-mcp detects changes and re-indexes affected files in real-time
Auto-indexSession startauto_index: true ensures graph is current when Claude Code starts
Post-commit hookEvery git commitTouches .code-graph/.needs-update marker — file watcher picks it up (~10ms, non-blocking)

You do NOT need to manually re-index unless you do a major restructure (rename entire directories, switch branches with massive diffs). In that case: index_repository once, then the 3 layers keep it fresh.

  • Storage: .code-graph/ directory (auto-created, gitignored)
  • MCP config: .mcp.json at project root (committed, shared with team)

MCP Configuration

The code graph MCP server is configured in .mcp.json at project root:

json
{
  "mcpServers": {
    "codebase-memory": {
      "command": "codebase-memory-mcp",
      "args": []
    }
  }
}

Installation: ~/.claude/install-graph-tools.sh


Decision Framework

Need to find a symbol/function?
  → search_graph (sub-ms, structured result)
  → NOT: grep -r "functionName" (slow, unstructured)

Need to understand dependencies?
  → query_graph or trace_call_path (complete, traversable)
  → NOT: manually reading import statements

Need to assess change impact?
  → detect_changes (comprehensive, instant)
  → NOT: searching for usages manually across files

Need to understand architecture?
  → get_architecture (high-level overview)
  → NOT: reading every directory listing

Need to read/modify code?
  → search_graph to locate, then Read the specific file
  → NOT: reading entire directories hoping to find it

Anti-Patterns

Anti-PatternDo This Instead
Grepping for function namessearch_graph with the function name
Reading entire files to find a signatureget_code_snippet for the specific symbol
Manually tracing import chainstrace_call_path or query_graph
Making changes without checking impactdetect_changes before every edit to shared code
Reading all files in a directoryget_architecture for structure, search_graph for specifics
Ignoring graph staleness warningsCheck index_status, re-index if needed
Re-indexing on every queryTrust the file watcher; only manual re-index after major restructure

© alinaqi, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/code-graph of alinaqi/maggy.

Open the folder on GitHubat commit 72a456e

Compare with similar skills

Code Graph next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Code Graph compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Code Graph this skillalinaqi/maggy707—~2kAutomated safety check: PassMIT
MCP Server Builderanthropics/skills180k64 repos~2.3kAutomated safety check: PassApache-2.0
MCP Server BuildershareAI-lab/learn-claude-code78k5 repos~1.2kAutomated safety check: PassMIT
MCP Integration for Pluginsanthropics/claude-plugins-official38k11 repos~3.1kAutomated safety check: PassApache-2.0
Fastmcp Client CLIPrefectHQ/fastmcp28k1 repos~823Automated safety check: PassApache-2.0
Crush Configurationcharmbracelet/crush29k—~3.7kAutomated safety check: PassCustom licence

Similar skills

  • MCP Server Builder

    anthropics/skills

    Official

    Guides the design and implementation of Model Context Protocol servers in TypeScript or Python, from tool naming and error messages to evaluation.

    180k GitHub starsUsed in 64 repos~2.3k tokens
    Agent WorkflowsAuto-check passed
  • MCP Server Builder

    shareAI-lab/learn-claude-code

    Walks through building MCP servers in Python or TypeScript that expose tools, resources and prompts to Claude, with templates, registration and testing.

    78k GitHub starsUsed in 5 repos~1.2k tokens
    Agent WorkflowsAuto-check passed
  • MCP Integration for Plugins

    anthropics/claude-plugins-official

    Official

    Explains how to bundle Model Context Protocol servers in a Claude Code plugin, covering config files, stdio, SSE, HTTP and WebSocket server types, and authentication.

    38k GitHub starsUsed in 11 repos~3.1k tokens
    Agent WorkflowsAuto-check passed
  • Fastmcp Client CLI

    PrefectHQ/fastmcp

    Query and invoke tools on MCP servers using fastmcp list and fastmcp call.

    28k GitHub starsUsed in 1 repo~823 tokens
    Agent WorkflowsAuto-check passed
  • Crush Configuration

    charmbracelet/crush

    Explains how to configure the Crush coding agent with crushrc or crush.json, covering providers, models, LSPs, MCP servers, hooks, permissions and config precedence.

    29k GitHub stars~3.7k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Context Mode Output Sandbox

    mksglu/context-mode

    Routes large command, file, API and browser output through context-mode tools so only the needed result enters the agent's context, instead of dumping it via Bash.

    26k GitHub stars~4.1k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed

More from alinaqi/maggy

All 71 skills in this repo
  • AI Models

    alinaqi/maggy

    Latest AI models reference - Claude, OpenAI, Gemini, Eleven Labs, Replicate

    707 GitHub starsUsed in 1 repo~4.1k tokens
    Auto-check passed
  • Azure Cosmosdb

    alinaqi/maggy

    Azure Cosmos DB partition keys, consistency levels, change feed, SDK patterns

    707 GitHub starsUsed in 1 repo~4.5k tokens
    Auto-check passed
  • LLM Patterns

    alinaqi/maggy

    AI-first application patterns, LLM testing, prompt management

    707 GitHub starsUsed in 1 repo~2.1k tokens
    Auto-check passed
  • Woocommerce

    alinaqi/maggy

    WooCommerce REST API - products, orders, customers, webhooks

    707 GitHub starsUsed in 1 repo~4.4k tokens
    Auto-check: notes
  • Aeo Optimization

    alinaqi/maggy

    AI Engine Optimization - semantic triples, page templates, content clusters for AI citations

    707 GitHub stars~3.7k tokensUpdated 14 days ago
    Auto-check passed
  • Agent Teams

    alinaqi/maggy

    Claude Code Agent Teams - default team-based development with strict TDD pipeline enforcement

    707 GitHub stars~5k tokensUpdated 14 days ago
    Auto-check: notes

Categories

Questions about Code Graph

What does Code Graph do?

AST-based code graph for fast symbol lookup, dependency analysis, and blast radius via codebase-memory-mcp MCP server. Code Graph is an agent skill from alinaqi/maggy.

When should I use Code Graph?

Code Graph fits situations like: tasks that involve MCP servers.

How do I install Code Graph in Claude Code?

Run `npx skills add alinaqi/maggy --skill code-graph -a claude-code`. Or copy the skill folder (skills/code-graph in alinaqi/maggy) into .claude/skills/code-graph in your project. Claude Code loads it when a task matches its description.

How do I install Code Graph in Codex?

Run `npx skills add alinaqi/maggy --skill code-graph -a codex`. Or copy the skill folder (skills/code-graph in alinaqi/maggy) into .agents/skills/code-graph in your project. Codex loads it when a task matches its description.

Can I use Code Graph in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add alinaqi/maggy --skill code-graph -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/code-graph, .gemini/skills/code-graph, .github/skills/code-graph and .opencode/skills/code-graph in your project.

What does Code Graph need to run?

Going by SKILL.md and its folder, Code Graph needs the command-line tools its instructions call (git).

Does Code Graph access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Code Graph safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Code Graph use?

Code Graph is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Code Graph use?

About 2k tokens (SKILL.md is roughly 8.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Code Graph?

Skills that share tags, products or a category with Code Graph: MCP Server Builder (anthropics/skills, 180k stars), MCP Server Builder (shareAI-lab/learn-claude-code, 78k stars), MCP Integration for Plugins (anthropics/claude-plugins-official, 38k stars) and Fastmcp Client CLI (PrefectHQ/fastmcp, 28k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Code Graph?

alinaqi (a GitHub user) maintains it in alinaqi/maggy, which has 707 GitHub stars. The repository holds 71 skills in this directory. The repository was last updated on September 24, 2026.

Source: alinaqi/maggy on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.