Repository navigation
Description
Summary
When a graph is built with --code-only, the git hooks installed by
graphify hook install rebuild it as a full graph (code + docs)
on the next commit / branch switch. The rebuild does not preserve the
scope the graph was originally built with.
Repro
graphify extract . --code-only— code-only graph (in my repo: 675
nodes, 1356 edges, 20 communities; 70 code files, 335 docs skipped).graphify hook install(installs post-commit / post-checkout /
post-merge / post-rewrite).- Make a commit (or switch branches).
- The hook rebuilds the graph — it now includes docs: 2325 nodes,
2701 edges, 364 communities (403 files extracted, including 333 docs).
Expected
A rebuild should preserve the scope the graph was built with. A
code-only graph should stay code-only across hook-triggered rebuilds
(unless the user explicitly changes the scope).
Actual
_rebuild_code has no code-only parameter. When called without
changed_paths (post-checkout / post-merge / post-rewrite do a full
rebuild), it extracts every file it can parse — code and docs alike.
The original --code-only flag is silently dropped. There is also no
record of the extraction scope in the graph metadata (e.g.
graphify-out/.graphify_analysis.json / manifest.json), so the
rebuild has no way to know the graph was code-only.
Suggested fix
Record the extraction scope (e.g. code_only: true) in the graph
metadata at extract time, and have _rebuild_code respect it (or
accept a code_only parameter that the hooks pass through).
Alternatively, add a --code-only flag to the hook install / a
code_only key in .graphifyrc.
Environment
- graphify 0.9.99 (via
uv tool install graphifyy) - Python 3.12, Linux
- No LLM API key configured (AST-only extraction)
Related observations
- The CLI and the hook disagree about docs without an API key:
graphify extract .(no--code-only, no key) refuses with "no LLM
API key found (335 doc/paper/image file(s) need semantic extraction)",
while the hook's_rebuild_codeextracts docs via AST with no key. A
--ast-onlyCLI mode (full extraction, no LLM) would match the hook's
behavior. graphify-out/manifest.jsonchanges on every rebuild (mtime/seen
timestamps) even when the graph topology is unchanged, which dirties
the working tree for repos that commit the graph. It would help if the
manifest were stable when nothing meaningful changed.
Activity
github-actions commentedon Nov 1, 2026
Thanks for opening this issue, @stoneskin. A maintainer will take a look soon.
If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.
To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.
test(rebuild): pin that a --code-only graph stays code-only across re…
feat(extract): record the --code-only scope in .graphify_build.json (#…
fix(rebuild): keep a --code-only graph code-only on hook/update/watch…
fix(rebuild): include the code-only scope in the no-change skip key (#…
feat(extract): a flagless extract that ingests docs clears the code-o…
safishamsi commentedon Nov 2, 2026
Fixed in 0.9.101 (published to PyPI) via #4939. A --code-only graph now stays code-only across hook, update and watch rebuilds; the scope is recorded in .graphify_build.json.