rollback

rollback is a command for Claude Code from MartyBonacci/specswarm. It costs 8 tokens per session (4,257 once invoked), scanned C, original, MIT.

A command for safely undoing work on a feature branch, a separate Git line used for one change.

In plain words
What is it for?
Use it to revert feature changes, clean up feature documents, optionally delete the feature branch, and return to its parent branch.
Why use it?
It helps remove unwanted code and related planning files while protecting important branches and checking for unsafe conditions first.

Command for Claude Code

Written for Claude Code: effort in frontmatter. Also seen: names the AskUserQuestion tool.

Part of the ss plugin — 10 skills, 34 commands, 6 agents, 4 hooks shipped together

Good fit Use it to revert feature changes, clean up feature documents, optionally delete the feature branch, and return to its parent branch.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/martybonacci/specswarm/rollback
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.

Clone the repo
git clone --depth 1 https://github.com/MartyBonacci/specswarm

Made for: Claude Code.

Or install ss, the plugin that ships this one along with the rest of its 10 skills, 34 commands, 6 agents, 4 hooks.

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/commands/martybonacci/specswarm/rollback/github.svg)](https://agentmods.dev/commands/martybonacci/specswarm/rollback)
Your own site
<a href="https://agentmods.dev/commands/martybonacci/specswarm/rollback"><img src="https://agentmods.dev/badge/commands/martybonacci/specswarm/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/commands/martybonacci/specswarm/rollback"><img src="https://agentmods.dev/badge/commands/martybonacci/specswarm/rollback.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,257 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00008 $0.04257
Opus 5.5 $0.00003 $0.01703
Sonnet 5.5 $0.00002 $0.00851
Haiku 4.5 $0.00001 $0.00426

Measured yesterday against content hash 2eb3486e174f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

rollback scanned grade C with 1 finding 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf "$FEATURE_DIR"
plugins/ss/commands/rollback.md · 578 lines

How it starts

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

User Input

$ARGUMENTS

Goal

Safely rollback a feature that failed or is no longer wanted, including:

  1. Reverting all code changes since branch creation
  2. Cleaning up feature artifacts (spec.md, plan.md, tasks.md)
  3. Optionally deleting the feature branch
  4. Switching back to the parent branch

Provides two rollback strategies with comprehensive safety checks.


Execution Steps

Step 1: Safety Checks

echo "🔍 Performing safety checks..."
echo ""

# Check 1: Get current branch
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)

if [ -z "$CURRENT_BRANCH" ]; then
  echo "❌ Error: Not in a git repository"
  exit 1
fi

# Check 2: Prevent rollback of main/master/develop
PROTECTED_BRANCHES=("main" "master" "develop" "production")

for protected in "${PROTECTED_BRANCHES[@]}"; do
  if [ "$CURRENT_BRANCH" = "$protected" ]; then
    echo "❌ Error: Cannot rollback protected branch '$CURRENT_BRANCH'"
    echo ""
    echo "💡 Rollback is designed for feature branches only."
    echo "   If you need to revert changes on $CURRENT_BRANCH, use:"
    echo "   git revert <commit-hash>"
    exit 1
  fi
done

# Check 3: Check for uncommitted changes
DIRTY=$(git status --porcelain 2>/dev/null)

if [ -n "$DIRTY" ]; then
  echo "❌ Error: Uncommitted changes detected"
  echo ""
  echo "You have uncommitted changes. Please commit or stash them first:"
  git status --short
  echo ""
  echo "To commit:"
  echo "  git add ."
  echo "  git commit -m \"WIP: save before rollback\""
  echo ""
  echo "To stash:"
  echo "  git stash push -m \"Before rollback\""
  exit 1
fi

# Check 4: Detect parent branch
# First try git config
PARENT_BRANCH=$(git config "branch.$CURRENT_BRANCH.parent" 2>/dev/null)

# Fallback to common parent branches
if [ -z "$PARENT_BRANCH" ]; then
  for candidate in "develop" "development" "dev" "main" "master"; do
    if git show-ref --verify --quiet "refs/heads/$candidate"; then
      PARENT_BRANCH="$candidate"
      break
    fi
  done
fi

# Last resort: ask user
if [ -z "$PARENT_BRANCH" ]; then
  echo "⚠️  Could not auto-detect parent branch"
  PARENT_BRANCH="main"  # default
fi

echo "✅ Safety checks passed"
echo ""

Read the full file on GitHub · 578 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 · -9 tokens per session 2eb3486e174f
  2. 3mo ago First seen · 578 lines · 17 tokens per session scan C 08916b5e96b6

Subscribe to this mod's changes

rollback is a command published in the GitHub repository MartyBonacci/specswarm (67 stars, last pushed yesterday), licensed MIT. It adds 8 tokens to every session and 4,257 once invoked, about $0.0000 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

rollback compared with commands from other repositories

rollback next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
rollbackMartyBonacci/specswarmCommand67yesterdayMITC8Claude Code
merge-conflict-analysisrjmurillo/ai-agentsCommand50todayApache-2.0A0GitHub Copilot
release-notesOpenHands/extensionsCommand190todayMITA44Claude Code
commitechoVic/blade-codeCommand18115d agoMITA8Claude Code
repo-audittractorjuice/arc-kitCommand2.3ktodaynoneA29Claude Code
codex-reviewoalders/kitchen-sinkCommand52d agoMITA41Claude Code
releaseparuff/uFawkesAICommand2todayMITA39Claude Code, Codex