Summary
Add incremental parsing that only re-analyzes files changed since last index, plus a watch mode for real-time updates.
Motivation
- Full re-parse on every run is wasteful for large repos
- codebase-memory-mcp caches persistently and updates incrementally
- Augment Code does initial index in 27 min, then incremental <20s
- Watch mode enables real-time metrics during development
- Essential for scaling to large repos (1000+ files)
Approach
- Diff-based parsing: Compare git HEAD with cached index HEAD
- Selective re-parse: Only parse files in
git diff --name-only
- Graph patching: Remove old nodes/edges for changed files, add new ones
- Metric recomputation: PageRank/betweenness need full recompute (global), but blast radius can be scoped
- Watch mode:
codebase-intelligence watch <path> — re-index on file save
Challenges
- PageRank and betweenness are global metrics — can't be updated incrementally
- Graph structure changes (new imports) affect transitive metrics
- Tradeoff: approximate incremental metrics vs exact full recompute
Acceptance Criteria
Priority
Long-term — Essential for large repo adoption but current caching handles most cases.
Summary
Add incremental parsing that only re-analyzes files changed since last index, plus a watch mode for real-time updates.
Motivation
Approach
git diff --name-onlycodebase-intelligence watch <path>— re-index on file saveChallenges
Acceptance Criteria
--incrementalflag skips unchanged fileswatchCLI command for real-time updatesPriority
Long-term — Essential for large repo adoption but current caching handles most cases.