# Git History Forensics

> Recover the "why" behind undocumented code changes using Git history forensics and blameless evidence analysis.

Git History Forensics is a paid AI agent skill on Agensi by Bandonker Labs., in Code Quality & Review. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $6.99 (one-time purchase)
- Creator: [Bandonker Labs.](https://www.agensi.io/creators/bandonkerlabs)
- Category: [Code Quality & Review](https://www.agensi.io/skills/code-quality-review)
- Version: 1.0
- Last updated: 2026-10-15
- Security: scan passed (2026-10-15); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/git-history-forensics
- Tags: code-review, git, debugging, python, documentation

## About this skill

When code behavior changes without a corresponding ticket or explanation, memory and guesswork are poor substitutes for evidence. This skill treats a Git repository as a forensic record to answer why a specific line exists or when a regression actually started. It moves beyond simple blame to analyze commit context, file coupling, and churn to provide a verifiable history of changes.

### What it does
- **Line forensics** blames specific lines and follows their history through renames to find the original intent.
- **Churn analysis** ranks files by insertions, deletions, and commit frequency to identify high-activity areas.
- **Logical coupling** identifies files that frequently change together, revealing the hidden blast radius of a change.
- **Regression bounding** calculates the commit window between known good and bad states to automate bisecting.
- **Forensic reporting** generates structured, blameless notes that anchor every finding to a SHA and a date.

### How it works
1. **Locate the change** using `when` to trace a line or `hot` to find where the most activity occurred.
2. **Analyze context** by comparing the author's claims in the commit message against the actual changes in the patch.
3. **Identify coupling** with the `couple` command to see which files act as traveling companions to the suspect path.
4. **Execute the hunt** by defining a deciding check command and generating a `git bisect` driver.
5. **Document findings** using the `note` command to record evidence and findings in a standardized format.

### Frameworks & tools
This tool uses a Python 3 CLI script `gitarch.py` that interacts with the local Git binary. It requires no network access and relies solely on the standard library and local repository history.

### Why this beats prompting it yourself
Generic LLM prompts often hallucinate commit history or fail to track files across complex renames. This skill uses a specialized script to pull raw evidence directly from your local repo, ensuring every claim is backed by a real SHA and timestamp rather than a guess.

### Use cases
- Investigating a changed default value or flag that has no associated Jira ticket.
- Mapping the blast radius of a subsystem rewrite by identifying coupled files.
- Finding the exact commit that introduced a regression in a large monorepo.
- Generating audit-ready documentation for postmortems or vendor questionnaires.

### Known limitations
Renames rewritten below Git's detection threshold or directory-level renames may break the history chain. Squashed or rebased history can hide intermediate states and original timestamps.

## Requires

- Git

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Git History Forensics skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### How does this skill avoid the 'hallucinations' common when asking an AI about code history?

This skill uses a specialized Python-based CLI that queries your local Git binary directly to pull raw data, preventing the hallucinations and 'guessed' history that occur when asking an LLM to recall code without a forensic toolset.

### Does this skill only work for specific programming languages or frameworks?

The tool works with any Git repository regardless of the programming language used, provided you have Python 3 and the standard Git CLI installed on your machine.

### Do I need to grant the AI agent access to my GitHub account or the internet?

No network access or API keys are required; the skill operates entirely on your local machine using your local repository history, ensuring your source code and commit data remain private.

### What exactly is included in the purchase?

You will receive the `gitarch.py` forensic script, the AI agent prompt configuration, and a comprehensive guide on how to integrate the two for automated repository analysis.

### Can this skill track the history of a file if it was renamed or moved multiple times?

While it tracks individual file renames effectively, it may lose the history chain if a file is substantially rewritten during a move or if the repository uses complex directory-level restructuring that exceeds Git's default detection thresholds.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
