clawstash: Skill for Claude Code

.claude/skills/rollback/SKILL.md

rollback is a skill for Claude Code from fo0/clawstash. It costs 82 tokens per session (1,930 once invoked), scanned A, original, MIT.

A recovery procedure for undoing changes in a Git repository, such as local edits, commits, pushes, or merged pull requests. It first identifies the current state and then selects a reversal method.

In plain words
What is it for?
Use it to undo uncommitted work, local commits, pushed commits, broken changes on the main branch, merged pull requests, or accidentally deleted branches.
Why use it?
It helps restore a project after a bad change while accounting for whether the change was shared with others.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths; mentions CLAUDE.md.

This is fo0/clawstash's own configuration. It tells Claude Code how to work on clawstash itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything clawstash configures →

Reuse

Borrowing it

Nothing to install: this file belongs to fo0/clawstash. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/fo0/clawstash/main/.claude/skills/rollback/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/fo0/clawstash

Made for: Claude Code.

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 rollback

README.md
[![agentmods](https://agentmods.dev/badge/skills/fo0/clawstash/rollback/github.svg)](https://agentmods.dev/skills/fo0/clawstash/rollback)
Your own site
<a href="https://agentmods.dev/skills/fo0/clawstash/rollback"><img src="https://agentmods.dev/badge/skills/fo0/clawstash/rollback/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 rollback

Your own site · 80×15
<a href="https://agentmods.dev/skills/fo0/clawstash/rollback"><img src="https://agentmods.dev/badge/skills/fo0/clawstash/rollback.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 82 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,930 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.
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.00082 $0.01930
Opus 5.5 $0.00033 $0.00772
Sonnet 5.5 $0.00016 $0.00386
Haiku 4.5 $0.00008 $0.00193

Measured 26d ago against content hash e61be9912fb8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

rollback 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 26d ago.

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.

.claude/skills/rollback/SKILL.md · 154 lines

How it starts

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

Rollback — Recovery Workflow

When to Use

  • User says "/rollback", "rollback", "revert", "undo", "restore"
  • Agent broke main / merged a bad PR / pushed a defect / corrupted a branch

Scope Boundaries

Owns: reversing git state that already exists — uncommitted changes, local commits, pushed commits, an open or merged PR, a deleted branch. Does not own: diagnosing why it broke (stuck), fixing a red build forward instead of backward (ci), reversing a deployment (CLAUDE.md → Deployment). Reaching for it to escape a confusing state rather than a broken one is the wrong skill: that is stuck.

Auto-Detect Target

git rev-parse --abbrev-ref HEAD
git status --porcelain
git log -1 --pretty='%H %s'
git log @{u}..HEAD --oneline 2>/dev/null  # local-only commits
git log HEAD..@{u} --oneline 2>/dev/null  # behind upstream
gh pr list --head $(git rev-parse --abbrev-ref HEAD) --json number,state 2>/dev/null

Decision matrix:

State Action
Uncommitted local changes only Phase A (discard working tree, opt-in)
Local commits, not pushed Phase B (reset back N commits)
Pushed commits on feature branch Phase C (revert + push, or force-with-lease — explicit)
Pushed to main + bad commit on top Phase D (revert + push)
Merged PR causing breakage Phase E (revert PR via gh)
Branch deleted by mistake Phase F (restore from reflog / origin)

Always print the detected state and proposed action before executing:

Detected: pushed 2 commits to feature/x; latest broke build.
Proposed: git revert HEAD~1..HEAD && git push (no force).
Proceed? (yes/no)

Unattended ($CLAUDE_CODE_REMOTE=true): nobody answers Proceed?, and a run that waits for it is a dead run (CLAUDE.md → Autonomy). The phases split by what they destroy. Phases C, E and F add commits or restore a ref — they run without the prompt, and the detection line above becomes a report line. Phase D is the exception among the additive phases: its direct push to the default branch is interactive-only. Unattended, a bad commit on the default branch takes the Phase E path — revert commit on its own branch, revert PR, merge through the pr skill's gate — because a run that pushes straight to the default branch breaks the repo's own branch rule, whatever it pushes. Phases A and B and every force operation destroy work: they run unattended only when the instruction that invoked this skill ordered exactly that (the stuck skill's unattended step ordering the loop work discarded is one); otherwise skip, report the proposed command, and continue with what does not depend on it.

Read the full file on GitHub · 154 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. 26d ago Changed e61be9912fb8
  2. 1mo ago Changed · -2 lines ac1c5235ac68
  3. 1mo ago Changed · +2 lines 957a33c42eff
  4. 1mo ago Changed · +11 lines 4f4f8fe9ae09
  5. 2mo ago First seen · 143 lines · 82 tokens per session scan A a3e159bd1ce0

Subscribe to this mod's changes

rollback is a skill published in the GitHub repository fo0/clawstash (1 stars, last pushed today), licensed MIT. It adds 82 tokens to every session and 1,930 once invoked, about $0.0003 per session on Opus 5.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

publish-release

Releases a new McpOrchestrator version end to end — version bump PR, tag, and the automated deploy to GitHub Releases, NuGet, and the MCP Registry. Use when asked to release, publish, deploy, ship, or bump the version of McpOrchestrator.

Byggarepop/dotnet-mcp-orchestrator · 63 tokens

feedback-nudge

Use when the user wants to report a bug, request a feature, or send feedback to the Zooza engineering team. Also offer proactively after a successful commit operation (max once per week).

zooza-dev/zooza-mcp-server · 38 tokens

release-notes

Writes user-facing release notes from a git commit range. Use when asked to draft release notes, a changelog entry, or "what's new" text for a release.

Byggarepop/dotnet-mcp-orchestrator · 39 tokens

release-and-publish

Ship a release end-to-end across every registry the project targets (npm, MCP Registry, GitHub Releases for .mcpb bundles, GHCR). Runs the final verification gate, fast-forwards main when the release rode a release PR, creates the annotated tag on the commit main now points at, pushes commits and tags, then publishes…

cyanheads/pubmed-mcp-server · 155 tokens

git-wrapup

Land working-tree changes as logical commits — the work grouped by concern, topped by a release commit (version bump, changelog, regenerated artifacts). The work commits land first, then the version bump, verification, and the release commit on top. Stops at "committed locally on main" — or, when the project releases…

cyanheads/pubmed-mcp-server · 109 tokens

release-pr-review

Review pass on an open release PR (release/ → main) — the step between git-wrapup and release-and-publish when a project releases in gated release PR mode. Reads the PR's commit range through the code-simplifier lens plus a correctness review, verifies whatever an automated reviewer left on the PR, lands fixes as…

cyanheads/pubmed-mcp-server · 136 tokens