Skip to content

[FEATURE] Git-diff aware incremental re-index (replace file-watcher polling) #14

@Wolfvin

Description

@Wolfvin

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:

  1. On session start: git diff HEAD --name-only to get changed files since last index
  2. Only re-parse changed files
  3. On git checkout detection (HEAD hash change): trigger targeted re-index of switched files
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestperformancePerformance improvement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions