Repository navigation
Description
Environment
graphifyy(pip), macOS, installed viauv tool install- Graph was built via the Claude Code skill's manual step-by-step flow with
INPUT_PATH=src(a subfolder of the repo), butgraphify-out/stays at the repo root the whole time (this is the skill's own documented/intentional behavior — every code block writes tographify-out/...relative to CWD, independent ofINPUT_PATH).
Steps to reproduce
- Build a full graph on a subfolder via the skill flow →
graphify-out/graph.jsonat repo root, ~7244 nodes. - Run
graphify hook install(installs git post-commit/post-checkout hooks). - Make a small change to any file, commit.
Expected
The hook re-extracts only the changed file(s) and preserves the existing 7244 nodes.
Actual
The hook silently collapses the graph to ~4-129 nodes and overwrites graphify-out/graph.json. Reproduced twice, with different (small) node counts each time — looks non-deterministic. The commit itself is never corrupted, only the working-tree graphify-out/* files.
Root-cause hypothesis (could not fully isolate)
_rebuild_code(watch_path, ...) in graphify/watch.py computes out = watch_path / GRAPHIFY_OUT, coupling the output directory to the scan root. The git hook reads watch_path from .graphify_root, which is written once in the skill's Step 1 but never updated when the user later narrows the scan to a subfolder (Step 2's corpus-size prompt).
I pinned GRAPHIFY_OUT to an absolute repo-root path (via the env-var override contract documented in graphify.paths) and corrected .graphify_root to point at src. Calling _rebuild_code() directly in Python with this fix worked correctly twice (7244→7245 on an added symbol, 7245→7244 on reverting it). But applying the identical env-var fix inside the installed git hook script and triggering it via a real git commit still corrupted the graph (down to 129 nodes). So the bug isn't just the output-path mismatch — likely something in _StoredSourcePaths identity matching (the extraction's project_root/watch_root anchoring doesn't agree with the skill's root='src' (relative) build), or something is lost in the hook's own process chain (detached subprocess.Popen + _rebuild_lock + _queue_pending/_drain_pending).
Impact
Silent data loss risk for anyone who (a) builds on a subfolder via the interactive skill, then (b) installs the git-hook automation — a very plausible combination for exactly the audience the skill targets.
Workaround
Don't use hook install in this scenario. The PreToolUse hook from claude install is unaffected (it's read-only and always resolves graphify-out/ relative to CWD via graphify.paths.out_path(), independent of .graphify_root).
Activity
fix(watch): validate .graphify_root before anchoring stored sources o…
harden(watch): document cwd anchor fallback, align bucket tuple, add …
chore: bump to 0.9.45
safishamsi commentedon Aug 16, 2026
Fixed in v0.9.45 (on PyPI now) via #2778, thanks @catpotd. Closing.
chore: bump to 0.9.46
fix: watch and reflect read .graphify_root exactly too (Graphify-Labs…
fix: watch and reflect read .graphify_root exactly too (Graphify-Labs…
fix: watch and reflect read .graphify_root exactly too (Graphify-Labs…
fix: watch and reflect read .graphify_root exactly too (Graphify-Labs…
fix(query,serve): stop flagging fresh subfolder builds as pre-#1504
docs(changelog): cite the correct per-PR issues for the 0.9.104 robus…