Skip to content

Graphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.

fix(skill): preserve scan-result.json across Phase 7 cleanup for incremental runs (#293)

Zebang Cheng928b997c5706
diff --git a/understand-anything-plugin/skills/understand/SKILL.md b/understand-anything-plugin/skills/understand/SKILL.md
index b66dcc25..610a9dd6 100644
--- a/understand-anything-plugin/skills/understand/SKILL.md
+++ b/understand-anything-plugin/skills/understand/SKILL.md
@@ -770,9 +770,16 @@ Report to the user: `[Phase 7/7] Saving knowledge graph...`
}
```
-4. Clean up intermediate files:
+4. Clean up intermediate files, **preserving `scan-result.json`** so future incremental runs can skip Phase 1 SCAN (see issue #293):
```bash
- rm -rf $PROJECT_ROOT/.understand-anything/intermediate
+ # Preserve scan-result.json — Phase 1's deterministic file inventory.
+ # Future incremental runs (Phase 2 compute-batches.mjs --changed-files=…)
+ # need this inventory; without it, Phase 1 must re-dispatch and pay ~157k
+ # tokens / ~158s per incremental run.
+ INTER="$PROJECT_ROOT/.understand-anything/intermediate"
+ if [ -d "$INTER" ]; then
+ find "$INTER" -mindepth 1 -maxdepth 1 -not -name 'scan-result.json' -exec rm -rf {} +
+ fi
rm -rf $PROJECT_ROOT/.understand-anything/tmp
```