rollback

An emergency cleanup procedure for automatic-improvement experiments stored in separate Git worktrees and branches. Git worktrees are extra working directories linked to one repository.

In plain words
What is it for?
Use it to inspect and delete auto-improvement experiment worktrees and branches, prune stale Git references, and verify the cleanup.
Why use it?
It removes leftover experiment directories and branches after an interrupted, crashed, or cancelled experiment while keeping the main branch separate.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/benmarte/autoimprove/rollback
Any agent
npx skills add benmarte/autoimprove --skill rollback
Clone the repo
git clone --depth 1 https://github.com/benmarte/autoimprove

Made for: Claude Code, Codex.

Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 465 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
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 $0.00041 $0.00465
Opus 5 $0.00020 $0.00233
Sonnet 5 $0.00008 $0.00093
Haiku 4.5 $0.00004 $0.00047

Measured 2d ago against content hash 7b21eff7e322, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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.

Recursive force deletehighDestructive command

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

rm -rf .claude/autoimprove/worktrees
skills/rollback/SKILL.md · 67 lines

What it actually says

Rollback / Cleanup Skill

Since experiments run in isolated worktrees, there's nothing to "rollback" from the main branch — it was never touched. This skill cleans up any leftover experiment worktrees and branches from an interrupted or aborted session.

Step 1 — Show what will be removed

echo "=== Active worktrees ==="
git worktree list

echo "=== Experiment branches ==="
git branch | grep "autoimprove/experiment"

echo "=== Worktree directory ==="
ls .claude/autoimprove/worktrees/ 2>/dev/null || echo "(empty or missing)"

Show the user what will be removed and confirm before proceeding.

Step 2 — Remove all experiment worktrees

# Remove worktrees
for wt in .claude/autoimprove/worktrees/experiment-*; do
  [ -d "$wt" ] && git worktree remove "$wt" --force && echo "Removed worktree: $wt"
done

# Prune any stale worktree references
git worktree prune

Step 3 — Delete experiment branches

git branch | grep "autoimprove/experiment" | xargs -r git branch -D
echo "Experiment branches deleted"

Step 4 — Remove the container directory

rm -rf .claude/autoimprove/worktrees
echo "Cleaned up .claude/autoimprove/worktrees/"

Step 5 — Verify clean state

echo "=== Main branch status ==="
git status
git branch --show-current

echo "=== Remaining worktrees ==="
git worktree list

Report: "✅ Cleanup complete. Main branch is clean and untouched."

Safety notes

  • This skill never touches the main branch
  • Already-merged winning experiments stay in the main branch history — only pending/discarded experiments are removed
  • If a worktree can't be removed cleanly, use --force (already included above)
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. 2d ago First seen · 67 lines · 41 tokens per session scan C 7b21eff7e322

Subscribe to this mod's changes

rollback is a skill published in the GitHub repository benmarte/autoimprove (5 stars, last pushed 5mo ago), licensed MIT. It adds 41 tokens to every session and 465 once invoked, about $0.0002 per session on Opus 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-31.

Related

Other skills, from other repositories

srt-whiteboard-animation

将 SRT 字幕做成暖米黄纸张底的白板手绘动画:读字幕→输出配图策略→确认后生成统一风格线稿→按叙事语义标注分区→预览台调整→渲染 MP4。编排沿用分区遮罩揭示(annotation.json / sequence / startMs / protectedRegions),但每个区域内的落墨换成 stream 的连续笔迹(骨架/网格 ink→color)。当用户提供 SRT 字幕并要求"字幕做成白板手绘/流式笔迹视频""SRT 生成白板动画""按字幕分镜画手绘"时触发。.

geeklee/srt-whiteboard-animation · 156 tokens

user-research-cookiy

End-to-end user research assistant — qualitative and quantitative. Use this skill whenever the user mentions user research, user interviews, discussion guides, interview guides, research plans, qualitative research, quantitative research, user surveys, survey design, usability studies, participant recruitment…

cookiy-ai/user-research-skill · 154 tokens

seo

Deterministic LLM-first SEO audits for websites, blog posts, and GitHub repositories. Use this when the user asks to "perform SEO analysis", "run SEO audit", "analyze SEO", "check technical SEO", "review schema", "Core Web Vitals", "E-E-A-T", "hreflang", "GEO", "AEO", or GitHub repository SEO optimization. For…

Bhanunamikaze/Agentic-SEO-Skill · 105 tokens

playwright-best-practices

Use when writing Playwright tests, fixing flaky tests, debugging failures, implementing Page Object Model, configuring CI/CD, optimizing performance, mocking APIs, handling authentication or OAuth, testing accessibility (axe-core), file uploads/downloads, date/time mocking, WebSockets, geolocation, permissions…

currents-dev/playwright-best-practices-skill · 214 tokens

tw-formal-writing

台灣正式文件撰寫助手 — 涵蓋政府公文、政府非公文文件、法律文件、人民對政府文書四類中文正式文件的撰寫(不含學術論文、商業文書、私人書信等,見下方排除清單)。 根據使用者意圖自動判斷文件類別,載入對應的撰寫規範與格式指引。 觸發此 skill 的情境: - 政府公文:簽、函、書函、公告、令、呈、咨、箋函、便簽、行文、發文、簽辦、擬稿、陳核、簽稿併陳、以稿代簽、先簽後稿、上行文、下行文、平行文 - 政府非公文文件:會議紀錄、開會通知單、新聞稿、聲明稿、施政報告、出國報告、施政計畫書、業務計畫書、裁處書、訴願決定書、聘函、獎狀、證書 …

Imbad0202/tw-formal-writing · 485 tokens

open-map-stack

Use textual agent instructions for GIS and geospatial work: source discovery and provenance, vector/raster/point-cloud pipelines, CRS and metric analysis, spatial SQL, routing and isochrones, QGIS projects, tile generation, and web maps. Use advanced tools and formats such as OSM, Overture, STAC, Sentinel/Landsat…

jaakla/openmapstack · 169 tokens