Skip to main content

PyPI version PyPI Downloads Python CI Docs License: MIT Ruff

git-aftermerge

Track the downstream fate of every commit. Feed structured post-merge feedback to AI coding agents.

git-aftermerge: commit merged → survival tracked over time → fate report feeds back to AI agent

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

  1. Scan — parses git history, runs git blame to track line-level survival
  2. Score — computes a 0–100 survival score per commit with penalties (reverts, bug-fixes) and bonuses (longevity, extensions)
  3. Detect — finds reverts (standard + manual), bug-fix correlations, and churn spikes
  4. Aggregate — rolls up patterns by path, author, commit type, size, and language
  5. 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 commit
  • aftermerge_get_patterns — aggregate survival patterns
  • aftermerge_get_risky_areas — directories with lowest survival scores
  • aftermerge_get_recent_failures — recent reverts and bug-fix correlations
  • aftermerge_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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git_aftermerge-0.1.0.tar.gz (50.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

git_aftermerge-0.1.0-py3-none-any.whl (31.8 kB view details)

Uploaded Python 3

File details

Details for the file git_aftermerge-0.1.0.tar.gz.

File metadata

  • Download URL: git_aftermerge-0.1.0.tar.gz
  • Upload date:
  • Size: 50.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for git_aftermerge-0.1.0.tar.gz
Algorithm Hash digest
SHA256 90f816f6f685dd8d34274994639eef14840a2fc804eb45f6838601560b6d5beb
MD5 eadc72c4f117a3bb6645e7e8167c7198
BLAKE2b-256 171d3b8efcc2fe0a2acee6cf46efa020340a2643937a5cd81ddc6aef2e80119f

See more details on using hashes here.

Provenance

The following attestation bundles were made for git_aftermerge-0.1.0.tar.gz:

Publisher: publish.yml on inthepond/git-aftermerge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file git_aftermerge-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: git_aftermerge-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 31.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for git_aftermerge-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ef3b1ca2028b8c3803ce6895b4e0d89f4feb8bf7f395fe2ae17f0df429c13f42
MD5 ed8e67f4d9b3e15d6cee6b25f733ccc9
BLAKE2b-256 8ba482558b8170b45ec8a9ec40ba98ded37a89b860ff74dfc23be8e88fb80890

See more details on using hashes here.

Provenance

The following attestation bundles were made for git_aftermerge-0.1.0-py3-none-any.whl:

Publisher: publish.yml on inthepond/git-aftermerge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page