Problem
Current watch command uses watchdog file events. This is fine but:
- Re-parses entire file on any change (not just changed functions)
- No awareness of git state — re-indexes uncommitted scratch work
- Doesn't handle branch switches (checkout rewrites many files at once)
Proposed Change
Replace/augment with a git-diff based watcher:
- On session start:
git diff HEAD --name-only to get changed files since last index
- Only re-parse changed files
- On
git checkout detection (HEAD hash change): trigger targeted re-index of switched files
- Store last-indexed git SHA in registry metadata
Bonus: detect_changes upgrade
The existing detect_changes / diff commands can be enhanced to use this same git-aware delta to show agents exactly which symbols changed and what their downstream impact is.
Expected Result
Agents working in active git repos always have a fresh, accurate index without wasting compute re-parsing unchanged files.
Problem
Current
watchcommand uses watchdog file events. This is fine but:Proposed Change
Replace/augment with a git-diff based watcher:
git diff HEAD --name-onlyto get changed files since last indexgit checkoutdetection (HEAD hash change): trigger targeted re-index of switched filesBonus:
detect_changesupgradeThe existing
detect_changes/diffcommands can be enhanced to use this same git-aware delta to show agents exactly which symbols changed and what their downstream impact is.Expected Result
Agents working in active git repos always have a fresh, accurate index without wasting compute re-parsing unchanged files.