Graphify (skill)

Overview (confidence: high)

Graphify is a /graphify skill (PyPI package graphifyy, double-y) that turns a codebase — plus docs, SQL schemas, configs, PDFs, images, video/audio — into a queryable knowledge graph instead of grepping. It installs across 20+ AI coding assistants (Claude Code, Cursor, Codex, Gemini CLI, OpenCode, Kilo, Copilot, Aider, etc.) and writes three artifacts to graphify-out/: graph.json (machine-readable), GRAPH_REPORT.md (architecture report), and graph.html (interactive graph).^[raw/external/github-com-graphify-dc3bc982.md]

The flagship claim: your assistant queries the graph (with file:line citations and confidence tags) rather than reading raw files. GitHub: 99.7k stars / 9.7k forks; Apache 2.0.

Local-First AST Extraction (confidence: high)

Code is parsed locally with tree-sitter — deterministic AST across ~36 languages, 0 LLM credits, nothing leaves your machine during extraction. Only the optional semantic pass over docs/media calls a model backend (Claude/Gemini/OpenAI or any OpenAI-compatible local server, configurable via ANTHROPIC_API_KEY/OPENAI_API_KEY/etc).

Graph Structure (confidence: high)

  • God nodes — the most-connected concepts; everything flows through these.
  • Communities — the graph split into subsystems via Leiden (LLM-free labels).
  • Cross-file linkscalls / imports / inherits / mixes_in, resolved across languages via tree-sitter.
  • Rationale as nodes# NOTE:, # WHY:, # HACK: docstrings and ADR/RFC citations become first-class nodes linked to code.
  • Confidence tags — every relation is EXTRACTED (in source), INFERRED (derived by resolution), or AMBIGUOUS; an edge list shows the confidence on graphify explain.
  • Beyond code — docs (.md wikilinks become references edges), PDFs, Office, Google Workspace, images, video/audio, YouTube/URLs.

Commands (confidence: high)

/graphify .                       build graph for current folder
/graphify . --update              re-extract only changed files
/graphify . --cluster-only        rerun clustering without re-extracting
/graphify . --cluster-only --resolution 1.5   # more granular communities
/graphify . --no-viz              skip the HTML, just report + JSON
/graphify . --wiki                build a markdown wiki from the graph
graphify query "what connects auth to the database?"
graphify path "UserService" "DatabasePool"
graphify explain "RateLimiter"
/graphify add <paper-url>         fetch a paper and add it
graphify hook install             auto-rebuild on git commit
graphify prs                      PR dashboard: CI state, review status, impact
graphify prs 42 --triage          AI ranks review queue; --conflicts flags merge risk

The graphify prs command maps open PRs onto the graph, highlights overlapping nodes and pairs carrying merge risk; --triage ranks order, --conflicts catches collisions.

MCP Server (confidence: high)

Exposes the graph to any MCP client:

python -m graphify.serve graphify-out/graph.json             # stdio (local)
python -m graphify.serve graphify-out/graph.json --transport http --port 8080  # shared HTTP

10 tools: query_graph, get_node, get_neighbors, shortest_path, get_community, god_nodes, graph_stats, list_prs, get_pr_impact, triage_prs. Flags: --transport {stdio,http}, --host (default 127.0.0.1; 0.0.0.0 to expose), --port 8080, --api-key (Bearer/X-API-Key), --json-response, --stateless, --session-timeout 3600. Declarative registration via .mcp.json:

{ "mcpServers": { "graphify": { "command": "python", "args": ["-m", "graphify.serve", "graphify-out/graph.json"] } }}

Always-Use-the-Graph (confidence: high)

graphify <platform> install makes the assistant consult the graph instead of reading files:

  • Hook platforms (Claude Code, Gemini CLI): a hook fires before search-style tool calls and before source-file reads, nudging toward graphify query. Strict mode blocks the first raw source read per session. Toggled with GRAPHIFY_HOOK_STRICT=1/0.
  • Instruction-file platforms (Codex, OpenCode, Cursor): persistent instructions (AGENTS.md, .cursor/rules/graphify.mdc with alwaysApply), which are the always-on mechanism on Codex (its PreToolUse hooks can’t carry additional context).

Install Notes (confidence: high)

  • PyPI package is graphifyy (double-y); the CLI command is graphify. Avoid confusing graphify* impostors on PyPI.
  • uv tool install graphifyy (recommended, isolated env); pipx install also fine; plain pip risks ModuleNotFoundError if the graphify runtime interpreter (graphify-out/.graphify_python) differs.
  • Skill file lands at ~/.claude/skills/graphify/SKILL.md (user) or .claude/skills/graphify/SKILL.md / .agents/skills/graphify/SKILL.md (project --project); graphify install --project --platform agents targets the spec cross-framework locations (~/.agents/skills/, .agents/skills/).
  • PowerShell: invoke graphify ., not /graphify . (the slash is a path separator).
  • Optional extras: [pdf], [office], [google] (Sheets), [video]/[youtube], [terraform], [dm]; install with uv tool install "graphifyy[pdf]".

Relationship to the Vault (confidence: high)

Graphify is the tool that underpins this vault’s own two-tier-search-architecture workflows (planning tier queries the graph, answer tier reads the report), and its tool search / deferred-loading pattern connects to tool-search-tool for keeping tool catalogs lean. The vault’s context-compaction checkpoints mirror Graphify’s GRAPH_REPORT.md summary artifact.

two-tier-search-architecture tool-search-tool context-compaction token-usage-reduction graph-prompting

Sources

  • raw/external/github-com-graphify-dc3bc982.md
  • raw/external/graphify-com-docs-e68d0288.md