task-rollback

A guided rollback workflow that uses Git, a system for tracking code changes, to undo the files changed by the most recent task.

In plain words
What is it for?
It helps read task history, show the affected files and previous Git reference, ask for confirmation, revert the changes, and update the project index.
Why use it?
It provides a record-based way to review and reverse the last task instead of guessing which files to restore.

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/d3x293/code-crew/task-rollback
Any agent
npx skills add d3x293/code-crew --skill task-rollback
Clone the repo
git clone --depth 1 https://github.com/d3x293/code-crew

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 749 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00749
Opus 5 $0.00020 $0.00375
Sonnet 5 $0.00008 $0.00150
Haiku 4.5 $0.00004 $0.00075

Measured yesterday against content hash e5521217cf88, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

task-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 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.

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.

skills/task-rollback/SKILL.md · 102 lines

How it starts

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

Task Rollback - Undo Last Task

Reverts file changes made by the most recent /crew task execution using git.

When to Activate

  • User runs /crew rollback

Prerequisites

  • .claude/crew-history.json must exist with at least one entry
  • Project must be a git repository
  • The gitRefBefore field should be present in the last history entry (captured by execution-orchestrator before task execution)

If history is missing: "No task history found. Nothing to roll back." If not a git repo: "Not a git repository. Rollback requires git."

Rollback Process

Step 1: Read Last Task

Read .claude/crew-history.json and get the last entry:

  • Extract filesModified — the files that were changed
  • Extract gitRefBefore — the git commit hash before the task started
  • Extract task — the original task description
  • Extract timestamp — when the task ran

Step 2: Show Preview

Display what will be rolled back:

Rollback: "{task}" ({timestamp})
  Files: {file1}, {file2}, {file3}
  Revert to: {gitRefBefore}

Step 3: Ask for Confirmation

This is mandatory — never skip confirmation.

Ask: "Proceed with rollback? (y/n)"

If user says no: "Cancelled."

Step 4: Execute Rollback

Two strategies based on available data:

Strategy A: gitRefBefore is available (preferred)

git checkout {gitRefBefore} -- {file1} {file2} {file3}

This reverts only the specific files to their pre-task state without affecting other changes.

Strategy B: gitRefBefore is not available (fallback)

git diff HEAD -- {file1} {file2} {file3}  # Show what will change
git checkout HEAD~1 -- {file1} {file2} {file3}  # Revert to previous commit

Warning: This is less precise — only works if the task's changes are in the most recent commit.

If files have been modified since the task (additional changes on top):

  • Warn the user: "Warning: {file} has been modified since the task. Rolling back will also undo those changes."
  • Ask for confirmation again

Read the full file on GitHub · 102 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 First seen · 102 lines · 41 tokens per session scan A e5521217cf88

Subscribe to this mod's changes

task-rollback is a skill published in the GitHub repository d3x293/code-crew (13 stars, last pushed 4mo ago), licensed MIT. It adds 41 tokens to every session and 749 once invoked, about $0.0002 per session on Opus 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-30.