
analyzing-git-sessions
Analyzes git commits and changes within a timeframe or commit range, providing structured summaries for code review, retrospectives, work logs, or session documentation.
- Installs
- 93
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/bitwarden/ai-plugins --skill analyzing-git-sessions- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads analyzing-git-sessions automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Analyzing Git Sessions
Core Responsibility
Generate structured analysis of git activity for specified timeframe or commit range, including commit history, file changes, statistics, and optional diffs.
Inputs
Accept from user:
- Time range: "last 2 hours", "since 10am", "today", "since 2025-10-23 14:00"
- Commit range: "abc123..def456", "HEAD~5..HEAD", "feature-branch..main"
- Optional filters: Specific paths, authors, or file types
- Output depth: Concise (default), Detailed, or Code Review format
Working Process
Step 1: Parse and Validate Input
-
Determine range type:
- Time-based: Parse relative or absolute time
- Commit-based: Validate commit references exist
- Branch-based: Resolve branch names to commits
-
Validate git repository:
git rev-parse --git-dir -
Check range has commits:
git log <range> --oneline | head -1If empty, inform user and exit.
Step 2: Extract Commit History
# Get all commits in range
git log <range> --oneline --no-decorate
# Get detailed commit info
git log <range> --format="%h|%an|%ar|%s" --no-decorate
# Count commits
git log <range> --oneline | wc -l
Store commit data for summary.
Step 3: Generate Statistics
Overall change statistics:
# Summary stats (insertions/deletions by file)
git diff <start>..<end> --stat
# Numeric stats for parsing
git diff <start>..<end> --numstat
# Count total changes
git diff <start>..<end> --shortstat
Author breakdown (if multiple authors):
git shortlog <start>..<end> -sn
File categorization:
- Identify new files (show in status "A")
- Identify deleted files (show in status "D")
- Identify renamed files (show in status "R")
- Modified files with change magnitude
Step 4: Identify Key Files for Detailed Analysis
Prioritization rules:
- Large changes (>100 lines modified): Always include
- New files: Include (especially if >50 lines)
- Deleted files: Note but don't diff
- Architecture files:
build.gradle.kts,AndroidManifest.xml, module configs - Test files: Flag separately for test coverage assessment
Extract key file list:
# Files changed with line counts
git diff <start>..<end> --numstat | sort -rn -k1 -k2
Limit to top 10 files by default to avoid context overflow.
Step 5: Generate Selective Diffs (Based on Depth)
Concise mode: No diffs, stats only
Detailed mode: Diffs for top 3-5 key files
git diff <start>..<end> -- path/to/key/file.kt
Code Review mode: Diffs for all modified files, grouped by module
# Group by directory
git diff <start>..<end> --name-only | cut -d'/' -f1-2 | sort -u
# Generate diffs per module
for module in modules; do
git diff <start>..<end> -- $module/
done
Context overflow protection:
- If >10 files changed significantly, limit to top 5 diffs
- Warn user: "Showing top 5 files by change size. Request specific files for full diffs."
Step 6: Present Structured Summary
Format based on depth:
Concise Summary
## Git Session Summary
**Range**: <start-commit> to <end-commit> (<timeframe>)
**Commits**: X commits by Y author(s)
**Files Changed**: A modified, B added, C deleted
**Net Changes**: +X -Y lines
### Commits
- abc123 Commit message 1
- def456 Commit message 2
...
### Top Files Changed
1. path/to/file1.kt (+50 -20)
2. path/to/file2.kt (+30 -15)
...
Detailed Summary
Includes:
- Full commit list with authors and timestamps
- Complete file list with change stats
- Author breakdown
- Top 3-5 diffs for review
Code Review Format
## Code Review Summary
### Overview
- **PR Title**: [Suggested from commit messages]
- **Changes**: X files across Y modules
- **Scope**: [Inferred from changed files]
### Commits
[Formatted commit list suitable for PR description]
### Changes by Module
**Module: app**
- file1.kt: Description of changes
- file2.kt: Description of changes
**Module: core**
...
### Key Changes
[Diffs for significant modifications]
### Test Coverage
- Test files modified: X
- New tests added: ~Y
Output Guidelines
Commit Messages
- Show short hash (7 chars)
- Show first line of commit message only
- Truncate long messages to 80 chars
- Group by author if multiple contributors
File Paths
- Use relative paths from repo root
- Format as code:
path/to/file.kt - Include line change magnitude: (+X -Y)
- Highlight file type (source, test, config)
Statistics
Present in clear tables:
| Metric | Count |
| ------------- | ----- |
| Commits | 15 |
| Files Changed | 23 |
| Insertions | +450 |
| Deletions | -180 |
Diffs
- Include file path as header:
### path/to/file.kt - Use code blocks with syntax highlighting
- Show context lines (git default: 3 lines before/after)
- Truncate very large diffs (>200 lines) with summary
Context Budget Management
Monitor diff sizes:
- Small session (<10 files, <500 lines): Safe for detailed mode
- Medium session (10-30 files, 500-2000 lines): Use selective diffs
- Large session (>30 files, >2000 lines): Concise mode with warnings
Progressive disclosure:
- Always start with concise summary
- Ask user: "Would you like detailed diffs for specific files?"
- Generate diffs on demand rather than upfront
Fallback for large sessions: "This session modified 45 files with 5000+ line changes. Showing concise summary. Request specific files or modules for detailed diffs."
Anti-Patterns to Avoid
Don't:
- Generate diffs for all files in large sessions (context overflow)
- Include full diffs without asking (waste context on unneeded details)
- Ignore file types (treat test changes same as source changes)
- Lose context on what user wants to know
- Use generic summaries ("modified 10 files") without specifics
Do:
- Ask user what level of detail they need
- Prioritize key files by change magnitude
- Categorize files (source, test, config, docs)
- Provide actionable summaries
- Offer to drill down on specific files
Success Criteria
A good git session analysis should:
- Inform: User understands scope of changes at a glance
- Focus: Highlights most significant changes first
- Actionable: Provides paths and diffs for deeper review
- Efficient: Doesn't waste context on unnecessary details
- Adaptable: Adjusts depth based on session size and user needs
Example Outputs
See contexts/example-outputs.md for detailed examples of concise summaries and code review formats.
FAQ
What does the analyzing-git-sessions skill do?
Analyzes git commits and changes within a timeframe or commit range, providing structured summaries for code review, retrospectives, work logs, or session documentation.
How do I install analyzing-git-sessions?
Run npx skills add https://github.com/bitwarden/ai-plugins --skill analyzing-git-sessions in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/analyzing-git-sessions/ (personal) or .claude/skills/analyzing-git-sessions/ (project).
Which AI agents can use analyzing-git-sessions?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is analyzing-git-sessions safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains analyzing-git-sessions?
It is published by bitwarden in bitwarden/ai-plugins, and it is an official skill from the maker of the technology it covers. It has 93 recorded installs.
More from bitwarden/ai-plugins
reviewing-security-architecture
bitwarden/ai-plugins
Open the skill to read its SKILL.md instructions.
threat-modeling
bitwarden/ai-plugins
Open the skill to read its SKILL.md instructions.
retrospecting
bitwarden/ai-plugins
Open the skill to read its SKILL.md instructions.
reviewing-claude-config
bitwarden/ai-plugins
Open the skill to read its SKILL.md instructions.
avoiding-false-positives
bitwarden/ai-plugins
Use this skill to validate findings during a code review. For each finding, run the rejection criteria and verification checks. If a finding fails any check, drop it. In PR mode it also holds the once-per-review stacked-PR gate that decides whether completeness findings apply to the pull request at all.
posting-review-summary
bitwarden/ai-plugins
Open the skill to read its SKILL.md instructions.
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.