with one click
flow-abort
// Abort the current FLOW feature. Closes the PR, deletes the remote branch, removes the worktree, and deletes the state file. Available from any phase. Use --manual for confirmation prompt.
// Abort the current FLOW feature. Closes the PR, deletes the remote branch, removes the worktree, and deletes the state file. Available from any phase. Use --manual for confirmation prompt.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | flow-abort |
| description | Abort the current FLOW feature. Closes the PR, deletes the remote branch, removes the worktree, and deletes the state file. Available from any phase. Use --manual for confirmation prompt. |
Abandon the current feature completely. This is the escape hatch ā available from any phase, no prerequisites.
/flow:flow-abort
/flow:flow-abort --auto
/flow:flow-abort --manual
/flow:flow-abort ā uses configured mode from the state file (default: auto)/flow:flow-abort --auto ā skips confirmation and proceeds directly to cleanup/flow:flow-abort --manual ā prompts for user confirmation before any destructive actionThis 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.
--auto was passed ā mode is auto--manual was passed ā mode is manual<project_root>/.flow-states/<branch>/state.json. Use skills.flow-abort value.skills key ā use built-in default: autoRun this entry check as your very first action.
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.
Resolve the mode using the Mode Resolution rules above.
At the very start, output the following banner in your response (not via Bash) inside a fenced code block:
```text
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
FLOW v1.1.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, DAG, 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 v1.1.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.