Skills Explorer Add Skills

git-safety-net

An agent skill by daymade, from daymade/claude-code-skills. Tags: git, resilience, review, troubleshooting, version-control.

What it does

Audits, preserves, recovers, and safely retires local Git state: unpushed or wrong-branch commits, dirty or detached worktrees, forgotten duplicate clones of the same repo, untracked work no bundle can back up, orphaned stashes, dangling commits, stale branches, and squash/rebase merge uncertainty. Use when the user fears work was lost; asks to recover a commit or branch; asks whether a worktree, clone, or scratch directory can be deleted; wants everything converged onto one main branch; or needs proof that cleanup will not drop work. Use it even after an audit reported clean — the usual gap is scope: every in-repo command is blind to a second clone elsewhere on disk. Triggers on "did I lose work", "is everything merged", "is anything else lost", "safe to delete this clone", "clean up old branches/stashes", "only keep one main branch", "git reflog", "dangling commits", "分支灾难", "误删分支/commit", "worktree 能删吗", "还有没有丢的东西", "只保留一个主分支". Covers local-Git forensics, not GitHub PR/API operations or routine sync.

Install

With the skills CLI, which installs into Claude Code, Codex, Cursor and other agents:

npx skills add daymade/claude-code-skills --skill git-safety-net

Or copy the skill folder into Claude Code's skills directory by hand (~/.claude/skills for every project, or .claude/skills inside one):

git clone --depth 1 https://github.com/daymade/claude-code-skills
cp -r claude-code-skills/git-safety-net ~/.claude/skills/git-safety-net

Safety box score

Grade D, elevated risk: 42 of 100 risk points, rated 2026-10-20. The grade rates what the skill and its scripts can reach on the machine of whoever installs it, across eight categories from shell execution to secrets access. How the score works.

This skill is a Git forensics and cleanup toolkit: it inspects local worktrees, refs, stashes, and remotes, can copy backup material into the filesystem, and can also retire branches/worktrees or remote refs once it decides they are safe. The main risks are repository mutation and remote network access; some core helper scripts were not readable in this review, so the exact behavior of the main audit/retirement paths is only partially visible.

Category levels, from 0 (none) to 3 (high)
CategoryLevelWhy
Code & shell execution2 (moderate)It ships shell scripts that invoke `git`, `find`, `cp`, `tar`, `shasum`, and inline Python (`python3 - ...`), so it executes real commands, but not arbitrary downloaded code or `eval`-style payloads.
Network access2 (moderate)It contacts and mutates remotes with `git ls-remote`, `git fetch`, and `git push`/`--delete`, so it can read from and write to hosting services.
Filesystem reach3 (high)It writes backup artifacts under `~/.git-backups/...`, copies files into the working tree, and the retirement flow includes `git worktree remove` and branch deletion, so local files and directories can be overwritten or removed.
Secrets & credentials0 (none)I saw no code that reads credential stores, keychains, passwords, browser sessions, or `.env` secrets; it uses normal Git auth only.
Privilege & persistence0 (none)It does not require sudo, global installs, service registration, or shell-startup edits; the only global-setting mention is an advisory `git config --global fetch.prune true` comment.
Instruction hijack surface0 (none)I found no instructions to ignore system/user rules, hide information from the user, follow fetched instructions, or adopt a misleading persona.
Irreversible actions3 (high)Mode E explicitly authorizes destructive cleanup such as `git branch -D`, `git worktree remove`, and `git push <remote> --delete <branch>` after verification, which is high-blast-radius repository mutation.
Transparency2 (moderate)Several core files were not readable in this review — `scripts/git_loss_audit.sh`, `scripts/git_prepare_clone_retirement.sh`, `scripts/git_verify_branch_merged.sh`, and the large reference docs — so the full behavior of the main audit/retirement/merge paths could not be independently verified.

Before installing

Rated 2026-10-20 by an automated review of 15 files from the skill's repository.

Source

Repository
daymade/claude-code-skills (all skills from this repository)
Path
git-safety-net/SKILL.md
Branch
main
Updated
2026-09-20