/cleanup
Finish an already-merged branch — classify the leftover artifacts, return to a fast-forwarded default checkout, and delete the merged local branch. Every discard confirmed per item; containment proven, never assumed.
$ npx -y skills add arbiterForge/codeArbiter --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/cleanup
Context preview
What this command does when you run it.
Finish an already-merged branch — classify the leftover artifacts, return to a fast-forwarded default checkout, and delete the merged local branch. Every discard confirmed per item; containment proven, never assumed.
Command definition
cleanup.mddescription: Finish an already-merged branch — classify the leftover artifacts, return to a fast-forwarded default checkout, and delete the merged local branch. Every discard confirmed per item; containment proven, never assumed.
argument-hint: (none)
{{CMD:cleanup}} — post-merge branch transition
Your PR merged. You are still standing on the branch, with build output, worktree residue, and scratch files around you. This command owns the ordinary walk back: prove the branch actually landed, decide what the leftovers are, get to a clean fast-forwarded default checkout, and drop the merged local branch.
It exists because nothing else owned it. `{{CMD:standup}}` is daily hygiene and deliberately never touches the current branch or the default one; `{{CMD:chore}}` takes docs, dependency bumps, and reverts. Issue #308 recorded what the gap produced: a routine cleanup routed to `{{CMD:chore}}`, which refused it, and then to `{{CMD:override}}` — a bypass invented to cover missing coverage. This is that coverage.
Routes to
The `post-merge-cleanup` skill (`{{PLUGIN_ROOT}}/skills/post-merge-cleanup/SKILL.md`), which owns the containment proof, the artifact classification, and the per-item confirmations.
When NOT to use
- The branch has NOT merged yet → `{{CMD:pr}}` (`finishing-a-development-branch`)
owns the terminal decision; come back here after it lands.
- Daily start-of-day hygiene across *other* branches and worktrees →
`{{CMD:standup}}`.
- A read-only look at what is dirty → `{{CMD:status}}`.
- Uncommitted work you want to keep → `{{CMD:commit}}`. This command never
commits for you.
Hard gate
- MUST prove the current branch is contained in the **fetched** default branch —
SHA-ancestry, or a squash-merge proven by the merged PR record (`headRefOid` == HEAD) — before anything is deleted. An unproven or unfetched comparison STOPs — a branch that only *looks* merged is not merged.
- MUST classify every dirty or untracked artifact as **unique**, **redundant**,
or **superseded**, and MUST NOT discard a unique or unclassifiable one without explicit per-item confirmation naming it.
- MUST confirm each removal individually — no batched yes, no implied yes.
- MUST reach the default branch with a clean working tree, and MUST fast-forward
with `--ff-only` only — never a merge commit, never a rebase, never a reset that discards work.
- MUST use `git branch -d`, and MAY use `-D` only when the squash-merge PR-record
proof held this run and `-d` refused, with that proof restated and the branch named in the confirmation. MUST NOT otherwise force-delete a branch, force-push, delete a remote branch, or write to the default branch.
- MUST NOT require `{{CMD:override}}`. This is ordinary lifecycle work; if it
cannot proceed, the reason is a stated gate, not a bypass.
Read more
description: Finish an already-merged branch — classify the leftover artifacts, return to a fast-forwarded default checkout, and delete the merged local branch. Every discard confirmed per item; containment proven, never assumed. argument-hint: (none)
{{CMD:cleanup}} — post-merge branch transition
Your PR merged. You are still standing on the branch, with build output, worktree residue, and scratch files around you. This command owns the ordinary walk back: prove the branch actually landed, decide what the leftovers are, get to a clean fast-forwarded default checkout, and drop the merged local branch.
It exists because nothing else owned it. `{{CMD:standup}}` is daily hygiene and deliberately never touches the current branch or the default one; `{{CMD:chore}}` takes docs, dependency bumps, and reverts. Issue #308 recorded what the gap produced: a routine cleanup routed to `{{CMD:chore}}`, which refused it, and then to `{{CMD:override}}` — a bypass invented to cover missing coverage. This is that coverage.
Routes to
The `post-merge-cleanup` skill (`{{PLUGIN_ROOT}}/skills/post-merge-cleanup/SKILL.md`), which owns the containment proof, the artifact classification, and the per-item confirmations.
When NOT to use
- The branch has NOT merged yet → `{{CMD:pr}}` (`finishing-a-development-branch`)
owns the terminal decision; come back here after it lands.
- Daily start-of-day hygiene across *other* branches and worktrees →
`{{CMD:standup}}`.
- A read-only look at what is dirty → `{{CMD:status}}`.
- Uncommitted work you want to keep → `{{CMD:commit}}`. This command never
commits for you.
Hard gate
- MUST prove the current branch is contained in the **fetched** default branch —
SHA-ancestry, or a squash-merge proven by the merged PR record (`headRefOid` == HEAD) — before anything is deleted. An unproven or unfetched comparison STOPs — a branch that only *looks* merged is not merged.
- MUST classify every dirty or untracked artifact as **unique**, **redundant**,
or **superseded**, and MUST NOT discard a unique or unclassifiable one without explicit per-item confirmation naming it.
- MUST confirm each removal individually — no batched yes, no implied yes.
- MUST reach the default branch with a clean working tree, and MUST fast-forward
with `--ff-only` only — never a merge commit, never a rebase, never a reset that discards work.
- MUST use `git branch -d`, and MAY use `-D` only when the squash-merge PR-record
proof held this run and `-d` refused, with that proof restated and the branch named in the confirmation. MUST NOT otherwise force-delete a branch, force-push, delete a remote branch, or write to the default branch.
- MUST NOT require `{{CMD:override}}`. This is ordinary lifecycle work; if it
cannot proceed, the reason is a stated gate, not a bypass.
When you can't trust yourself with your code base, trust Arbiter.
Repo: arbiterForge/codeArbiter
Other commands on codearbiter.
- /add-dep
Vet a new or changed third-party dependency for license, provenance, and supply-chain risk before any install runs.
Open command - /adr-status
Report the health of Architecture Decision Records — aged, unchallenged, supersession candidates, unresolved CONFIRM-NN. Read-only.
Open command - /adr
Author a numbered, dated, user-attributed Architecture Decision Record under .codearbiter/decisions/.
Open command - /arbiter
Exit maintainer dev mode — restore orchestration, remove the dev marker, log the exit.
Open command - /audit
Assemble the governance record for a range — commits, overrides, ADRs, sprint auto-decisions, open questions, checkpoint findings — into one dated audit packet. Read-only.
Open command - /btw
Lightweight Q&A about the project — answer from context and return, no routing, no state change.
Open command

