Summary
On incremental /understand updates, the merged graph silently loses every unchanged node/edge — the result contains only the freshly re-analyzed (changed) files.
Version: 2.7.6 (Claude Code plugin)
Root cause
skills/understand/SKILL.md → Phase 2 — ANALYZE → Incremental update path instructs:
Write the pruned existing nodes/edges as batch-existing.json in the intermediate directory … Run the same merge script — it will combine batch-existing.json with the fresh batch-*.json files.
But skills/understand/merge-batch-graphs.py discovers batch files with a numeric-only regex:
batch-(\d+)(?:-part-(\d+))?\.json
batch-existing.json does not match \d+, so the merge silently skips it, discarding all surviving (unchanged) nodes and edges. The SKILL.md itself even warns about this regex in the full path (re: fused names), but the incremental instruction violates it.
Reproduction
- Run
/understand (full) on a repo → graph has N nodes.
- Commit a change touching a few files.
- Run
/understand again (incremental).
- Observe the node count collapse to only the changed files' nodes; all unchanged nodes are gone.
Evidence
Real run, 2026-06-05, v2.7.6, a ~250-node TS/React project:
- As written (
batch-existing.json): merge produced 94 / 164 (157 surviving nodes lost).
- Renaming the pruned file to
batch-900.json: merge produced the correct 251 / 536.
Impact
Silent data loss on the skill's headline incremental feature — and it's invisible (no error; the graph just shrinks).
Suggested fix (any one)
- merge-batch-graphs.py: widen the regex, e.g.
batch-(\d+|existing)(?:-part-(\d+))?\.json and treat existing as a normal source.
- SKILL.md: instruct the incremental path to write the pruned graph as a high numeric index (e.g.
batch-900.json) instead of batch-existing.json.
- Have the incremental path write
batch-<maxBatchIndex+1>.json.
Option 1 is the most robust (keeps the documented name working).
Summary
On incremental
/understandupdates, the merged graph silently loses every unchanged node/edge — the result contains only the freshly re-analyzed (changed) files.Version: 2.7.6 (Claude Code plugin)
Root cause
skills/understand/SKILL.md→ Phase 2 — ANALYZE → Incremental update path instructs:But
skills/understand/merge-batch-graphs.pydiscovers batch files with a numeric-only regex:batch-existing.jsondoes not match\d+, so the merge silently skips it, discarding all surviving (unchanged) nodes and edges. The SKILL.md itself even warns about this regex in the full path (re: fused names), but the incremental instruction violates it.Reproduction
/understand(full) on a repo → graph has N nodes./understandagain (incremental).Evidence
Real run, 2026-06-05, v2.7.6, a ~250-node TS/React project:
batch-existing.json): merge produced 94 / 164 (157 surviving nodes lost).batch-900.json: merge produced the correct 251 / 536.Impact
Silent data loss on the skill's headline incremental feature — and it's invisible (no error; the graph just shrinks).
Suggested fix (any one)
batch-(\d+|existing)(?:-part-(\d+))?\.jsonand treatexistingas a normal source.batch-900.json) instead ofbatch-existing.json.batch-<maxBatchIndex+1>.json.Option 1 is the most robust (keeps the documented name working).