Back to Skills

Graphify

Official

by safishamsi

knowledge graph skillClaude Code skillcodebase visualizationAI coding assistantcode analysis tooltree-sitter AST

Graphify turns any folder of code, documentation, research papers, or images into a queryable knowledge graph. Type /graphify in your AI coding assistant, and it reads your files, builds a graph of entities and relationships, and returns structure you didn't know was there. The two-pass extraction system is what makes it work. Pass one: deterministic AST analysis via tree-sitter for code files across 20 languages (Python, JavaScript, TypeScript, Go, Rust, Java, C, C++, Ruby, C#, Kotlin, Scala, PHP, Swift, Lua, Zig, PowerShell, Elixir, Objective-C, Julia). Pass two: LLM-powered semantic extraction for documentation, PDFs, and images. Code files stay local — only docs and images go through your LLM API. Every relationship gets a confidence tag: EXTRACTED (found directly in source), INFERRED (reasonable inference with a 0.0-1.0 confidence score), or AMBIGUOUS (flagged for review). The graph uses Leiden community detection for clustering — no embeddings needed. Token efficiency is aggressive: 71.5x fewer tokens per query compared to reading raw files. The graph persists across sessions via SHA256-based change detection, so you don't rebuild everything on every query. Fully multimodal: processes .py, .ts, .js, .go, .rs, .java files through AST extraction; .md, .txt, .rst through concept extraction; .pdf through citation mining; .png, .jpg, .webp through Claude vision for diagrams and screenshots; and .docx/.xlsx through markdown conversion. Compatible with Claude Code, Codex, OpenCode, Cursor, Gemini CLI, GitHub Copilot CLI, Aider, OpenClaw, Factory Droid, and Trae. Outputs an interactive HTML visualization, a GRAPH_REPORT.md summary, and a persistent graph.json. Auto-sync mode (--watch) rebuilds on file changes, and git hooks trigger rebuilds on commits. 19,400 stars and 2,000 forks. MIT licensed. Explore related AI coding tools or browse more developer repositories for codebase analysis and visualization.

Installation

pip install graphifyy && graphify install

Key Features

  • Two-pass extraction: deterministic AST analysis (code) + LLM semantic extraction (docs/images)
  • 20 programming languages via tree-sitter AST parsing
  • Confidence scoring on all relationships (EXTRACTED, INFERRED, AMBIGUOUS with 0.0-1.0 scores)
  • 71.5x fewer tokens per query versus reading raw files
  • Fully multimodal: code, markdown, PDFs, images, Office documents
  • Interactive HTML visualization with search and community filtering
  • Auto-sync via --watch mode and git hooks for automatic rebuilds
  • Leiden community detection for graph clustering without embeddings
  • God nodes identification — highest-degree concepts in your codebase
  • Compatible with 10+ AI coding assistants including Claude Code, Codex, and Cursor

Use Cases

  • Onboarding to unfamiliar codebases by visualizing architecture and dependencies
  • Understanding cross-domain relationships between code, documentation, and research papers
  • Auditing codebases for hidden dependencies and surprising connections between modules
  • Building persistent context for AI coding assistants that survives across sessions
  • Analyzing multimodal repositories with mixed code, diagrams, and documentation

Related Resources

Weekly AI Digest