# Git archaeology

> Git archaeology is an open-source agent skill for developer tools. Traces why odd code exists through git history before anyone removes it. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/rpraharaj/forward-deployed-engineer/tree/main/fde-core/skills/git-archaeology
- **Repository:** https://github.com/rpraharaj/forward-deployed-engineer
- **GitHub stars:** 19
- **License:** MIT
- **Skill name:** git-archaeology
- **Collection:** https://github.com/rpraharaj/forward-deployed-engineer
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

Git archaeology gives the agent a repeatable way to recover the intent behind code that looks wrong, unnecessary or arbitrary. It walks from git blame to the full commit, then to the linked pull request and ticket, and checks for past reverts and hotfix commits that show a change was already tried and rolled back.

The skill also guides the agent to judge whether a change was made under pressure, based on timing and the other files touched alongside it. It ends with a verdict such as load-bearing, obsolete or no history, and a default rule to leave code in place when uncertain. Where the reason is found, the agent is directed to record it as a code comment citing the commit.

It relies on shell git commands and, when available, the GitHub or GitLab CLIs to look up merged pull requests. A readable git history is required; shallow clones are flagged as unverified. Findings are written to a traces file in the engagement workspace.

## When your agent uses it

> Recover intent from history when code looks wrong - blame to commit to pull request to linked ticket, plus revert and hotfix patterns - so you find out why something is the way it is before removing it. Use when code looks unnecessary or bizarre, before deleting anything odd, when a constant or special case has no explanation, when a comment contradicts the code, or when you are about to say "this can be simplified". Exists specifically to prevent Chesterton's Fence mistakes, where the ugly branch turns out to be an incident fix and removing it reopens the incident.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/rpraharaj/forward-deployed-engineer/tree/HEAD/fde-core/skills/git-archaeology)
- [License: MIT](https://github.com/rpraharaj/forward-deployed-engineer/tree/HEAD/fde-core/skills/git-archaeology)

## Features

- **Blame with move tracking:** Uses whitespace-ignoring and copy-following blame to find the real author of specific lines.
- **Full commit context:** Reads sibling files changed in the same commit to spot incident responses behind terse messages.
- **Pull request and ticket lookup:** Finds linked PRs and ticket keys from commit messages, including squash-merged history.
- **Revert and hotfix search:** Searches history for reverted, reapplied or incident-related changes to the same code.
- **Recorded verdicts:** Produces a written verdict per symbol and suggests comments that explain the code's purpose.

## Good for

- Explain why a magic number in a retry client is set the way it is
- Check whether a special case for one customer can be safely removed
- Find the incident or ticket behind an odd branch before refactoring it
- Verify whether a comment that contradicts the code reflects an old decision
- Document the reasoning behind unexplained code for the next engineer

## Install

### Claude Code

This skill ships in the `fde-core` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add rpraharaj/forward-deployed-engineer
/plugin install fde-core@fde-skills
```

Or copy only this skill to `~/.claude/skills/git-archaeology`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/rpraharaj/forward-deployed-engineer.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/git-archaeology &&
cp -R "$tmp/fde-core/skills/git-archaeology" ~/.claude/skills/git-archaeology &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/git-archaeology` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/git-archaeology` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/rpraharaj/forward-deployed-engineer.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/git-archaeology &&
cp -R "$tmp/fde-core/skills/git-archaeology" ~/.agents/skills/git-archaeology &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/git-archaeology` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/git-archaeology` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/rpraharaj/forward-deployed-engineer.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/git-archaeology &&
cp -R "$tmp/fde-core/skills/git-archaeology" ~/.cursor/skills/git-archaeology &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/git-archaeology` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/rpraharaj/forward-deployed-engineer.git --path fde-core/skills/git-archaeology
```

Or copy the folder to `~/.gemini/skills/git-archaeology` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/git-archaeology`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/rpraharaj/forward-deployed-engineer.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/git-archaeology &&
cp -R "$tmp/fde-core/skills/git-archaeology" ~/.copilot/skills/git-archaeology &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/git-archaeology` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/rpraharaj/forward-deployed-engineer.git
```

Then copy `forward-deployed-engineer/fde-core/skills/git-archaeology` into your agent's skills folder as `git-archaeology`. Agents that support SKILL.md read one folder per skill.

## FAQ

### When should the agent use Git archaeology?

When code looks unnecessary or bizarre, before deleting anything odd, when a constant or special case has no explanation, when a comment contradicts the code, or when someone proposes simplifying it.

### What does Git archaeology need to work?

Git history that can be read. If the repository is a shallow clone, the skill says so and tags conclusions as unverified. Host CLIs such as gh or glab are used when present.

### Does Git archaeology change the code?

It is designed to leave code in place when uncertain. When a reason is found, it adds a comment citing the commit and writes a trace file to the engagement workspace.

### Does Git archaeology run scripts?

No scripts are bundled. It instructs the agent to run standard git commands and optional host CLI calls.

### How do I install Git archaeology in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/git-archaeology to use it in all your projects, or to .claude/skills/git-archaeology in one project. Or install the fde-core plugin, which includes it: /plugin marketplace add rpraharaj/forward-deployed-engineer, then /plugin install fde-core@fde-skills.

### Which AI agents can use Git archaeology?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Git archaeology?

The closest alternatives to Git archaeology are Why, Improve codebase architecture, Repo story time, Correct and Repo recon.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Why](https://ai-powered.com/skills/why-michael-denyer): Why is an open-source agent skill for developer tools.
- [Improve codebase architecture](https://ai-powered.com/skills/improve-codebase-architecture): Improve codebase architecture is an open-source agent skill for developer tools.
- [Repo story time](https://ai-powered.com/skills/repo-story-time): Repo story time is an open-source agent skill for developer tools.
- [Correct](https://ai-powered.com/skills/correct): Correct is an open-source agent skill for developer tools.
- [Repo recon](https://ai-powered.com/skills/repo-recon): Repo recon is an open-source agent skill for developer tools.
- [Trace architecture](https://ai-powered.com/skills/trace-architecture): Trace architecture is an open-source agent skill for developer tools.
- [Intent drift](https://ai-powered.com/skills/intent-drift): Intent drift is an open-source agent skill for developer tools.
- [Git](https://ai-powered.com/skills/git-jasgujral): Git is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/git-archaeology
