Graphify

AI coding assistant skill β€” type /graphify in Claude Code (or Codex, Cursor, Gemini CLI, OpenCode, OpenClaw, Aider, Trae) and you get an interactive knowledge graph from any folder. Code, docs, papers, screenshots, diagrams β€” everything lands in a single graph.

πŸ—’οΈ Description

Graphify runs in two passes:

  1. AST pass (deterministic) β€” tree-sitter extracts structure from code (classes, functions, imports, call graphs) without an LLM
  2. Semantic pass β€” Claude subagents process docs, papers, images in parallel, pulling out concepts + relationships

Result: NetworkX graph β†’ Leiden community detection β†’ interactive HTML + queryable JSON + audit report.

Key features:

  • 71.5x token reduction vs reading raw files (on a 52-file corpus: code + papers + images)
  • Confidence scoring β€” every edge tagged EXTRACTED (1.0), INFERRED (0.0-1.0), or AMBIGUOUS
  • Multimodal β€” Claude vision on screenshots, diagrams, whiteboard photos, images in 20 languages
  • 20 languages via tree-sitter AST (Python, JS, TS, Go, Rust, Java, C, C++, Ruby, C#, Kotlin, Scala, PHP, Swift, Lua, Zig, PowerShell, Elixir, Objective-C, Julia)
  • SHA256 cache β€” re-runs only process changed files
  • Auto-sync (--watch) β€” the graph updates automatically as code changes
  • Git hooks β€” rebuild after commit and branch switch
  • Wiki export (--wiki) β€” Wikipedia-style markdown articles per community
  • Always-on hook β€” surfaces GRAPH_REPORT.md before every Glob/Grep call, the agent navigates the graph instead of grepping raw files

Download or use

pip install graphifyy && graphify install

GitHub: safishamsi/graphify

Commands:

/graphify .                        # current directory
/graphify ./raw --mode deep        # aggressive INFERRED edges
/graphify ./raw --update           # only changed files
/graphify query "what connects X to Y?"
/graphify path "NodeA" "NodeB"
/graphify explain "SwinTransformer"

πŸ—’οΈ Reasoning for

I have this skill installed in Claude Code β€” ~/.claude/skills/graphify/SKILL.md. I use it to understand large codebases and the relationships between files. Especially handy when:

  • I enter a new project and need an architecture map
  • I want to find the β€œwhy” behind design decisions (rationale extraction from comments and docs)
  • I need context compression β€” graph.json instead of raw files in the prompt

Graphify is a response to Karpathy’s /raw folder problem β€” instead of reading everything, you query a compact graph.

🧩 Output Structure

graphify-out/
β”œβ”€β”€ graph.html       # interactive visualization β€” click nodes, search, filter
β”œβ”€β”€ GRAPH_REPORT.md  # god nodes, surprising connections, suggested questions
β”œβ”€β”€ graph.json       # persistent graph β€” query weeks later
└── cache/           # SHA256 cache β€” incremental processing

Alternatives considered

  • RAG with a vector DB β€” the Claude Code team tested it and dropped it: code drifts out of sync, permissions are complex. Agentic search (glob + grep) beats RAG
  • Manual codebase reading β€” doesn’t scale, 71x more tokens
  • GitHub Copilot @workspace β€” doesn’t build a persistent graph, doesn’t do cross-file semantic analysis
  • Manual Neo4j setup β€” Graphify exports to Neo4j (--neo4j-push) but doesn’t require it to operate

πŸ“– Resources


Template: tool