awesome-git-history-salvage

awesome-git-history-salvage is a skill for Claude Code from khasky/awesome-agent-skills. It costs 146 tokens per session (5,661 once invoked), scanned A, original, MIT.

A guide for recovering the complete history of a Git repository, including commits hidden by force-pushes, deleted branches, or merged pull requests. Git is a version-control system that records changes to files over time.

In plain words
What is it for?
Use it to investigate what a repository has ever contained, recover erased branches or force-pushed commits, and produce a complete list of recovered commit details.
Why use it?
The usual Git log shows only commits still reachable from current references, so important older work may be missing. This process combines repository references, host records, backups, and Git protocol access to find unreachable commits.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: positional $N argument.

Part of the awesome-agent-skills plugin — 42 skills shipped together

Good fit Use it to investigate what a repository has ever contained, recover erased branches or force-pushed commits, and produce a complete list of recovered commit details.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/khasky/awesome-agent-skills/awesome-git-history-salvage
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 khasky/awesome-agent-skills --skill awesome-git-history-salvage
Clone the repo
git clone --depth 1 https://github.com/khasky/awesome-agent-skills

Made for: Claude Code.

Or install awesome-agent-skills, the plugin that ships this one along with the rest of its 42 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 awesome-git-history-salvage

README.md
[![agentmods](https://agentmods.dev/badge/skills/khasky/awesome-agent-skills/awesome-git-history-salvage/github.svg)](https://agentmods.dev/skills/khasky/awesome-agent-skills/awesome-git-history-salvage)
Your own site
<a href="https://agentmods.dev/skills/khasky/awesome-agent-skills/awesome-git-history-salvage"><img src="https://agentmods.dev/badge/skills/khasky/awesome-agent-skills/awesome-git-history-salvage/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 awesome-git-history-salvage

Your own site · 80×15
<a href="https://agentmods.dev/skills/khasky/awesome-agent-skills/awesome-git-history-salvage"><img src="https://agentmods.dev/badge/skills/khasky/awesome-agent-skills/awesome-git-history-salvage.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 146 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,661 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Memory Poisoning · line 3
    Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
    Fix: Protect agent memory and state from modification by untrusted content. Use read-only memory for critical instructions and validate all state changes.
How audits are shown
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.00146 $0.05661
Opus 5 $0.00073 $0.02831
Sonnet 5 $0.00029 $0.01132
Haiku 4.5 $0.00015 $0.00566

Measured yesterday against content hash f141f7bfe42f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

awesome-git-history-salvage 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 yesterday.

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.

skills/awesome-git-history-salvage/SKILL.md · 336 lines

How it starts

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

Git History Salvage

Answer one question completely: what has this repository ever contained? Not what git log shows — that is only the current branch. The full set includes commits erased by every force-push the repository has taken, commits that live only on a merged pull request's ref, and commits on branches deleted years ago.

Why it is not just git log --all: a force-push replaces a ref, it does not delete objects. The objects stay on the host, unreachable, and the host keeps a public record of every ref state in its activity log. Those two facts together are what makes the old history recoverable — but only if you know that git fetch origin <sha> serves an unreachable commit while GET /repos/{owner}/{repo}/commits/{sha} answers 422 No commit found for the same SHA. The git protocol succeeds where REST refuses, and that asymmetry is the whole technique.

Measured case. A repository whose default branch had just been rebuilt showed 67 commits in git log. Merging the four sources below produced 319 — 252 of them off-branch, including a whole erased 62-commit history, 50 bot commits on pull-request refs, and 5 commits under a differently-capitalized author name that exist nowhere in the current tree. All 74 ref states the activity log recorded were still fetchable; none had aged out.

Core principle

READ-ONLY, AND HONEST ABOUT THE EDGES. This skill fetches and reports. It never pushes, never deletes a ref, and never touches the user's own checkout — every fetch lands in a disposable scratch clone, because salvage writes dozens of refs (refs/salvage/*, refs/pr/*) that nobody wants in a working repository.

Three invariants:

  • Never work in the user's checkout. The salvage adds one ref per recovered SHA. In a scratch clone that is free; in a working copy it is litter the user has to clean up, and git log --all there is wrong from then on.
  • Every source is additive and deduplicated by SHA. A commit found in three places is one row. A commit found in none is not invented.
  • State what could not be reached. The activity log records ref states, not commit lists. A commit that only ever existed mid-branch and was never the tip of a push has no row anywhere, and no technique here finds it. Say so in the report rather than implying completeness.

Read the full file on GitHub · 336 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. yesterday Changed f141f7bfe42f
  2. 6d ago Changed · -95 tokens per session b4fd8c56b5ee
  3. 12d ago First seen · 336 lines · 241 tokens per session scan A 4a6605fcb5d4

Subscribe to this mod's changes

awesome-git-history-salvage is a skill published in the GitHub repository khasky/awesome-agent-skills (8 stars, last pushed yesterday), licensed MIT. It adds 146 tokens to every session and 5,661 once invoked, about $0.0007 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

git-workflow-and-versioning

Structures git workflow practices. Use when making any code change. Use when committing, branching, resolving conflicts, splitting uncommitted work in a messy working tree into clean atomic commits, opening or reviewing a pull request (PR), pushing to a remote, or when you need to organize work across multiple…

addyosmani/agent-skills · 89 tokens

chinese-git-workflow

A reference for configuring Git with Chinese code-hosting services such as Gitee, Coding.net, GitLab China, and CNB, including SSH, HTTPS, credentials, CI, and repository mirroring.

jnMetaCode/superpowers-zh · 69 tokens

chinese-commit-conventions

A Chinese-language guide to Conventional Commits, a format for writing consistent Git commit messages, plus related changelog, commit-checking, and commit-helper configuration.

jnMetaCode/superpowers-zh · 65 tokens

using-git-worktrees

A guide to using Git worktrees, which let you keep multiple branches in separate folders at the same time.

jnMetaCode/superpowers-zh · 44 tokens

finishing-a-development-branch

A process for finishing a completed development branch. A branch is a separate line of code changes that can later be merged or submitted as a pull request.

jnMetaCode/superpowers-zh · 25 tokens

skillshare-changelog

Generate CHANGELOG.md entry from recent commits in conventional format. Also syncs the website changelog page. Use this skill whenever the user asks to: generate a changelog, document what changed between tags, or create a new CHANGELOG entry. If you see requests like "write the changelog for v0.17", "what changed…

runkids/skillshare · 134 tokens