# graphify
An AI coding assistant skill. Type /graphify in Claude Code, Codex, OpenCode, OpenClaw, or Factory Droid - it reads your files, builds a knowledge graph, and gives you back structure you didn’t know was there. Understand a codebase faster. Find the "why" behind architectural decisions.
Fully multimodal. Drop in code, PDFs, markdown, screenshots, diagrams, whiteboard photos, even images in other languages - graphify uses Claude vision to extract concepts and relationships from all of it and connects them into one graph.
> Andrej Karpathy keeps a /raw folder where he drops papers, tweets, screenshots, and notes. graphify is the answer to that problem - 71.5x fewer tokens per query vs reading the raw files, persistent across sessions, honest about what it found vs guessed.
/graphify . # works on any folder - your codebase, notes, papers, anything
graphify-out/
├── graph.html interactive graph - click nodes, search, filter by community
├── GRAPH_REPORT.md god nodes, surprising connections, suggested questions
├── graph.json persistent graph - query weeks later without re-reading
└── cache/ SHA256 cache - re-runs only process changed files
Add a .graphifyignore file to exclude folders you don’t want in the graph:
# .graphifyignore vendor/ node_modules/ dist/ *.generated.py
Same syntax as .gitignore. Patterns match against file paths relative to the folder you run graphify on.
How it works
graphify runs in two passes. First, a deterministic AST pass extracts structure from code files (classes, functions, imports, call graphs, docstrings, rationale comments) with no LLM needed. Second, Claude subagents run in parallel over docs, papers, and images to extract concepts, relationships, and design rationale. The results are merged into a NetworkX graph, clustered with Leiden community detection, and exported as interactive HTML, queryable JSON, and a plain-language audit report.
Clustering is graph-topology-based — no embeddings. Leiden finds communities by edge density. The semantic similarity edges that Claude extracts (semantically_similar_to, marked INFERRED) are already in the graph, so they influence community detection directly. The graph structure is the similarity signal — no separate embedding step or vector database needed.
Every relationship is tagged EXTRACTED (found directly in source), INFERRED (reasonable inference, with a confidence score), or AMBIGUOUS (flagged for review). You always know what was found vs guessed.
Install
Requires: Python 3.10+ and one of: Claude Code, Codex, OpenCode, OpenClaw, or Factory Droid
pip install graphifyy && graphify install
> The PyPI package is temporarily named graphifyy while the graphify name is being reclaimed. The CLI and skill command are still graphify.
Platform support
| Platform | Install command |
|---|---|
| Claude Code (Linux/Mac) | graphify install |
| Claude Code (Windows) | graphify install (auto-detected) or graphify install --platform windows |
| Codex | graphify install --platform codex |
| OpenCode | graphify install --platform opencode |
| OpenClaw | graphify install --platform claw |
| Factory Droid | graphify install --platform droid |
Codex users also need multi_agent = true under [features] in ~/.codex/config.toml for parallel extraction. Factory Droid uses the Task tool for parallel subagent dispatch. OpenClaw uses sequential extraction (parallel agent support is still early on that platform).
Then open your AI coding assistant and type:
/graphify .
Make your assistant always use the graph (recommended)
After building a graph, run this once in your project:
| Platform | Command |
|---|---|
| Claude Code | graphify claude install |
| Codex | graphify codex install |
| OpenCode | graphify opencode install |
| OpenClaw | graphify claw install |
| Factory Droid | graphify droid install |
Claude Code does two things: writes a CLAUDE.md section telling Claude to read graphify-out/GRAPH_REPORT.md before answering architecture questions, and installs a PreToolUse hook (settings.json) that fires before every Glob and Grep call. If a knowledge graph exists, Claude sees: _"graphify: Knowledge graph exists. Read GRAPHREPORT.md for god nodes and community structure before searching raw files." — so Claude navigates via the graph instead of grepping through every file.
Codex, OpenCode, OpenClaw, Factory Droid write the same rules to AGENTS.md in your project root. These platforms don’t support PreToolUse hooks, so AGENTS.md is the always-on mechanism.
Uninstall with the matching uninstall command (e.g. graphify claude uninstall).
Always-on vs explicit trigger — what’s the difference?
The always-on hook surfaces GRAPH_REPORT.md — a one-page summary of god nodes, communities, and surprising connections. Your assistant reads this before searching files, so it navigates by structure instead of keyword matching. That covers most everyday questions.
/graphify query, /graphify path, and /graphify explain go deeper: they traverse the raw graph.json hop by hop, trace exact paths between nodes, and surface edge-level detail (relation type, confidence score, source location). Use them when you want a specific question answered from the graph rather than a general orientation.
Think of it this way: the always-on hook gives your assistant a map. The /graphify commands let it navigate the map precisely.
Manual install (curl)
mkdir -p ~/.claude/skills/graphify curl -fsSL https://raw.githubusercontent.com/safishamsi/graphify/v3/graphify/skill.md > ~/.claude/skills/graphify/SKILL.md
Add to ~/.claude/CLAUDE.md:
- graphify (`~/.claude/skills/graphify/SKILL.md`) - any input to knowledge graph. Trigger: `/graphify` When the user types `/graphify`, invoke the Skill tool with `skill: "graphify"` before doing anything else.
Usage
”` /graphify # run on current directory /graphify ./raw # run on a specific folder /graphify ./raw –mode deep # more aggressive INFERRED edge extraction /graphify ./raw –update # re-extract only changed files, merge into existing graph /graphify ./raw –cluster-only # rerun clustering on existing graph, no re-extraction /graphify ./raw –no-viz # skip HTML, just produce report + JSON /graphify ./raw –obsidian # also generate Obsidian vault (opt-in)
/graphify add https://arxiv.org/abs/1706.03762 # fetch a paper, save, update graph /graphify add https://x.com/karpathy/status/... # fetch a tweet /graphify add https://… –author "Name" # tag the original author /graphify add https://… –contributor "Name" # tag who added it to the corpus
/graphify query "what connects attention to the optimizer?" /graphify query "what connects attention to the optimizer?" –dfs # trace a specific path /graphify query "what connects attention to the optimizer?" –budget 1500 # cap at N tokens /graphify path "DigestAuth" "Response" /graphify explain "SwinTransformer"
/graphify ./raw –watch # auto-sync graph as files change (code: instant, docs: n
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/267820.html