git-history-detective

git-history-detective is a skill for Claude Code from latestaiagents/agent-skills. It costs 63 tokens per session (1,687 once invoked), scanned A, original, MIT.

A guide to investigating a codebase's Git history to learn when changes happened, who made them, and why code may have broken.

In plain words
What is it for?
Use it with commands such as git blame, git log, git show, and git bisect to find responsible changes, search commits, and identify when a bug was introduced.
Why use it?
It replaces guesswork when tracking down regressions, bugs, or the reason behind an old code change.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the developer-toolkit plugin — 19 skills shipped together

Good fit Use it with commands such as git blame, git log, git show, and git bisect to find responsible changes, search commits, and identify when a bug was introduced.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/latestaiagents/agent-skills/git-history-detective
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add latestaiagents/agent-skills --skill git-history-detective
Clone the repo
git clone --depth 1 https://github.com/latestaiagents/agent-skills

Made for: Claude Code.

Or install developer-toolkit, the plugin that ships this one along with the rest of its 19 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for git-history-detective

README.md
[![agentmods](https://agentmods.dev/badge/skills/latestaiagents/agent-skills/git-history-detective/github.svg)](https://agentmods.dev/skills/latestaiagents/agent-skills/git-history-detective)
Your own site
<a href="https://agentmods.dev/skills/latestaiagents/agent-skills/git-history-detective"><img src="https://agentmods.dev/badge/skills/latestaiagents/agent-skills/git-history-detective/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for git-history-detective

Your own site · 80×15
<a href="https://agentmods.dev/skills/latestaiagents/agent-skills/git-history-detective"><img src="https://agentmods.dev/badge/skills/latestaiagents/agent-skills/git-history-detective.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,687 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00063 $0.01687
Opus 5 $0.00032 $0.00843
Sonnet 5 $0.00013 $0.00337
Haiku 4.5 $0.00006 $0.00169

Measured 11d ago against content hash cf2459de37c2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

git-history-detective scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/developer-toolkit/skills/git/git-history-detective/SKILL.md · 294 lines

How it starts

The opening of the file, as written. The whole thing — 294 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Git History Detective

Find when bugs were introduced and understand code evolution.

When to Use

  • Finding when a bug was introduced
  • Understanding why code was changed
  • Finding who last modified a line
  • Tracking down a regression
  • Searching for commits by content

Quick Reference

Task Command
Who changed this line? git blame <file>
Find commit by message git log --grep="keyword"
Find commit by code change git log -S "code"
Binary search for bug git bisect
See file at old commit git show <commit>:<file>

Investigation Techniques

1. Git Blame - Find Line Authors

# Basic blame
git blame <file>

# Blame specific lines
git blame -L 10,20 <file>

# Ignore whitespace changes
git blame -w <file>

# Show original author (ignore moves/copies)
git blame -M -C <file>

# Blame with email
git blame -e <file>

Reading blame output:

abc1234 (John Doe 2024-01-15 10:30:45 +0000 42) function processData() {
│        │         │                       │    │
│        │         │                       │    └─ Line content
│        │         │                       └─ Line number
│        │         └─ Timestamp
│        └─ Author
└─ Commit SHA (first 7 chars)

2. Git Log - Search History

# Search commit messages
git log --grep="fix login"

# Search code that was added/removed
git log -S "functionName"  # "pickaxe" search

# Search with regex
git log -G "function.*deprecated"

# Find commits touching a file
git log --follow -- <file>

# Find commits by author
git log --author="John"

# Find commits in date range
git log --since="2024-01-01" --until="2024-02-01"

# Combine searches
git log --author="John" --grep="refactor" --since="2024-01-01"

3. Git Bisect - Binary Search for Bugs

When you know a bug exists now but didn't before:

# Start bisect
git bisect start

# Mark current (broken) commit as bad
git bisect bad

# Mark known good commit
git bisect good v1.2.0  # or a commit SHA

# Git checks out middle commit
# Test it, then:
git bisect good  # if bug NOT present
git bisect bad   # if bug IS present

# Repeat until Git finds the culprit
# "abc1234 is the first bad commit"

# End bisect
git bisect reset

Read the full file on GitHub · 294 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 294 lines · 63 tokens per session scan A cf2459de37c2

Subscribe to this mod's changes

git-history-detective is a skill published in the GitHub repository latestaiagents/agent-skills (5 stars, last pushed 4mo ago), licensed MIT. It adds 63 tokens to every session and 1,687 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories