git-aftermerge
Track the downstream fate of every commit. Feed structured post-merge feedback to AI coding agents.
What This Is
git-aftermerge is a Python CLI + MCP server that analyzes what happens to code after it gets merged — tracking survival, reverts, churn, and bug-fix correlations — then feeds structured feedback back to coding agents so they learn from their own history.
Installation
pip install git-aftermerge
Quick Start
# Initialize in your repo
cd /path/to/your/repo
git-aftermerge init
# Check fate of a specific commit
git-aftermerge fate abc1234
# View aggregate patterns
git-aftermerge report
# Generate agent context file
git-aftermerge context --output .aftermerge/CONTEXT.md
Then in CLAUDE.md:
## Post-Merge Context
See .aftermerge/CONTEXT.md for code survival data and risky areas.
How It Works
- Scan — parses git history, runs
git blameto track line-level survival - Score — computes a 0–100 survival score per commit with penalties (reverts, bug-fixes) and bonuses (longevity, extensions)
- Detect — finds reverts (standard + manual), bug-fix correlations, and churn spikes
- Aggregate — rolls up patterns by path, author, commit type, size, and language
- Serve — exposes everything via CLI, JSON, markdown context, or MCP tools
MCP Server
Add to your MCP config (claude_desktop_config.json or equivalent):
{
"mcpServers": {
"aftermerge": {
"command": "git-aftermerge",
"args": ["mcp-serve"],
"cwd": "/path/to/your/repo"
}
}
}
Available MCP tools:
aftermerge_get_fate— fate of a specific commitaftermerge_get_patterns— aggregate survival patternsaftermerge_get_risky_areas— directories with lowest survival scoresaftermerge_get_recent_failures— recent reverts and bug-fix correlationsaftermerge_get_context— markdown summary for agent injection
CLI Reference
git-aftermerge init Initialize tracking in current repo
git-aftermerge scan Update commit fate data
git-aftermerge fate <sha> Show fate of a specific commit
git-aftermerge report Show aggregate patterns
git-aftermerge context Generate agent-consumable context file
git-aftermerge watch Watch for new commits and auto-scan
git-aftermerge mcp-serve Start MCP server (stdio)
Contributing
git clone https://github.com/inthepond/git-aftermerge.git
cd git-aftermerge
pip install -e ".[dev]"
pytest
License
MIT
Metadata
Release files for git-aftermerge 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| git_aftermerge-0.1.0.tar.gz | 50.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| git_aftermerge-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 82.3 kB
Release files / git_aftermerge-0.1.0.tar.gz
| Download URL | git_aftermerge-0.1.0.tar.gz |
|---|---|
| Size | 50.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
90f816f6f685dd8d34274994639eef14840a2fc804eb45f6838601560b6d5beb
|
|
BLAKE2b-256 checksum How to use checksums |
171d3b8efcc2fe0a2acee6cf46efa020340a2643937a5cd81ddc6aef2e80119f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 14, 2026.
Transparency logRelease files / git_aftermerge-0.1.0-py3-none-any.whl
| Download URL | git_aftermerge-0.1.0-py3-none-any.whl |
|---|---|
| Size | 31.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ef3b1ca2028b8c3803ce6895b4e0d89f4feb8bf7f395fe2ae17f0df429c13f42
|
|
BLAKE2b-256 checksum How to use checksums |
8ba482558b8170b45ec8a9ec40ba98ded37a89b860ff74dfc23be8e88fb80890
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 14, 2026.
Transparency log