Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

commit-archaeologist — Claude Code skill: what it does & setup

Reconstructs why code exists from local git history. Useful before refactoring, rewrites, or risky edits to reveal original intent and linked changes.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Shubhamsaboo/awesome-llm-apps --skill commit-archaeologist -a claude-code
Open on GitHub

What commit-archaeologist does

Standard git blame only shows who touched a line last. This skill finds the commit that originally introduced the code and reconstructs the timeline of subsequent edits. It inspects commit messages for intent markers such as issue references, workarounds, or reverts, and highlights companion files that changed repeatedly alongside the target region.

The package includes scripts/archaeologist.py and the interpretation guide references/reading-git-history.md. When given a line range, the script relies on git line-log; without line numbers, it tracks the full file history and follows renames. It then formats the findings into a report with confidence ratings and change risks before any edits begin.

Everything executes offline without network requests, API keys, or writes to the repository. The script will fail on an un-cloned remote repository, so the target codebase must be present on your local drive first.

What it helps with

  • find the commit that introduced a specific code block
  • reveal companion files frequently edited alongside a function
  • inspect git history before refactoring or rewriting legacy code
  • detect temporary workarounds and issue references in past commits

Example prompts for the agent

  • commit-archaeologist: why does this function in src/cache.py exist?
  • commit-archaeologist: explain the history of lines 40-72 in src/cache.py before I refactor
  • commit-archaeologist: find who introduced this block and what files changed beside it

How to install commit-archaeologist

1Skills CLI (Vercel)

npx skills add Shubhamsaboo/awesome-llm-apps --skill commit-archaeologist -a claude-code

2Manually: put the files in place

~/.claude/skills/commit-archaeologist/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/commit-archaeologist/

From the same set5

The whole set →

Similar

track-management Seth Hobson This skill manages Conductor tracks for features, bugs, and refactors. Use it when work needs a clear spec, plan, status, and completion flow. Claude Code CX Codex Cursor 10,300installs deslop cursor Inspects branch diffs against main to remove AI-generated code clutter and inconsistent styling. Ideal for polishing branch changes before pull request review. Claude Code CX Codex Cursor +1 9,300installs parallel-feature-development Seth Hobson This skill splits a large feature into parallel work streams, assigns file ownership, and guides integration. Use it when several agents share one codebase. Claude Code CX Codex Cursor 9,900installs devops-engineer https://github.com/Jeffallan This skill creates Dockerfiles, CI/CD configs, Kubernetes manifests, and IaC templates. Use it for deployments, platform work, and incident response. Claude Code CX Codex Cursor +1 11,200installs autoresearch official luiscantero Runs an iterative code experiment loop: changes the project, measures a defined result, and keeps improvements. Use it when success can be measured. GitHub Copilot 3,400installs work-with-pr code-yeongyu This skill takes a task from isolated worktrees to merged PRs, splitting independent work and repeating fixes when a verification gate fails. Claude Code CX Codex Cursor +1 761installs triage Matt Pocock This skill moves issues and external PRs through triage states, verification, and agent briefs. It fits maintainers managing an issue queue. Claude Code 990,453installs code-review Matt Pocock Reviews changes from a chosen reference point against repository standards and the originating spec. Use it for a branch, PR, or work in progress. Claude Code 789,521installs

Questions about commit-archaeologist

How do I install commit-archaeologist in Claude Code?

Run npx skills add Shubhamsaboo/awesome-llm-apps --skill commit-archaeologist -a claude-code. This installs the skill files into your Claude Code environment.

What does commit-archaeologist do?

The skill inspects the local git history of a target file or line range. It pinpoints the introducing commit, builds an edit timeline, identifies companion files, and extracts intent signals from commit messages.

Does commit-archaeologist require internet access or write permissions?

No, the skill is completely read-only and runs offline. It makes no network calls, requires no API keys, and never writes to your repository or modifies git history.

Source text

SKILL.md · Apache-2.0
---
name: commit-archaeologist
description: >-
  Reconstructs why code exists from local git history, including the introducing
  commit, later changes, current authors, repeated companion files, and likely
  intent. Use when the user asks "why does this code exist", "who wrote this
  function and why", or to "explain the history of this function" before a
  rewrite, refactor, or risky edit. Runs entirely locally.
license: Apache-2.0
metadata:
  author: "Matt Van Horn"
  version: "1.0.0"
  source: "https://github.com/Shubhamsaboo/awesome-llm-apps"
---

# Commit Archaeologist

`git blame` names the last person to touch a line. This skill reconstructs the
reason the line exists. It traces a file or current line range through local git
history, identifies its origin and later edits, finds files that repeatedly
changed beside it, and extracts intent clues from commit messages.

Everything runs locally. No network calls, API keys, or repository writes.

## When to use

- The user asks why a block, function, or file exists
- The user wants to know who introduced code and what changed afterward
- A rewrite or refactor needs historical constraints and change risks
- A workaround, temporary branch, or surprising design choice needs context

## When not to use

- The user only wants raw blame output or a commit list
- The task is to squash, delete, or rewrite git history
- The repository is remote and has not been cloned locally
- The question is about project-wide architecture rather than one file or region

## Gather the target

Get the repository path and tracked file path. Use a line range when the user
names a current block or function. If either path is missing, ask only for the
missing value. Do not scan sibling repositories.

Paths should be relative to the repository and use forward slashes. Line ranges
use inclusive current line numbers such as `40-72`.

## Run the dig

From this skill directory:

```bash
python3 scripts/archaeologist.py /path/to/repo src/cache.py --lines 40-72 --json
```

For the complete history of a file, omit `--lines`:

```bash
python3 scripts/archaeologist.py /path/to/repo src/cache.py --json
```

The script is read-only. With a range it uses git line-log; without one it uses
file history with rename following. It also reads current authorship with blame.
If it rejects a path or range, report that error and ask for a corrected target.

Before interpreting the JSON, read
`references/reading-git-history.md`. Its confidence rules prevent blame
ownership, correlation, and commit-message hints from becoming false certainty.

## Read the JSON

- `region`: normalized repository, current and historical paths, mode, range,
  and co-change threshold
- `introduced_by`: oldest commit in the selected history
- `timeline`: commits ordered oldest to newest, with category, changed files,
  and detected renames
- `co_changed`: files present beside the target in enough selected commits
- `authors`: current blamed lines and historical commit counts, kept separate
- `intent_signals`: issue references, reverts, workarounds, temporary markers,
  and unfinished-work markers found in commit messages

An empty signal list means the messages do not say why. It does not mean the
change had no reason.

## Write the report

Turn the JSON into a short "why this code exists" report:

1. **Bottom line.** One or two sentences with the most likely explanation and
   a confidence label: high, medium, or low.
2. **Origin.** Introducing hash, date, author, subject, and the neighboring
   files that make the initial purpose clearer.
3. **Timeline.** Oldest to newest. Group mechanical edits when they do not
   change the story, but preserve reverts, fixes, and workarounds.
4. **Companion files.** Explain repeated co-changes as a coupling clue. Do not
   treat a one-off file in `changed_files` as a dependency.
5. **Intent evidence.** Quote short commit subjects or signal words. Label any
   conclusion beyond those facts as an inference.
6. **Change risk.** Name the constraints, companion files, and unresolved
   temporary choices worth checking before an edit.

Keep hashes short in prose, but preserve enough characters to identify them.
Do not dump the full JSON unless the user asks.

## Evidence rules

- Current blame ownership is not proof of original authorship.
- The oldest selected commit is the region's introduction, not always the
  file's first commit.
- Repeated co-change suggests coupling; it does not prove a dependency.
- Commit categories are message heuristics, not verified issue types.
- "Temporary" and "workaround" are strong intent clues, but only the message
  author or linked discussion can confirm whether the constraint still applies.
- If the history is thin or messages are vague, say "the history shows" and
  "likely" instead of inventing a design rationale.

## Follow-ups

End by offering one relevant follow-up, such as:

- "Want me to assess whether this looks deliberate or accidental?"
- "Want me to map what could break if this region changes?"

For a deliberate-choice question, weigh repeated edits, issue references,
reverts, and explicit constraint words. For a change-risk question, inspect the
repeated co-change files and the last behavior-changing commits before proposing
edits. Do not modify code until the user asks.

## Files

- `scripts/archaeologist.py`: offline git history walker and JSON report builder
- `references/reading-git-history.md`: interpretation and confidence guide

© Matt Van Horn · Apache-2.0 · Shubhamsaboo/awesome-llm-apps

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor