Problem
camp fresh is useful for starting a fresh branch, but stacked PR cleanup currently takes several manual steps after child PRs are merged into an aggregate branch.
Example from CW0003: PRs 303, 304, and 305 were merged into the PR 302 branch. After that, agents still had to manually identify and remove the stale child worktrees while keeping the PR 302 aggregate worktree.
Proposal
Add a camp fresh mode for switching to an existing target branch and cleaning up related stacked-PR branches/worktrees.
Possible UX:
camp fresh feat/workflow-surface-CW0003 --cleanup-stack
camp fresh --branch feat/workflow-surface-CW0003 --cleanup-stack
Expected behavior:
- Switch or prepare the selected branch/worktree as the active working target.
- Discover related project worktrees/branches for the stack.
- Remove stale child worktrees once their branches have been merged into the selected branch.
- Optionally prune local child branches that are merged and no longer checked out.
- Refuse cleanup for dirty, unpushed, or unmerged worktrees unless an explicit force flag is provided.
- Provide a dry-run/plan output before destructive cleanup.
Acceptance criteria
camp fresh can target an existing branch without implying a new branch should be created.
- A stack cleanup option can safely remove merged child worktrees while preserving the selected target branch/worktree.
- Dirty or unmerged worktrees are reported and skipped by default.
- The command output clearly lists what will be kept, removed, and skipped.
Problem
camp freshis useful for starting a fresh branch, but stacked PR cleanup currently takes several manual steps after child PRs are merged into an aggregate branch.Example from CW0003: PRs 303, 304, and 305 were merged into the PR 302 branch. After that, agents still had to manually identify and remove the stale child worktrees while keeping the PR 302 aggregate worktree.
Proposal
Add a
camp freshmode for switching to an existing target branch and cleaning up related stacked-PR branches/worktrees.Possible UX:
Expected behavior:
Acceptance criteria
camp freshcan target an existing branch without implying a new branch should be created.