From flow
Aborts the current FLOW feature by closing the PR, deleting the remote branch, removing the worktree, and deleting the state file. Available from any phase.
How this skill is triggered — by the user, by Claude, or both
Slash command
/flow:flow-abortThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Abandon the current feature completely. This is the escape hatch — available
Abandon the current feature completely. This is the escape hatch — available from any phase, no prerequisites.
/flow:flow-abort
/flow:flow-abort — uses the configured mode from the state file's skills.flow-abort configThis flow is one of potentially many running simultaneously — on this
machine (multiple worktrees) and across machines (multiple engineers).
Your state file (.flow-states/<branch>/state.json) is yours alone. Never
read or write another branch's state. All local artifacts (logs, plan
files, temp files) are scoped by branch name. GitHub state (PRs, issues,
labels) is shared across all engineers — operations that create or modify
shared state must be idempotent.
Resolve the mode as the first action on entry, after resolving the
current branch. ## Mode Resolution is the single runnable home for
mode resolution — the same pattern flow-complete uses, so the two
terminal skills stay consistent. There are no --auto/--manual
flags — the state file's skills.flow-abort config is the single
source of truth for skill autonomy.
Resolve the current branch: run git worktree list --porcelain,
note the project root (the path on the first worktree line),
find the worktree entry whose path matches the current working
directory, and take the branch refs/heads/<name> line from that
entry (strip the refs/heads/ prefix). Call this <branch>.
Run the resolver below and use the continue field from its JSON
output as the abort-confirmation mode. It reads the
skills.flow-abort entry in the state file, tolerating every
object config shape, and falls back to manual when the config
is missing or unparseable:
${CLAUDE_PLUGIN_ROOT}/bin/flow resolve-skill-mode --skill flow-abort --branch <branch>
Run this entry check immediately after Mode Resolution.
git worktree list --porcelain. Note the path on the first
worktree line (this is the project root). Find the worktree entry
whose path matches your current working directory — the
branch refs/heads/<name> line in that entry is the current branch
(strip the refs/heads/ prefix).<project_root>/.flow-states/<branch>/state.json.
feature, branch, worktree,
pr_number, and pr_url. Print the feature name, branch, PR URL,
and current phase.branch from the porcelain output (already known)pr_number unknown — skip PR close step laterIf the Read tool fails for any other reason, stop and show the error.
Use these values for all subsequent steps — do not re-read the state file or re-run git commands to gather the same information.
At the very start, output the following banner in your response (not via Bash) inside a fenced code block:
```text
──────────────────────────────────────────────────
FLOW v2.7.0 — Abort — STARTING
──────────────────────────────────────────────────
```
Skip this step if mode is auto — proceed directly to Steps 2–7.
If mode is manual, this is destructive and irreversible. Use AskUserQuestion.
If the entry check printed warnings, include them in the confirmation:
"Abort feature ''? ⚠ This will close the PR, delete the remote branch, remove the worktree, and delete the state file and log. All uncommitted work in the worktree will be lost."
If a state file was found in the entry check, remove the "Flow In-Progress" label from any issues referenced in the prompt. Best-effort — continue to cleanup even if removal fails. Skip this step if no state file exists.
${CLAUDE_PLUGIN_ROOT}/bin/flow label-issues --state-file <project_root>/.flow-states/<branch>/state.json --remove
Run the cleanup script from the project root with abort flags:
${CLAUDE_PLUGIN_ROOT}/bin/flow cleanup <project_root> --branch <branch> --worktree <worktree_path> --pr <pr_number>
If pr_number is unknown, omit --pr. The cleanup script deletes local branches and attempts remote branch deletion when --pr is provided.
The script outputs JSON with a steps dict showing what happened to each resource: pr_close, worktree, remote_branch, local_branch, branch_dir, queue_entry. Each step reports "closed"/"removed"/"deleted", "skipped", or "failed: <reason>". The branch_dir step recursively removes every per-branch artifact under .flow-states/<branch>/ (state file, log, plan, frozen phases, CI sentinel, timings, closed-issues record, issues summary, scratch rule content, commit message, start prompt). The queue_entry step removes .flow-states/start-queue/<branch> if a start-lock entry remains.
Tell the user what was cleaned, what was already gone, and what failed.
Then output the following banner in your response (not via Bash) inside a fenced code block:
```text
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✓ FLOW v2.7.0 — Abort — COMPLETE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Feature '<feature>' has been abandoned.
Cleanup complete — see results above for details.
```
Report which steps succeeded and which were already cleaned up.
npx claudepluginhub benkruger/flow --plugin flowWipes `.flow-states/` directories on the local machine when abandoned features leave orphaned state that per-flow abort cannot reach. Destructive for local FLOW state only; PRs, worktrees, and branches are unaffected.
Removes git worktrees and associated branches after PR merges, sub-scope consolidation, or manual cleanup. Lists worktrees if unspecified, handles uncommitted changes and paused states.
Resolves merged PR workflows to completed state: verifies merge status, collects metadata, transitions phases, and cleans up worktrees/branches.