From forge
Cleanly abort a forge session: remove worktrees, clean up branches, mark in-progress tasks as aborted, and generate a status report.
npx claudepluginhub ekelhaft-tools/forge-cursorThis skill uses the workspace's default tool permissions.
Emergency cleanup for a forge session that needs to stop. Handles all the cleanup that would normally happen at the end of a successful execution, plus marks interrupted tasks appropriately.
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Emergency cleanup for a forge session that needs to stop. Handles all the cleanup that would normally happen at the end of a successful execution, plus marks interrupted tasks appropriately.
$ARGUMENTS: If the first token is a number or short identifier, use it as the session ID.ls .forge/sessions/ 2>/dev/null | sort
<id>"SESSION_DIR = .forge/sessions/<id>/ — all file paths in this skill are relative to this directory.
Git namespace for this session: branches forge/s<id>/*, tags forge/checkpoint/s<id>/*.
Gather current state:
$SESSION_DIR/plan.md — find tasks with status in-progressgit worktree listgit branch --list "forge/s<id>/*"git tag -l "forge/checkpoint/s<id>/*"$SESSION_DIR/worktrees/ directory for leftover directories$SESSION_DIR/contracts/ directory for leftover contract filesFor each forge worktree found under $SESSION_DIR/worktrees/:
# Force remove the worktree
git worktree remove "$SESSION_DIR/worktrees/batch-N" --force
# If that fails (locked), manual cleanup
rm -rf "$SESSION_DIR/worktrees/batch-N"
git worktree prune
For each forge branch found matching forge/s<id>/*:
# Delete the branch (force, since it may not be fully merged)
git branch -D "forge/s<id>/batch-N-timestamp"
rm -rf "$SESSION_DIR/contracts/"
In $SESSION_DIR/plan.md:
in-progress tasks to aborteddone tasks as donepending tasks as pendingfailed tasks as failed# Make sure we're on the main branch
git checkout main 2>/dev/null || git checkout master
# Prune stale worktree references
git worktree prune
Check .forge/config.json — if integration is active:
Linear (non-blocking): Load linear-sync → Operation D (Cancel In-Progress Issues). Marks all in-progress issues as Cancelled and adds an abort comment.
Notion (non-blocking): Load notion-sync → Operation E (Update Page on Abort). Adds abort timestamp to the Notion plan page and refreshes task statuses.
## Forge Abort Report (session <id>)
### Cleanup Summary
- Worktrees removed: N
- Branches deleted: N
- Tasks aborted: N (were in-progress)
- Contract files removed: N
### Task Status After Abort
| Status | Count |
|---------|-------|
| Done | X |
| Aborted | Y |
| Pending | Z |
| Failed | W |
### Checkpoint Tags (preserved)
- forge/checkpoint/s<id>/batch-1-pre-merge
- forge/checkpoint/s<id>/batch-2-pre-merge
💡 Use `forge rollback <id>` to revert to a checkpoint, or `forge execute <id>` to resume from pending tasks.
done task statuses — completed work is completed work$SESSION_DIR/plan.md — the user might want to resume or re-plan