New to Claude Skills? Learn how to install them →

shubhamsaboo on GitHub

Commit Archaeologist

Free

Uncover the history and intent behind your code.

Get this skill

Free · Opens the source repo

What Commit Archaeologist does

Commit Archaeologist is a specialized tool designed to help developers understand the historical context of their code directly from local git repositories. By tracing the evolution of specific lines or files, it reconstructs the reasons behind their existence, identifying the original commit, subsequent changes, and related files that may provide further insights. This skill is particularly useful when faced with questions like 'Why does this code exist?' or 'Who wrote this function and why?'. It runs entirely offline, ensuring that no network connectivity is required, and operates solely on the local git history.

The skill utilizes a Python script that processes the git history to extract relevant data, including commit messages, authorship, and file changes. It can generate a comprehensive report that outlines the timeline of changes, identifies co-changed files, and highlights intent signals from commit messages. This feature is crucial for developers preparing for refactors or rewrites, as it provides the necessary context to assess the risks involved in altering existing code.

One of the key advantages of Commit Archaeologist is its ability to produce a structured report that summarizes the findings in a clear manner. This report includes the bottom line of why the code exists, the origin of the changes, a timeline of edits, and any potential risks associated with modifying the code. By providing this information, it helps developers make informed decisions based on historical data rather than assumptions.

This skill is ideal for developers and teams that frequently work with legacy code or complex projects where understanding the rationale behind code is essential. Whether you're investigating a workaround, assessing the impact of a potential change, or simply trying to get to the bottom of a function's purpose, Commit Archaeologist offers the tools needed to navigate through git history effectively.

When to use it

Use this skill when you need to understand the origin and evolution of code before making changes or when investigating the rationale behind specific implementations.

When not to use it

This skill is not suitable for tasks that require raw git blame output or when working with remote repositories that have not been cloned locally.

What you can build with it

Investigating Legacy Code

When working with an older codebase, use this skill to understand why certain functions were implemented and how they evolved over time.

Preparing for Refactoring

Before refactoring a section of code, run this skill to gather historical context and assess potential risks associated with the changes.

Clarifying Code Ownership

If there's confusion about who wrote a specific piece of code, use Commit Archaeologist to trace back through the commit history and clarify authorship.

How to install Commit Archaeologist

View source

1. Install with the skills CLI

npx skills add shubhamsaboo/awesome-llm-apps/commit-archaeologist --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by shubhamsaboo

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:

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

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

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

Frequently asked questions about Commit Archaeologist

Similar skills