Synopsis
aigon feature-cleanup <ID> [--push]Flags
| Flag | Description |
|---|---|
--push | Push all branches to origin before deleting them locally |
Description
feature-cleanup garbage-collects the branches and worktrees that were created when a feature was started. It is a strict subset of feature-reset — it removes the runtime artifacts (worktrees, branches) but does not touch the spec file, workflow engine state, or running sessions.
The typical use case is after feature-close in Fleet mode: you’ve merged the winning implementation, and the losing agents’ worktrees and branches are no longer needed. feature-cleanup removes them cleanly.
If you want to abandon a feature entirely and start over, use feature-reset instead — it also closes sessions, clears engine state, and returns the spec to backlog.
What it does
- Finds all worktrees for the feature (e.g.
feature-42-cc-*,feature-42-gg-*) - Removes each worktree and its permissions/trust entries
- Deletes all local branches matching
feature-<ID>-* - With
--push: pushes each branch tooriginbefore deleting locally
Examples
# After closing Fleet feature 42 with the cc winner — clean up losers
aigon feature-close 42 cc
aigon feature-cleanup 42
# Preserve work on remote before cleaning up locally
aigon feature-cleanup 42 --push
# Cancel an in-progress Fleet feature
aigon feature-cleanup 42When to use which command
| Goal | Command |
|---|---|
| Post-close GC of Fleet branches | feature-cleanup <ID> ← this command |
| Abandon in-progress work and start over | feature-reset <ID> |
| Kill running agent sessions only | sessions-close <ID> |
Related
feature-reset— full reset: sessions + worktrees + branches + engine state + specfeature-close— merge the winner (run before cleanup in Fleet mode)sessions-close— kill agent processes without removing worktrees
Last updated on