gitstack
Git history viewer focused on analysis and insights
Built for the AI-assisted development era - optimized for Claude Code and similar tools
Why gitstack?
| Tool | Focus | Best For |
|---|---|---|
| lazygit | Git operations | Staging, rebasing, cherry-picking |
| tig | Log browsing | Quick commit viewing |
| keifu | Graph visualization | Beautiful branch display |
| gitstack | Analysis & Insights | Understanding your codebase |
gitstack answers questions like:
- "Who has been working on this module?"
- "Which files are changed most frequently?"
- "Which commits had the biggest impact?"
- "Are there any stale branches that should be cleaned up?"
- "How healthy is this project overall?"
Install
Or build from source:
Features
Analysis Suite
Press a single key to get instant insights:
| Key | View | What it shows |
|---|---|---|
A |
Author Stats | Commits, lines added/deleted per author |
H |
Heatmap | Most frequently changed files |
T |
Timeline | Commit activity by hour/day |
O |
Ownership | Code ownership by file/directory |
I |
Impact Score | Commit impact scores (0.0-1.0) |
t |
Topology | Branch health and recommendations |
D |
Health Dashboard | Project health score (0-100) with alerts |
Smart Filter
Powerful filtering with intuitive syntax:
/author:john # Filter by author
/since:7days # Recent commits
/until:2024-01-01 # Before date
/message:fix # Search commit messages
/file:src/main.rs # Commits touching specific file
/hash:abc123..def456 # Commit range
Combine filters: /author:john since:1week file:*.rs
Adaptive Layout (v3.0+)
Toggle with v to cycle through view modes:
| Mode | Width | Best For |
|---|---|---|
| Normal | 80+ cols | Full-featured view with graph |
| Compact | 40-79 cols | 2-pane layout with details |
| UltraCompact | 20-39 cols | Minimal view for Claude Code split panes |
Compact mode shows commit details alongside the graph:
┌─ Graph ─────────────────┬─ Details ────────────────────┐
│ ● abc123 feat: auth │ Author: John Doe │
│ │ │ Date: 2024-01-15 10:30 │
│ ○ def456 fix: bug │ │
│ │ │ feat: add authentication │
│ ◆ ghi789 Merge │ │
│ │ │ - Add login endpoint │
│ ○ jkl012 init │ - Add JWT validation │
└─────────────────────────┴──────────────────────────────┘
Branch Graph
Color-coded branch visualization with smart color assignment:
- Adjacent lanes never share the same color
- Branches from the same fork point get distinct colors
- Clear merge visualization with proper line connections
Project Health Dashboard (v3.0+)
Press D to see overall project health:
┌─ Health Dashboard ─────────────────────────────────┐
│ Overall Score: 78 / 100 (Good) │
│ ████████░░ │
│ │
│ Quality ████████░░ 82% │
│ Test Health ██████░░░░ 65% │
│ Bus Factor █████████░ 90% │
│ Tech Debt ███████░░░ 75% │
│ │
│ ⚠ Warning: 3 stale branches need attention │
│ ℹ Info: Test coverage could be improved │
└────────────────────────────────────────────────────┘
Branch Recommendations (v3.0+)
The Topology view (t) now shows recommended actions for each branch:
| Icon | Action | Meaning |
|---|---|---|
| 🗑 | Delete | Merged or inactive for 60+ days |
| ↻ | Rebase | Far behind main branch |
| ⤵ | Merge | Ready to merge (has commits ahead) |
| 👁 | Review | Long-lived branch needs attention |
CLI Mode (Non-Interactive)
For AI coding assistants (Claude Code, etc.) and scripting, gitstack provides JSON output:
Example output (--stats):
| Option | Description |
|---|---|
--stats |
Author statistics as JSON |
--heatmap |
File heatmap as JSON |
--impact |
Impact scores as JSON |
--coupling |
Change coupling as JSON |
--health |
Project health score as JSON |
--log -n N |
Latest N commits as JSON (default: 10, max: 10000) |
--help |
Show help |
--version |
Show version |
MCP Server (v3.0+)
gitstack includes an MCP (Model Context Protocol) server for AI assistants like Claude Code.
# Build the MCP server
# Add to Claude Code's MCP configuration
Available Resources:
| URI | Description |
|---|---|
gitstack://stats/authors |
Author statistics |
gitstack://stats/heatmap |
File change frequency |
gitstack://stats/ownership |
Code ownership |
gitstack://stats/quality |
Commit quality scores |
gitstack://stats/impact |
Commit impact scores |
gitstack://stats/coupling |
Change coupling |
gitstack://stats/bus-factor |
Bus factor analysis |
gitstack://stats/tech-debt |
Technical debt |
gitstack://health/dashboard |
Project health score |
gitstack://branch/recommendations |
Branch recommendations |
Available Tools:
| Tool | Description |
|---|---|
get_file_history |
File commit history |
get_author_commits |
Commits by author |
get_file_owners |
File/directory owners |
get_hot_files |
Most changed files |
get_project_health |
Project health score |
get_coupled_files |
Co-changed files |
get_branch_recommendations |
Branch action recommendations |
Comparison
| Feature | gitstack | keifu | lazygit | tig |
|---|---|---|---|---|
| Author statistics | ✅ | ❌ | ❌ | ❌ |
| File heatmap | ✅ | ❌ | ❌ | ❌ |
| Code ownership | ✅ | ❌ | ❌ | ❌ |
| Impact score | ✅ | ❌ | ❌ | ❌ |
| Health dashboard | ✅ | ❌ | ❌ | ❌ |
| Branch health / recommendations | ✅ | ❌ | ❌ | ❌ |
| Smart filter syntax | ✅ | ❌ | ❌ | ❌ |
| Adaptive layout (20+ cols) | ✅ | ❌ | ❌ | ❌ |
| Commit range filter | ✅ | ❌ | ❌ | ❌ |
| Branch graph | ✅ | ✅ | ✅ | ✅ |
| Staging/commit | ✅ | ❌ | ✅ | ✅ |
| Pull/Push | ✅ | ✅ | ✅ | ✅ |
| Branch create/delete | ✅ | ✅ | ✅ | ✅ |
| Interactive rebase | ❌ | ❌ | ✅ | ❌ |
| CLI/JSON output | ✅ | ❌ | ❌ | ❌ |
| MCP server | ✅ | ❌ | ❌ | ❌ |
Keybindings
Navigation
| Key | Action |
|---|---|
j / ↓ |
Move down |
k / ↑ |
Move up |
g |
Go to top |
G |
Go to bottom |
Ctrl+d |
Page down |
Ctrl+u |
Page up |
Views
| Key | Action |
|---|---|
Enter |
Show commit details / diff |
P |
Show file patch (in detail view) |
v |
Cycle view mode (Normal → Compact → UltraCompact) |
A |
Author statistics |
H |
File heatmap |
T |
Commit timeline |
O |
Code ownership |
I |
Impact scores |
t |
Branch topology with recommendations |
D |
Project health dashboard |
Actions
| Key | Action |
|---|---|
/ |
Open filter |
Esc |
Clear filter / close view |
y |
Copy commit hash |
b |
Show blame view |
s |
Open status view |
F |
Fetch from remote |
? |
Show help |
q |
Quit |
Status View (s)
| Key | Action |
|---|---|
Space |
Stage/unstage file |
a |
Stage all |
A |
Unstage all |
c |
Commit |
l |
Pull from remote |
p |
Push to remote |
Branch Select (b)
| Key | Action |
|---|---|
Enter |
Checkout branch |
n |
Create new branch |
d |
Delete branch |
Configuration
Config file: ~/.config/gitstack/config.toml
[]
= "relative" # or "absolute"
= true
[]
= "q"
= "?"
License
MIT