# graphify **Repository Path**: o_o0111/graphify ## Basic Information - **Project Name**: graphify - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: v6 - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-05-02 - **Last Updated**: 2026-05-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README
🇺🇸 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 | 🇹🇭 ภาษาไทย | 🇹🇼 繁體中文
**An AI coding assistant skill.** Type `/graphify` in Claude Code, Codex, OpenCode, Cursor, Gemini CLI, GitHub Copilot CLI, VS Code Copilot Chat, Aider, OpenClaw, Factory Droid, Trae, Hermes, Kiro, or Google Antigravity - 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, images in other languages, or video and audio files - graphify extracts concepts and relationships from all of it and connects them into one graph. Videos are transcribed with Whisper using a domain-aware prompt derived from your corpus. YAML/YML files (Kubernetes, Kustomize, Helm, config) are indexed for semantic extraction. SQL files are AST-extracted deterministically — tables, views, functions, foreign keys, and FROM/JOIN relationships map directly into the graph with no LLM needed. 25 languages supported 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, Verilog, SystemVerilog, Vue, Svelte, Dart). > 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 - open in any browser, 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` — including `!` negation patterns to re-include specific files. You can keep a single `.graphifyignore` at your repo root — patterns work correctly even when graphify is run on a subfolder. Discovery never crosses a VCS boundary (`.git`, `.hg`, etc.), so sibling projects in a shared workspace don't leak rules into each other. Without a VCS root, only the scan folder's own `.graphifyignore` applies. Inline comments are supported: `vendor/ # legacy deps`. ## How it works graphify runs in three passes. First, a deterministic AST pass extracts structure from code files (classes, functions, imports, call graphs, docstrings, rationale comments) with no LLM needed. Second, video and audio files are transcribed locally with faster-whisper using a domain-aware prompt derived from corpus god nodes — transcripts are cached so re-runs are instant. Third, Claude subagents run in parallel over docs, papers, images, and transcripts 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](https://claude.ai/code), [Codex](https://openai.com/codex), [OpenCode](https://opencode.ai), [Cursor](https://cursor.com), [Gemini CLI](https://github.com/google-gemini/gemini-cli), [GitHub Copilot CLI](https://docs.github.com/en/copilot/how-tos/copilot-cli), [VS Code Copilot Chat](https://code.visualstudio.com/docs/copilot/overview), [Aider](https://aider.chat), [OpenClaw](https://openclaw.ai), [Factory Droid](https://factory.ai), [Trae](https://trae.ai), [Kiro](https://kiro.dev), Hermes, or [Google Antigravity](https://antigravity.google) ```bash # Recommended — works on Mac and Linux with no PATH setup needed uv tool install graphifyy && graphify install # or with pipx pipx install graphifyy && graphify install # or plain pip pip install graphifyy && graphify install ``` > **Official package:** The PyPI package is named `graphifyy` (install with `pip install graphifyy`). Other packages named `graphify*` on PyPI are not affiliated with this project. The only official repository is [safishamsi/graphify](https://github.com/safishamsi/graphify). The CLI and skill command are still `graphify`. > **`graphify: command not found`?** Use `uv tool install graphifyy` (recommended) or `pipx install graphifyy` — both put the CLI in a managed location that's automatically on PATH. With plain `pip`, you may need to add `~/.local/bin` (Linux) or `~/Library/Python/3.x/bin` (Mac) to your PATH, or run `python -m graphify` instead. On Windows, pip scripts land in `%APPDATA%\Python\PythonXY\Scripts`. ### 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` | | GitHub Copilot CLI | `graphify install --platform copilot` | | VS Code Copilot Chat | `graphify vscode install` | | Aider | `graphify install --platform aider` | | OpenClaw | `graphify install --platform claw` | | Factory Droid | `graphify install --platform droid` | | Trae | `graphify install --platform trae` | | Trae CN | `graphify install --platform trae-cn` | | Gemini CLI | `graphify install --platform gemini` | | Hermes | `graphify install --platform hermes` | | Kiro IDE/CLI | `graphify kiro install` | | Cursor | `graphify cursor install` | | Google Antigravity | `graphify antigravity install` | 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 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 — AGENTS.md is the always-on mechanism. Codex supports PreToolUse hooks — `graphify codex install` installs one in `.codex/hooks.json` in addition to writing AGENTS.md. Then open your AI coding assistant and type: ``` /graphify . ``` Note: Codex uses `$` instead of `/` for skill calling, so type `$graphify .` instead. ### 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` | | GitHub Copilot CLI | `graphify copilot install` | | VS Code Copilot Chat | `graphify vscode install` | | Aider | `graphify aider install` | | OpenClaw | `graphify claw install` | | Factory Droid | `graphify droid install` | | Trae | `graphify trae install` | | Trae CN | `graphify trae-cn install` | | Cursor | `graphify cursor install` | | Gemini CLI | `graphify gemini install` | | Hermes | `graphify hermes install` | | Kiro IDE/CLI | `graphify kiro install` | | Google Antigravity | `graphify antigravity 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 GRAPH_REPORT.md for god nodes and community structure before searching raw files."_ — so Claude navigates via the graph instead of grepping through every file. **Codex** writes to `AGENTS.md` and also installs a **PreToolUse hook** in `.codex/hooks.json` that fires before every Bash tool call — same always-on mechanism as Claude Code. **OpenCode** writes to `AGENTS.md` and also installs a **`tool.execute.before` plugin** (`.opencode/plugins/graphify.js` + `opencode.json` registration) that fires before bash tool calls and injects the graph reminder into tool output when the graph exists. **Cursor** writes `.cursor/rules/graphify.mdc` with `alwaysApply: true` — Cursor includes it in every conversation automatically, no hook needed. **Gemini CLI** copies the skill to `~/.gemini/skills/graphify/SKILL.md`, writes a `GEMINI.md` section, and installs a `BeforeTool` hook in `.gemini/settings.json` that fires before file-read tool calls — same always-on mechanism as Claude Code. **Aider, OpenClaw, Factory Droid, Trae, and Hermes** write the same rules to `AGENTS.md` in your project root and copy the skill to the platform's global skill directory. These platforms don't support tool hooks, so AGENTS.md is the always-on mechanism. **Kiro IDE/CLI** writes the skill to `.kiro/skills/graphify/SKILL.md` (invoked via `/graphify`) and a steering file to `.kiro/steering/graphify.md` with `inclusion: always` — Kiro injects this into every conversation automatically, no hook needed. **Google Antigravity** writes `.agents/rules/graphify.md` (always-on rules) and `.agents/workflows/graphify.md` (registers `/graphify` as a slash command). No hook equivalent exists in Antigravity — rules are the always-on mechanism. **GitHub Copilot CLI** copies the skill to `~/.copilot/skills/graphify/SKILL.md`. Run `graphify copilot install` to set it up. **VS Code Copilot Chat** installs a Python-only skill (works on Windows PowerShell and macOS/Linux alike) and writes `.github/copilot-instructions.md` in your project root — VS Code reads this automatically every session, making graph context always-on without any hook mechanism. Run `graphify vscode install`. Note: this configures the chat panel in VS Code, not the Copilot CLI terminal tool. 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. ### Team workflows `graphify-out/` is designed to be committed to git so every teammate starts with a fresh map. **Recommended `.gitignore` additions:** ``` # keep graph outputs, skip heavy/local-only files # optional: commit for shared extraction speed, skip to keep repo small graphify-out/cache/ # mtime-based, invalid after git clone - always gitignore this graphify-out/manifest.json # local token tracking, not useful to share graphify-out/cost.json ``` **Shared setup:** 1. One person runs `/graphify .` to build the initial graph and commits `graphify-out/`. 2. Everyone else pulls — their assistant reads `GRAPH_REPORT.md` immediately with no extra steps. 3. Install the post-commit hook (`graphify hook install`) so the graph rebuilds automatically after code changes — no LLM calls needed for code-only updates. 4. For doc/paper changes, whoever edits the files runs `/graphify --update` to refresh semantic nodes. **Excluding paths** — create `.graphifyignore` in your project root (same syntax as `.gitignore`). Files matching those patterns are skipped during detection and extraction. ``` # .graphifyignore example AGENTS.md # graphify install files — don't extract your own instructions as knowledge CLAUDE.md GEMINI.md .gemini/ .opencode/ docs/translations/ # generated content you don't want in the graph ``` ## Using `graph.json` with an LLM `graph.json` is not meant to be pasted into a prompt all at once. The useful workflow is: 1. Start with `graphify-out/GRAPH_REPORT.md` for the high-level overview. 2. Use `graphify query` to pull a smaller subgraph for the specific question you want to answer. 3. Give that focused output to your assistant instead of dumping the full raw corpus. For example, after running graphify on a project: ```bash graphify query "show the auth flow" --graph graphify-out/graph.json graphify query "what connects DigestAuth to Response?" --graph graphify-out/graph.json ``` The output includes node labels, edge types, confidence tags, source files, and source locations. That makes it a good intermediate context block for an LLM: ```text Use this graph query output to answer the question. Prefer the graph structure over guessing, and cite the source files when possible. ``` If your assistant supports tool calling or MCP, use the graph directly instead of pasting text. graphify can expose `graph.json` as an MCP server: ```bash python -m graphify.serve graphify-out/graph.json ``` That gives the assistant structured graph access for repeated queries such as `query_graph`, `get_node`, `get_neighbors`, and `shortest_path`. > **WSL / Linux note:** Ubuntu ships `python3`, not `python`. Install into a project venv to avoid PEP 668 conflicts, and use the full venv path in your `.mcp.json`: > ```bash > python3 -m venv .venv && .venv/bin/pip install "graphifyy[mcp]" > ``` > ```json > { "mcpServers": { "graphify": { "type": "stdio", "command": ".venv/bin/python3", "args": ["-m", "graphify.serve", "graphify-out/graph.json"] } } } > ``` > Also note: the PyPI package is `graphifyy` (double-y) — `pip install graphify` installs an unrelated package.