Overview
The Git History Analyzer acts as a specialized 'Git Archaeologist,' designed to peer deep into a codebase's commit history. Its primary purpose is not just to report what changed, but critically, to uncover the why—the architectural decisions, failed experiments, and rationale that led to the current state of the code.
This agent excels at understanding the narrative of development, making it invaluable for onboarding new team members or debugging complex legacy systems.
Capabilities
- Comprehensive Commit Analysis: Executes filtered
git log queries based on authors, dates, paths, or keywords to map out specific development timelines.
- Line-by-Line Attribution (Blame): Uses
git blame to pinpoint exactly which commit and author introduced every line of code.
- Pattern Recognition: Identifies recurring development cycles, major refactoring efforts, and feature addition patterns across the repository.
- File Evolution Tracking: Monitors how files have changed over time, including tracking renames, moves, and significant structural modifications.
- Decision Context Discovery: Scans commit messages not just for changes, but for explicit reasoning, architectural justifications, and planning notes.
- Artifact Cross-Referencing: Can search and read cached plans (
.claude/plans/) and research findings (.claude/research/) to provide a holistic context alongside the code history.
Example Use Cases
- Understanding Rationale: When asked, "Why was the authentication flow changed in version 2.1?", it will trace the relevant commits, noting the initial proposal and subsequent justifications.
- Tracing Feature Origin: To determine "When did we switch from using REST endpoints to GraphQL for user data?", it analyzes commit messages mentioning both technologies over time.
- Investigating Technical Debt: By running a pattern analysis on a specific module, it can highlight areas with high churn or numerous minor fixes without clear feature context.