claudex-finish
Post-merge cleanup for a completed feature
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Post-merge cleanup for a completed feature
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Create and orchestrate a Claude Code agent team for feature implementation
Run an agent team to implement a planned feature
Naming conventions for features, branches, docs, and commits
Brainstorm a feature, produce design + e2e test plan, and create a draft PR
Generate blackbox e2e smoke test plans for features
| name | claudex-finish |
| description | Post-merge cleanup for a completed feature |
Clean up after a feature has been merged: remove worktree, delete branches, kill tmux, and report summary.
Read config.json from the feature docs directory:
FULL_NAME=$(basename "$(git rev-parse --show-toplevel)")
CONFIG="docs/features/${FULL_NAME}/config.json"
if [[ ! -f "$CONFIG" ]]; then
echo "No config.json found. Run 'claudex new <name>' first." >&2
exit 1
fi
If not found, ask the user for the feature's full name (e.g. 0003-my-feature) and look for docs/features/<fullName>/config.json.
gh pr view "<prUrl>" --json state -q '.state'
If state is not MERGED, warn the user and ask if they want to proceed anyway.
If config.tmux is not null:
tmux kill-window -t "<tmux.window>" 2>/dev/null || true
# From the main repo (NOT from inside the worktree)
cd "$(git rev-parse --show-toplevel 2>/dev/null || git config worktree.base)/.."
git worktree remove "<worktreePath>" --force
# Delete local branch
git branch -D "<gitBranch>" 2>/dev/null || true
# Delete remote branch (GitHub auto-deletes on merge, but be safe)
git push origin --delete "<gitBranch>" 2>/dev/null || true
Feature <fullName> cleaned up!
PR: <prUrl> (MERGED)
Worktree: removed
Branch: <gitBranch> deleted
Tmux: <killed / n/a>
Docs preserved at: docs/features/<fullName>/
Note: Feature docs (design.md, testing-plan.md, etc.) are kept in the repo as traceability artifacts — they were committed to main via the merged PR.