Sandbox
@Graphify-Labs/graphify

Knowledge graph skill for Claude Code, Cursor, Codex, and Gemini CLI

Graphify maps a repository into a knowledge graph that your agent can query with `/graphify` instead of reading files one by one. It parses code locally with tree-sitter, adds docs and other files through semantic extraction, and writes a browsable graph plus a report.

117,004 stars11k forksPythonUpdated 6d ago
Graphify + Obsidian + Claude Code = CHEAT CODE
Chase AI123k views • 3 months ago

Videos about this repo

Who it's for

Builders who use Claude Code, Cursor, Codex, or Gemini CLI and want a reusable way to inspect large codebases.

What it delivers

You can ask questions about a project and get a graph-backed answer with traced relationships instead of raw file searches.

What it does

Local code graph building

Parses source code with tree-sitter AST locally, without sending code to an LLM.

Explained edges

Marks relationships as `EXTRACTED`, `INFERRED`, or `AMBIGUOUS` so you can see what came from the source and what was resolved.

Query, path, and explain commands

Lets you ask a question, trace the shortest path between two concepts, or inspect one node in context.

Multi-assistant installs

Installs assistant-specific skills and instructions for Claude Code, Codex, Cursor, Gemini CLI, Copilot, and others.

Graph outputs

Generates `graph.html`, `GRAPH_REPORT.md`, and `graph.json` in `graphify-out/` for browsing and reuse.

Extra file support

Handles docs, PDFs, images, video/audio, SQL schemas, configs, and package manifests through optional extras and parsers.

How to get it

  1. 1Step 1 — install the package
    # Recommended (isolated env; if 'graphify' isn't found after, run: uv tool update-shell):
    uv tool install graphifyy
    
    # Alternatives:
    pipx install graphifyy
    pip install graphifyy  # may need PATH setup — see note below
  2. 2Step 2 — register the skill with your AI assistant
    graphify install
  3. 3To install the assistant skill into the current repository instead of your user profile,…
    graphify install --project
    graphify install --project --platform codex
  4. 4Recommended .gitignore additions
    graphify-out/cost.json        # local only
    # graphify-out/cache/         # optional: commit for speed, skip to keep repo small
  5. 5After every git pull (or merge), run graphify update . to bring the graph in sync with…
    git config --global alias.gpull '!git pull && graphify update .'
  6. 6The project uses uv for dev workflow. Install it once, then
    git clone https://github.com/safishamsi/graphify.git
    cd graphify
    git checkout v8                        # active development branch
    
    # Create the project venv and install graphify + all extras + the dev group
    # (pytest). uv installs the dev dependency group by default; pass --no-dev to
    # skip it.
    uv sync --all-extras

README

Graphify

Graphify-Labs%2Fgraphify | Trendshift

Read this in other languages

🇺🇸 English | 🇨🇳 简体中文 | 🇯🇵 日本語 | 🇰🇷 한국어 | 🇩🇪 Deutsch | 🇫🇷 Français | 🇪🇸 Español | 🇮🇳 हिन्दी | 🇧🇷 Português | 🇷🇺 Русский | 🇸🇦 العربية | 🇮🇷 فارسی | 🇮🇹 Italiano | 🇵🇱 Polski | 🇳🇱 Nederlands | 🇹🇷 Türkçe | 🇺🇦 Українська | 🇻🇳 Tiếng Việt | 🇮🇩 Bahasa Indonesia | 🇸🇪 Svenska | 🇬🇷 Ελληνικά | 🇷🇴 Română | 🇨🇿 Čeština | 🇫🇮 Suomi | 🇩🇰 Dansk | 🇳🇴 Norsk | 🇭🇺 Magyar | 🇹🇭 ภาษาไทย | 🇺🇿 Oʻzbekcha | 🇹🇼 繁體中文 | 🇵🇭 Filipino | 🇮🇱 עברית

PyPI Downloads Discord YouTube LinkedIn YC S26

Early access to the graphify platform is open before the public v1 launch: app.graphify.com

Type /graphify in your AI coding assistant and it maps your entire project (code, docs, PDFs, images, videos) into a knowledge graph you can query instead of grepping through files.

  • Code maps for free, fully local. Code is parsed with tree-sitter AST: deterministic, no LLM, nothing leaves your machine. (Docs, PDFs, images and video use your assistant's model, or a configured API key, for a semantic pass.)
  • Every edge is explained. Each connection is tagged EXTRACTED (explicit in the source) or INFERRED (resolved by graphify), so you can tell what was read directly from what was inferred.
  • Not a vector index. No embeddings, no vector store: a real graph you traverse. Ask a question, trace the path between two things, or explain one concept.

Want this always-on, updating in the background across your code, docs, and meetings rather than only on demand? That is what we are building at graphify.com, and early access is open now at app.graphify.com.

graphify's interactive graph.html showing the FastAPI codebase as a force-directed knowledge graph with a legend of detected communities

The FastAPI codebase mapped by graphify. Every node is a concept, colors are detected communities, and the whole thing is clickable in graph.html.

Get started (30 seconds):

uv tool install graphifyy      # install the CLI (or: pipx install graphifyy)
graphify install               # register the skill with your AI assistant

Then, in your AI assistant:

/graphify .

That's it. You get three files:

graphify-out/
├── graph.html       open in any browser — click nodes, filter, search
├── GRAPH_REPORT.md  the highlights: key concepts, surprising connections, suggested questions
└── graph.json       the full graph — query it anytime without re-reading your files

Works in Claude Code, Cursor, Codex, Gemini CLI, GitHub Copilot, and 15+ more — pick your platform.


See it in action

graphify path query: a terminal asks for the shortest path between FastAPI and ModelField, and the answer lights up hop by hop across the knowledge graph

Once the graph is built you query it instead of reading files. Real output, graphify run on the FastAPI codebase shown above:

$ graphify explain "APIRouter"
Node: APIRouter
  Source:    routing.py L2210
  Community: 2
  Degree:    47

Connections (47):
  --> RequestValidationError [uses] [INFERRED]
  --> Dependant [uses] [INFERRED]
  --> .get() [method] [EXTRACTED]
  <-- __init__.py [imports] [EXTRACTED]
  ...

$ graphify path "FastAPI" "ModelField"
Shortest path (3 hops):
  FastAPI --uses--> DefaultPlaceholder <--references-- get_request_handler() --references--> ModelField

Every edge carries a confidence tag (EXTRACTED = explicit in the source, INFERRED = derived by resolution), so you can tell what was read directly from what was inferred. graphify query "<question>" returns a scoped subgraph for a plain-language question, and graphify path A B traces how any two things connect.


What it does

What you get out of the box:

CapabilityWhat you get
God nodesThe most-connected concepts, so you see what everything flows through
CommunitiesThe graph split into subsystems (Leiden), with LLM-free labels
Cross-file linkscalls / imports / inherits / mixes_in resolved across ~40 languages via tree-sitter AST
Query, path, explainAsk a question, trace the path between two things, or explain one concept, all against graph.json
Rationale + doc refs# NOTE: / # WHY: comments and ADR/RFC citations become first-class nodes linked to the code
Beyond codeDocs, PDFs, images, and video/audio all map into the same graph
Local-firstCode is parsed locally with tree-sitter (no LLM, nothing leaves your machine); only the semantic pass over docs/media calls a backend, and only if you configure one

Benchmarks

BenchmarkMetricgraphifyField
LOCOMO (n=300)recall@100.497mem0 0.048, supermemory 0.149
LOCOMO (n=300)QA accuracy45.3%supermemory 49.7%, mem0 27.3%
LongMemEval-S (n=50)QA accuracy76%tied with dense RAG
Graph buildLLM credits0per-token for most systems

Every system ran on the same harness with the same model and budgets, scored by a judge blind-validated against a second judge (90.6% agreement, Cohen's kappa 0.81). Full per-system tables, the code-intelligence result, and reproduction commands: BENCHMARKS.md.


Prerequisites

RequirementMinimumCheckInstall
Python3.10+python --versionpython.org
uv (recommended)anyuv --versioncurl -LsSf https://astral.sh/uv/install.sh | sh
pipx (alternative)anypipx --versionpip install pipx

macOS quick install (Homebrew):

brew install python@3.12 uv

Windows quick install:

winget install astral-sh.uv

Ubuntu/Debian:

sudo apt install python3.12 python3-pip pipx
# or install uv:
curl -LsSf https://astral.sh/uv/install.sh | sh

Install

Official package: The PyPI package is graphifyy (double-y). Other graphify* packages on PyPI are not affiliated. The CLI command is still graphify.

Step 1 — install the package:

# Recommended (isolated env; if 'graphify' isn't found after, run: uv tool update-shell):
uv tool install graphifyy

# Alternatives:
pipx install graphifyy
pip install graphifyy  # may need PATH setup — see note below

Step 2 — register the skill with your AI assistant:

graphify install

That's it. Open your AI assistant and type /graphify .

To install the assistant skill into the current repository instead of your user profile, add --project:

graphify install --project
graphify install --project --platform codex

Project-scoped installs write under the current directory, for example .claude/skills/graphify/SKILL.md or .agents/skills/graphify/SKILL.md (plus a references/ sidecar the skill loads on demand), and print a git add hint for files that can be committed. Per-platform commands that support project-scoped installs accept the same flag, for example graphify claude install --project or graphify codex install --project.

PowerShell note: Use graphify . not /graphify . — the leading slash is a path separator in PowerShell.

graphify: command not found? uv tool install / pipx install put the graphify command in their tool bin dir (~/.local/bin). If your shell can't find it right after install — common on a fresh macOS + zsh setup — that dir isn't on your PATH yet: run uv tool update-shell (or pipx ensurepath), then open a new terminal. With plain pip, add ~/.local/bin (Linux) or ~/Library/Python/3.x/bin (Mac) to your PATH, or run python -m graphify.

Running with uvx / uv tool run instead of installing? Name the package, not the command: uvx --from graphifyy graphify install. Plain uvx graphify … fails (No solution found … no versions of graphify) because uv tool run reads the first word as a package, and the package is graphifyy — the graphify command lives inside it.

Avoid pip install on Mac/Windows if possible. The skill resolves Python at runtime from graphify-out/.graphify_python; if that points to a different environment than where pip installed the package, you'll get ModuleNotFoundError: No module named 'graphify'. uv tool install and pipx install isolate the package in their own env and avoid this entirely.

Git hooks and uv tool / pipx: graphify hook install embeds the current interpreter path directly into the hook scripts at install time, so the post-commit hook fires correctly even in GUI git clients and CI runners where ~/.local/bin is not on PATH. If you reinstall or upgrade graphify, re-run graphify hook install to refresh the embedded path.

Strict mode (Claude Code): graphify install --project --strict makes the assistant actually use the graph. The default install nudges it to run graphify query before reading files; strict mode blocks the first raw source read of a session and redirects it to the graph, then reverts to the nudge (so it fires at most once per session and never gets stuck). Toggle at runtime with GRAPHIFY_HOOK_STRICT=1/0; the default install is unchanged (soft nudge).

Pick your platform (20+ assistants, click to expand)
PlatformInstall command
Claude Code (Linux/Mac)graphify install
Claude Code (Windows)graphify install (auto-detected) or graphify install --platform windows
CodeBuddygraphify install --platform codebuddy
Codexgraphify install --platform codex
OpenCodegraphify install --platform opencode
Kilo Codegraphify install --platform kilo
GitHub Copilot CLIgraphify install --platform copilot
VS Code Copilot Chatgraphify vscode install
Aidergraphify install --platform aider
OpenClawgraphify install --platform claw
Factory Droidgraphify install --platform droid
Traegraphify install --platform trae
Trae CNgraphify install --platform trae-cn
Gemini CLIgraphify install --platform gemini
Hermesgraphify install --platform hermes
Kimi Codegraphify install --platform kimi
Ampgraphify amp install
Agent Skills (cross-framework)graphify install --platform agents (alias --platform skills)
Kiro IDE/CLIgraphify kiro install
Pi coding agentgraphify install --platform pi
Cursorgraphify cursor install
Devin CLIgraphify devin install
Google Antigravitygraphify antigravity install

Codex users also need multi_agent = true under [features] in ~/.codex/config.toml for parallel extraction. CodeBuddy uses the same Agent tool and PreToolUse hook mechanism as Claude Code. Factory Droid uses the Task tool for parallel subagent dispatch. OpenClaw and Aider use sequential extraction (parallel agent support is still early on those platforms). Trae uses the Agent tool for parallel subagent dispatch and does not support PreToolUse hooks, so AGENTS.md is the always-on mechanism.

--platform agents (alias --platform skills) targets the generic cross-framework Agent-Skills locations: the spec's user-global ~/.agents/skills/ (read by npx skills and spec-compliant frameworks) for a global install, and ./.agents/skills/ for a project (--project) install. The bare graphify install stays single-platform (Claude Code) by design — use the named agents platform when you want the skill discoverable by any framework that reads .agents/skills.

Codex uses $graphify instead of /graphify.

Optional extras (install only what you need)
ExtraWhat it addsInstall
pdfPDF extractionuv tool install "graphifyy[pdf]"
office.docx and .xlsx supportuv tool install "graphifyy[office]"
googleGoogle Sheets renderinguv tool install "graphifyy[google]"
videoVideo/audio transcription (faster-whisper + yt-dlp)uv tool install "graphifyy[video]"
mcpMCP stdio serveruv tool install "graphifyy[mcp]"
neo4jNeo4j push supportuv tool install "graphifyy[neo4j]"
falkordbFalkorDB push supportuv tool install "graphifyy[falkordb]"
svgSVG graph exportuv tool install "graphifyy[svg]"
leidenLeiden community detection (Python < 3.13 only)uv tool install "graphifyy[leiden]"
ollamaOllama local inferenceuv tool install "graphifyy[ollama]"
openaiOpenAI / OpenAI-compatible APIsuv tool install "graphifyy[openai]"
geminiGoogle Gemini APIuv tool install "graphifyy[gemini]"
anthropicAnthropic Claude API (--backend claude, uses ANTHROPIC_API_KEY)uv tool install "graphifyy[anthropic]"
bedrockAWS Bedrock (uses IAM, no API key)uv tool install "graphifyy[bedrock]"
azureAzure OpenAI Service (--backend azure, uses AZURE_OPENAI_API_KEY + AZURE_OPENAI_ENDPOINT)uv tool install "graphifyy[openai]"
sqlSQL schema extractionuv tool install "graphifyy[sql]"
postgresLive PostgreSQL introspection (--postgres DSN)uv tool install "graphifyy[postgres]"
dmBYOND DreamMaker .dm/.dme AST extraction (may need a C compiler + python3-dev if no wheel matches your platform)uv tool install "graphifyy[dm]"
terraformTerraform / HCL .tf/.tfvars/.hcl AST extractionuv tool install "graphifyy[terraform]"
pascalPascal / Delphi .pas/.dpr/.dpk/.inc AST extraction (more accurate calls/inherits edges; falls back to a regex extractor when absent)uv tool install "graphifyy[pascal]"
ocamlOCaml .ml/.mli AST extractionuv tool install "graphifyy[ocaml]"
commonlispCommon Lisp .lisp/.cl/.lsp/.asd AST extractionuv tool install "graphifyy[commonlisp]"
robotRobot Framework .robot/.resource extraction (suites, test cases, keywords, keyword-call and resource/library import edges)uv tool install "graphifyy[robot]"
chineseChinese query segmentation (jieba)uv tool install "graphifyy[chinese]"
allEverything aboveuv tool install "graphifyy[all]"

Make your assistant always use the graph

Run this once in your project after building a graph:

PlatformCommand
Claude Codegraphify claude install
CodeBuddygraphify codebuddy install
Codexgraphify codex install
OpenCodegraphify opencode install
Kilo Codegraphify kilo install
GitHub Copilot CLIgraphify copilot install
VS Code Copilot Chatgraphify vscode install
Aidergraphify aider install
OpenClawgraphify claw install
Factory Droidgraphify droid install
Traegraphify trae install
Trae CNgraphify trae-cn install
Cursorgraphify cursor install
Gemini CLIgraphify gemini install
Hermesgraphify hermes install
Kimi Codegraphify install --platform kimi
Ampgraphify amp install
Agent Skills (cross-framework)graphify agents install (alias graphify skills install)
Kiro IDE/CLIgraphify kiro install
Pi coding agentgraphify pi install
Devin CLIgraphify devin install
Google Antigravitygraphify antigravity install

This writes a small config file that tells your assistant to consult the knowledge graph for codebase questions, preferring scoped queries like graphify query "<question>" over reading the full report or grepping raw files.

  • Hook platforms (Claude Code, Gemini CLI): a hook fires automatically before search-style tool calls (and, on Claude Code, before reading source files one by one via the Read/Glob tools) and nudges your assistant toward the graph path.
  • Instruction-file platforms (Codex, OpenCode, Cursor, etc.): persistent instruction files (AGENTS.md, .cursor/rules/, etc.) provide the same query-first guidance.

GRAPH_REPORT.md is still available for broad architecture review.

CodeBuddy does the same two things as Claude Code: writes a CODEBUDDY.md section telling CodeBuddy to read graphify-out/GRAPH_REPORT.md before answering architecture questions, and installs PreToolUse hooks (.codebuddy/settings.json) that fire before Bash search commands and file reads, nudging toward graphify query instead.

Codex writes to AGENTS.md, which is what actually carries the always-on graph guidance on this platform. graphify codex install also registers a PreToolUse hook in .codex/hooks.json (graphify hook-check), but that entry is deliberately a no-op: Codex Desktop rejects hookSpecificOutput.additionalContext on PreToolUse, so emitting a nudge there would break Bash tool calls. Unlike Claude Code, where the hook (graphify hook-guard) does the nudging, on Codex the hook fires and intentionally does nothing, and AGENTS.md is the always-on mechanism.

Kilo Code installs the Graphify skill to ~/.config/kilo/skills/graphify/SKILL.md and a native /graphify command to ~/.config/kilo/command/graphify.md. graphify kilo install also writes AGENTS.md plus a native tool.execute.before plugin (.kilo/plugins/graphify.js + .kilo/kilo.json or .kilo/kilo.jsonc registration) so Kilo gets the same always-on graph reminder behavior through native .kilo config.

Cursor writes .cursor/rules/graphify.mdc with alwaysApply: true, so Cursor includes it in every conversation automatically, no hook needed.

To remove graphify from all platforms at once: graphify uninstall (add --purge to also delete graphify-out/). Or use the per-platform command (e.g. graphify claude uninstall).


What's in the report

  • God nodes — the most-connected concepts in your project. Everything flows through these.
  • Surprising connections — links between things that live in different files or modules. Ranked by how unexpected they are.
  • The "why" — inline comments (# NOTE:, # WHY:, # HACK:), docstrings, and design rationale from docs are extracted as separate nodes linked to the code they explain.
  • Suggested questions — 4–5 questions the graph is uniquely positioned to answer.
  • Confidence tags — every inferred relationship is marked EXTRACTED, INFERRED, or AMBIGUOUS. You always know what was found vs guessed.

What files it handles

TypeExtensions
Code (37 tree-sitter grammars).py .ts .mts .cts .js .jsx .tsx .mjs .go .rs .java .c .cpp .cc .cxx .h .hpp .cu .cuh .metal .rb .cs .kt .kts .scala .php .swift .lua .luau .toc .zig .ps1 .psm1 .psd1 .ex .exs .m .mm .ml .mli .jl .vue .svelte .astro .groovy .gradle .dart .v .sv .svh .sql .f .f90 .f95 .f03 .f08 .pas .pp .dpr .dpk .lpr .inc .dfm .lfm .lpk .sh .bash .json .dm .dme .dmi .dmm .dmf .sln .slnx .csproj .fsproj .vbproj .xaml .razor .cshtml (.dm/.dme requires uv tool install graphifyy[dm], .ml/.mli requires uv tool install graphifyy[ocaml]; .mts/.cts reuse the TypeScript grammar, .cc/.cxx and CUDA .cu/.cuh and Metal .metal reuse the C++ grammar)
Salesforce Apex.cls .trigger (regex-based; classes, interfaces, enums, methods, triggers, SOQL/DML edges)
Terraform / HCL.tf .tfvars .hcl (requires uv tool install graphifyy[terraform])
OCaml.ml .mli (requires uv tool install graphifyy[ocaml])
Common Lisp.lisp .cl .lsp .asd (requires uv tool install graphifyy[commonlisp])
Robot Framework.robot .resource (via the official robot.api parser, requires uv tool install graphifyy[robot]; suites, test cases, user keywords, keyword-call and Resource/Library/Variables import edges)
MCP configs.mcp.json mcp.json mcp_servers.json claude_desktop_config.json — extracts server nodes, package refs, env var requirements
Package manifestsapm.yml pyproject.toml go.mod pom.xml — one canonical package node per package (by name) plus depends_on edges, so a package referenced from many manifests is a single hub
Docs.md .mdx .qmd .html .txt .rst .yaml .yml (markdown [text](./other.md) links and [[wikilinks]] become references edges between

Files in the repo

Repository payload23 top-level entries
  • .github
  • docs
  • graphify
  • scripts
  • tests
  • tools
  • worked
  • .dockerignore
  • .gitattributes
  • .gitignore
  • .pre-commit-config.yaml
  • AGENTS.md
  • ARCHITECTURE.md
  • BENCHMARKS.md
  • CHANGELOG.md
  • Dockerfile
  • LICENSE
  • LICENSE-MIT
  • NOTICE
  • pyproject.toml
  • README.md
  • SECURITY.md
  • uv.lock

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More skills

obra/
superpowers

An agentic skills framework & software development methodology that works.

285k
1 add
Vincentwei1021/
anything2explainer

Topic in, narrated explainer video out. A Claude Code / Codex skill that turns any topic into a black-canvas motion-graphics explainer video with TTS voiceover, subtitles and a chapter progress bar. Chinese or English; every frame drawn in code with Remotion.

666

Open-source AI job search: scan job portals, evaluate listings into a structured A-H report with a global 1-5 score, tailor your CV, track applications — runs locally in your AI coding CLI (Claude Code, Codex, OpenCode, Antigravity…)

71k