Incremental graph updates from git diffs — patch a Graphify knowledge graph without re-extracting the entire codebase.
You run graphify extract to build a dependency/relationship graph of your codebase. Then you make changes and have to re-run the full extraction. For large codebases with docs and images, this means LLM API calls and minutes of waiting — even for a one-line change.
graphify-diff reads a git diff, identifies which symbols (functions, classes, imports) were added, removed, or modified, and patches the existing graph.json in-place. No LLM calls. No tree-sitter re-parsing. Seconds instead of minutes.
Graphify already has graphify update, which re-extracts only changed files. But it still:
- Re-parses every changed file with tree-sitter
- Re-runs the full graph merge pipeline
- Re-clusters all communities
graphify-diff skips all of that. It works at the symbol level, not the file level. If you change one function in a 500-line file, only that function's node and edges are touched.
pip install graphify-diffThen run from inside a repo with no arguments — baseline is auto-detected from the last graph build:
gdiff patch # apply the diff to graph.json
gdiff analyze # read-only preview of what would change
gdiff impact # trace transitive effects on the graphOverride the baseline with --since:
gdiff patch --since HEAD~1
gdiff patch . --since main # run from outside the repo| Command | What it does |
|---|---|
gdiff patch |
Apply a git diff to graph.json — cascades through dependent nodes (default depth: 3) |
gdiff analyze |
Read-only parse of what would change — no graph required |
gdiff impact |
Trace transitive effects on the existing graph — does not modify it |
| Flag | Description |
|---|---|
--since / -s <ref> |
Git ref to diff against (auto-detected if omitted) |
--staged |
Diff staged changes instead of unstaged |
--dry-run / -n |
Show what would change without writing |
--cascade-depth / -d <n> |
How far to cascade dependency changes (default: 3) |
--graph / -g <path> |
Path to graph.json (default: graphify-out/graph.json) |
--output / -o <path> |
Output path (default: overwrite input) |
--json |
Emit machine-readable JSON output |
| Flag | Description |
|---|---|
--since / -s <ref> |
Git ref to diff against |
--staged |
Diff staged changes |
--depth / -d <n> |
Cascade depth for impact analysis |
--graph / -g <path> |
Path to graph.json |
| Source | github.com/toshon-jennings/graphify-diff |
| PyPI | pypi.org/project/graphify-diff |
| Issues | GitHub Issues |
| Changelog | CHANGELOG.md |
MIT © 2026 Toshon Jennings