rollback

A rollback command for reversing changes made by the latest First Plan execution. It uses saved snapshots, which are copies of relevant planning files taken before changes were applied.

In plain words
What is it for?
Use it to preview or apply a rollback, or select a particular saved snapshot to restore.
Why use it?
It provides a recovery point when an experiment or automated change needs to be undone. A dry run can show what would be reverted first.

Command

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 commands/vynazevedo/first-plan/rollback
Clone the repo
git clone --depth 1 https://github.com/vynazevedo/first-plan
Per session 37 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,124 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.00037 $0.01124
Opus 5 $0.00018 $0.00562
Sonnet 5 $0.00007 $0.00225
Haiku 4.5 $0.00004 $0.00112

Measured 2d ago against content hash d41c89306935, 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 .first-plan
commands/rollback.md · 147 lines

How it starts

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

/fp:rollback

Reverte mudanças do último execute (ou snapshot específico).

Argumentos

$ARGUMENTS:

  • vazio: rollback do último execute
  • --dry-run: mostra o que seria revertido sem aplicar
  • --snapshot <id>: rollback para snapshot específico (ID do timestamp)

Workflow

Passo 1 - Pre-flight

Verificar .first-plan/cache/snapshots/ existe e tem ao menos 1 snapshot.

Passo 2 - Identificar snapshot alvo

ls -t .first-plan/cache/snapshots/ | head -5

Output exemplo:

2026-05-04T22-35-01-pre-execute-csv-export
2026-05-04T18-12-44-pre-execute-auth-jwt
2026-05-03T15-22-08-pre-execute-rate-limit

Default: snapshot mais recente. Se --snapshot <id>: usar esse.

Passo 3 - Mostrar diff

=== Rollback preview ===

Snapshot alvo: 2026-05-04T22-35-01-pre-execute-csv-export
Idade: 23 minutos

Mudanças que serão revertidas em .first-plan/:
- 09-features/csv-export.md (criado pelo execute)
- 07-state/STATE.md (phase voltará para awaiting_approval)
- 07-state/reports/csv-export.md (será removido)
- 07-state/reports/csv-export-verification.md (será removido)

Mudanças no working tree (NÃO revertidas automaticamente):
- internal/handler/export.go (modified)
- internal/service/csv_writer.go (created)
- internal/service/csv_writer_test.go (created)

Para reverter working tree manualmente:
  git checkout HEAD -- internal/handler/export.go
  rm internal/service/csv_writer.go internal/service/csv_writer_test.go

OU se já commitou:
  git revert <commit-sha>

Continuar com rollback do .first-plan/? [s/N]

Passo 4 - Aplicar (se confirmado)

# Backup do estado atual antes de rollback (snapshot do snapshot)
cp -r .first-plan .first-plan.before-rollback-$(date +%s)

# Restaurar snapshot
rm -rf .first-plan
cp -r .first-plan/cache/snapshots/<snapshot-id>/snapshot/.first-plan .first-plan

Atualizar STATE.md:

phase: awaiting_approval  # ou phase pré-execute do snapshot
last_rollback_at: <ISO>
rolled_back_to: <snapshot-id>

Read the full file on GitHub · 147 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. 2d ago First seen · 147 lines · 37 tokens per session scan C d41c89306935

Subscribe to this mod's changes

rollback is a command published in the GitHub repository vynazevedo/first-plan (23 stars, last pushed 8d ago), licensed MIT. It adds 37 tokens to every session and 1,124 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-30.