cleanup

A command for resetting Forge interview state by removing its saved state files and, if chosen, its survey data. Forge is the system that stores these interview materials.

In plain words
What is it for?
Use it to remove only state and draft files while keeping survey data, or to remove the entire forge-specs directory.
Why use it?
It clears unfinished or stale interview data before starting again. It checks what exists and asks for confirmation before deleting anything.

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/alphabravo-oss/guild/cleanup
Clone the repo
git clone --depth 1 https://github.com/alphabravo-oss/guild
Per session 7 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 398 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.00007 $0.00398
Opus 5 $0.00003 $0.00199
Sonnet 5 $0.00001 $0.00080
Haiku 4.5 $0.00001 $0.00040

Measured 2d ago against content hash 42535a45cced, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

cleanup 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 forge-specs/
plugins/forge/commands/cleanup.md · 70 lines

What it actually says

Forge Cleanup Command

Remove all Forge interview state files to reset the plugin state.

STEP 1: CHECK FOR STATE FILES

First, check what state files exist:

ls -la forge-specs/*/state.md 2>/dev/null || echo "NO_STATE_FILES"

Also check for survey data:

ls -d forge-specs/*/survey/ 2>/dev/null || echo "NO_SURVEY_DATA"

STEP 2: HANDLE RESULTS

If NO state files exist:

Tell the user:

No Forge state files found. Nothing to clean up.

Then STOP.

If state files exist:

List the files that will be deleted, then ask the user for confirmation using AskUserQuestion:

"Found N state files and M survey directories. What should I clean up?"

  • "State files only" — Remove state.md and draft.md (keep survey data for reference)
  • "Everything" — Remove entire forge-specs/ directory
  • "Cancel" — Don't delete anything

Then execute based on their choice:

State files only:

rm -f forge-specs/*/state.md forge-specs/*/draft.md

Everything:

rm -rf forge-specs/

Then confirm to the user:

Forge cleanup complete.

To start a new interview, use:

/forge:plan "your feature name"

IMPORTANT NOTES

  • This command only deletes state and survey files
  • It does NOT delete completed specs (the .md and .json files in forge-specs/)
  • Use this when you want to abandon all in-progress interviews
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 · 70 lines · 7 tokens per session scan C 42535a45cced

Subscribe to this mod's changes

cleanup is a command published in the GitHub repository alphabravo-oss/guild (2 stars, last pushed 2d ago), licensed MIT. It adds 7 tokens to every session and 398 once invoked, about $0.0000 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.