Summary
Make incremental analysis the default behavior for docimp analyze to improve performance and user experience without requiring users to remember the --incremental flag.
Current Behavior
Users must explicitly use the --incremental flag to benefit from faster incremental analysis:
docimp analyze ./src --incremental
This requires users to:
- Know the feature exists
- Remember they ran analysis before
- Manually add the flag each time
- Understand when it will help
Proposed Behavior
Auto-detect and use incremental mode by default:
docimp analyze ./src
# Automatically detects previous analysis
# Uses incremental mode if applicable
# Shows message explaining what happened
User-facing message:
Analysis complete
I noticed you had previously run analysis on this codebase. To improve performance,
I only re-analyzed the 3 files that changed (97 files reused from previous analysis).
If you want to force a complete re-analysis, run:
docimp analyze --force-full-analysis ./src
Time saved: ~27 seconds (90% faster)
Implementation Details
Changes Required
-
Auto-detection logic in analyzeCore():
- Check for previous analysis in
.docimp/session-reports/analyze-latest.json
- Check for workflow state in
.docimp/workflow-state.json
- If both exist, automatically use incremental mode
-
New flag: --force-full-analysis (or --no-incremental):
- Overrides auto-incremental behavior
- Forces full analysis of all files
- Useful for benchmarking or debugging
-
Keep --incremental for backwards compatibility:
- Make it a no-op (incremental is now default)
- Update documentation to note it's redundant
- Keep for users who like being explicit
-
Enhanced messaging:
- Show when incremental mode was used
- Display file counts (changed vs reused)
- Show estimated time savings
- Provide clear opt-out instructions
Files to Modify
cli/src/commands/analyze.ts - Auto-detection logic
cli/src/index.ts - Add --force-full-analysis flag, document --incremental as redundant
cli/src/display/terminal-display.ts - Enhanced analysis result messaging
CLAUDE.md - Update documentation
README.md - Update user-facing docs
Benefits
- Better UX: Optimal performance without cognitive load
- Education: Users learn about incremental analysis through messages
- Backwards compatible: Existing
--incremental usage still works
- Discoverable: Users see performance improvements automatically
Related
Priority
High - This significantly improves UX for all users with minimal implementation effort. Makes a powerful feature accessible without requiring flag knowledge.
Summary
Make incremental analysis the default behavior for
docimp analyzeto improve performance and user experience without requiring users to remember the--incrementalflag.Current Behavior
Users must explicitly use the
--incrementalflag to benefit from faster incremental analysis:This requires users to:
Proposed Behavior
Auto-detect and use incremental mode by default:
User-facing message:
Implementation Details
Changes Required
Auto-detection logic in
analyzeCore():.docimp/session-reports/analyze-latest.json.docimp/workflow-state.jsonNew flag:
--force-full-analysis(or--no-incremental):Keep
--incrementalfor backwards compatibility:Enhanced messaging:
Files to Modify
cli/src/commands/analyze.ts- Auto-detection logiccli/src/index.ts- Add--force-full-analysisflag, document--incrementalas redundantcli/src/display/terminal-display.ts- Enhanced analysis result messagingCLAUDE.md- Update documentationREADME.md- Update user-facing docsBenefits
--incrementalusage still worksRelated
--dry-runflag for incremental analysisdocs/patterns/workflow-state-management.mdPriority
High - This significantly improves UX for all users with minimal implementation effort. Makes a powerful feature accessible without requiring flag knowledge.