explaingit

safishamsi/graphify

📈 Trending49,133PythonAudience · developerComplexity · 3/5ActiveLicenseSetup · hard

TLDR

Convert any folder of files into a queryable knowledge graph that shows concepts, entities, and relationships. Ask structural questions about your codebase or documents without reading everything.

Mindmap

mindmap
  root((repo))
    What it does
      Scans folders for files
      Extracts concepts and relationships
      Builds queryable graph
      Generates interactive visualizations
    Inputs
      Source code files
      Documentation and PDFs
      Images and schemas
      Any file type
    Outputs
      Interactive graph viewer
      Obsidian vault
      Wiki-style documentation
      Summary report
    Tech Stack
      Python
      Tree-sitter parser
      NetworkX graphs
      Leiden clustering
    Use Cases
      Understand large codebases
      Explore document relationships
      Find cross-domain connections
      Reduce AI context usage
    Integration
      Claude Code skill
      Neo4j export
      Git post-commit hook
      File watch auto-sync

Things people build with this

USE CASE 1

Understand the structure and relationships in a large codebase without reading every file.

USE CASE 2

Extract concepts and connections from a collection of documents, PDFs, and images to find surprising cross-domain links.

USE CASE 3

Query a knowledge graph to answer structural questions about your code or documents using 71x fewer tokens than raw files.

USE CASE 4

Generate an interactive graph, wiki, or Obsidian vault from your files for team exploration and documentation.

Tech stack

PythonTree-sitterNetworkXLeiden algorithmClaude APINeo4j

Getting it running

Difficulty · hard Time to first run · 1h+

Requires Neo4j database setup, Claude API key, and multiple Python dependencies including tree-sitter compilation.

Use freely for any purpose including commercial, as long as you keep the copyright notice.

In plain English

Graphify is a Python tool and Claude Code skill that converts any folder of files, source code, documentation, PDFs, images, SQL schemas, shell scripts, or any mix, into a queryable knowledge graph. The core problem it solves is that large codebases and document collections are too big to read in full but too interconnected to understand from any single file. A knowledge graph represents all the concepts, entities, and relationships extracted from your files as nodes and edges, making it possible to ask questions about structure and connections that would otherwise require reading dozens of files. When you run /graphify . inside Claude Code, it scans all files in the directory. For code files, it uses tree-sitter (an AST parser that understands the structure of programming languages) to extract classes, functions, modules, and the call relationships between them. For documents, PDFs, and images it calls Claude's vision and language capabilities to extract concepts and relationships. All of these are merged into a single NetworkX graph, clustered into communities using the Leiden algorithm, and saved as a persistent JSON file. A browser-friendly interactive graph, an Obsidian vault, a Wikipedia-style wiki, and a summary report are also generated. The key benefit is a dramatic reduction in the tokens needed to answer structural questions. Instead of feeding an AI assistant 50 files of raw source code (which may exceed context limits), you query the graph file instead. The README reports 71.5x fewer tokens on a corpus of 52 files. The output includes "god nodes" (the highest-degree concepts everything connects through), surprising cross-domain connections, and automatically suggested questions the graph is uniquely positioned to answer. Every edge is tagged as EXTRACTED (directly stated), INFERRED, or AMBIGUOUS so you know what was found versus guessed. It integrates with Claude Code as a /graphify skill, exports to Neo4j and Gephi-compatible formats, supports file-watch auto-sync, and installs a git post-commit hook for automatic graph updates. The tech stack is pure Python, requiring no server.

Copy-paste prompts

Prompt 1
I have a large codebase in /path/to/project. Run graphify on it to create a knowledge graph, then tell me what the highest-degree concepts are and which files are most central to the architecture.
Prompt 2
Use graphify to convert my documentation folder into a graph, then identify surprising connections between concepts that span multiple documents.
Prompt 3
Set up graphify as a Claude Code skill and use it to scan my project. Show me the automatically suggested questions the graph can answer about my codebase structure.
Prompt 4
I want to integrate graphify into my git workflow. Set up the post-commit hook so the knowledge graph updates automatically, then export it to Neo4j format.
Prompt 5
Run graphify on a mix of source code and documentation files, then generate an interactive HTML graph viewer and an Obsidian vault I can explore.
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.