workflow-finish

Delete merged PR branches, worktrees, and workflow context using shared configuration.

Updated Jan 26, 2026
One-click install
npx skills add https://github.com/dohernandez/claude-skills --skill workflow-finish
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: workflow-finish
Source: https://github.com/dohernandez/claude-skills/tree/main/plugins/workflow-finish/skills/workflow-finish
Command: npx skills add https://github.com/dohernandez/claude-skills --skill workflow-finish

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Cleaning up after a merged PR can leave stale branches, unused worktrees, and lingering workflow contexts scattered across the repository. This Skill automates and safes the cleanup process.

Core Features & Use Cases

  • Remove the local and remote branches related to a merged PR
  • Delete associated worktrees and prune references
  • Remove the workflow context directory for the branch and update status reports

Quick Start

Run /workflow-finish to safely clean up the merged PR workspace.

Frequently Asked Questions about workflow-finish

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I clean up git branches and worktrees after a PR merge?

To clean up git branches and worktrees after a PR merge, you need to delete local and remote branches, remove associated worktrees, and prune references. This ensures your repository stays free of stale branches and lingering workflow contexts.

What is the safest way to delete local and remote branches after merging?

The safest way to delete branches after merging is to verify the PR merge status before deletion and switch to the main branch if needed. Ignoring resources that have already been removed ensures the cleanup operation remains idempotent.

How do I remove a git worktree and its associated workflow context?

Removing a git worktree and its workflow context involves deleting the worktree directory, pruning references, and removing the specific workflow context directory for the branch. This updates status reports and clears lingering configurations.

Can I clean up multiple merged branches by ticket number or explicit branch name?

Yes, you can clean up merged branches by specifying the current branch, a ticket number, or an explicit branch name. This flexibility allows targeted cleanup of specific PR workspaces without affecting other active branches.

Does this branch cleanup process require shared configuration files?

Yes, the branch cleanup process uses a shared configuration from .claude/workflow-config.json. This file centralizes settings to ensure the workflow finish operation correctly identifies and removes the appropriate branches and worktrees.

What happens if I run the cleanup workflow on already deleted git branches?

Running the cleanup workflow on already deleted git branches is safe because the operation is idempotent. It automatically ignores resources that have already been removed, preventing errors during the branch and worktree deletion process.