Tooluck logoTooluck
SKILL.md

git-safety-net

Agent skill fromdaymade/claude-code-skills

Audits, preserves and recovers local Git state before cleanup: unpushed or wrong-branch commits, dirty worktrees, duplicate clones, stashes, dangling commits, squash-merge uncertainty. Use when the user fears lost work, wants to recover a commit, asks if a branch is actually merged, asks whether a branch, worktree or clone is safe to delete, or wants one clean main (误删分支 / 还有没有丢的东西). Not for GitHub PR operations.

How to install git-safety-net

install git-safety-net
# install the claude-code-skills pack with the skills CLI
npx skills add daymade/claude-code-skills

# or add only this skill to Claude Code: copy the folder

git-safety-net/

# into

~/.claude/skills/git-safety-net/ (all projects)

.claude/skills/git-safety-net/ (one project)

git-safety-net/SKILL.md

MITFull file
1# Git Safety Net
2
3Prevent losing work in a tangle of branches/stashes/rebases, and recover it forensically
4when something already went sideways. The commands here are all **non-destructive or additive**
5until a step is explicitly labeled destructive — recovery must never make the loss worse.
6
7## Outcome contract — keep the safety net subordinate to the user's job
8
9Before Mode B/E or any command that writes a ref or backup, state the following in the conversation
10(do not create another file):
11
12- **Outcome:** the user-visible end state, in the user's words.
13- **Current phase:** what is authorized now. "Later" work is not authorized in this phase.
14- **Authorized targets:** named objects this phase may inspect, plus the subset it may change.
15- **Stop condition:** observable facts that end the task.
16
17Then enforce these boundaries:
18
19- **Evidence scope is not action scope.** A read-only audit may discover another clone, ref,
20 repository, or dangling object. That discovery may widen the report; it does not authorize
21 preserving, uploading, merging, deleting, or otherwise changing the newly found object.
22- **Authorization is object-specific, not repository-wide by implication.** "Take over",
23 "continue", or "finish the cleanup" applies only to the checkout/ref/PR the user identified.
24 A collaborator-owned worktree, branch, or PR discovered later stays report-only until the user
25 names it as a change target. If the user says to leave it alone, record that exclusion and do
26…

Excerpt shown under the repository's MIT license.

More skills in claude-code-skills

Keep exploring

Similar skill repositories

thedotmack /

claude-mem
116k

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

CCCXGHGM+135 skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates