Git Safety Net
Git forensics skill that recovers lost commits, branches and stashes, proves merges by content, and retires leftovers only after verified backups.
Dev & CodingIntermediate★ 1,323⑂ 212AI score 9/10Last updated: Aug 8, 2026
What it does
- Recover (Mode A): walks the
git reflog→git fsck --danglingladder to find vanished commits, branches and stashes and restores them onto a freshrescue/branch (never a reset onto live work). - Audit & preserve (Mode B): scans the whole machine for every checkout of the repo — including independent clones that
git worktree listcan never see — then audits each one for unpushed commits, dirty worktrees, stashes and dangling objects. Pins refs, exports patches, and plain-copies untracked files that bundles/archives physically cannot reach. - Verify merged (Mode C): ignores misleading "173 commits ahead" counts and runs an in-memory
git merge-treetrial merge for a sound MERGED / UNMERGED verdict, biased toward safety. - Prevent (Mode D): commit-then-switch instead of stashes or second clones, push WIP branches early, use checkout-independent commands like
git branch -fin shared trees. - Retire safely (Mode E): evidence ladder (
git cherry, superset file comparison, symbol probe) before deleting worktrees, stashes, branches or clones — with a guard that abortsrm -rfif a backup file is missing.
All five bundled scripts are read-only or additive: they never checkout, reset, push, stash drop, branch -d, or gc.
Who it's for
- Developers who have panicked after a rebase, squash-merge or
reset --hard - Anyone sitting on a pile of stale branches, stashes and worktrees they're afraid to delete
- Teams running parallel sessions or agents against a shared working tree
- Leads who must prove "nothing was lost" before converging everything onto one main branch
Examples
- "I reset --hard and my commit is gone" → locate the old HEAD in reflog, confirm with
git show, recover viagit switch -c rescue/feature <sha>. - "Can I delete this old clone directory?" → discover all checkouts, copy untracked files out, write
uncommitted.diffand a verified bundle, and only thenrm -rfbehind a backup-exists gate. - "Are all these branches merged?" → per-branch content verdict from
git merge-tree; anything unprovable is kept and listed for review instead of deleted.
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/daymade/claude-code-skills/HEAD/git-safety-net/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the git-safety-net folder from the GitHub repo daymade/claude-code-skills into my ~/.claude/skills/git-safety-net/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/daymade/claude-code-skills.git /tmp/claude-code-skills && mkdir -p ~/.claude/skills && cp -r /tmp/claude-code-skills/git-safety-net ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal and clone the repository into a temp folder:
git clone https://github.com/daymade/claude-code-skills.git /tmp/claude-code-skills - Create the skills directory if needed:
mkdir -p ~/.claude/skills - Copy just this skill:
cp -r /tmp/claude-code-skills/git-safety-net ~/.claude/skills/ - Make the helper scripts executable:
chmod +x ~/.claude/skills/git-safety-net/scripts/*.sh - Restart Claude Code,
cdinto the Git repository you want checked, and say something like "did I lose any work?" or "is it safe to delete this branch/clone?" to trigger the skill. - Start with the read-only Mode B audit; only approve Mode E's destructive steps after you personally read the backup-verification output.
View source on GitHub ↗License: MIT