post-merge-cleanup

Clean up git worktrees and branches and update task statuses after a PR merge.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/talent-factory/claude-plugins --skill post-merge-cleanup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: post-merge-cleanup
Source: https://github.com/talent-factory/claude-plugins/tree/main/plugins/git-workflow/skills/post-merge-cleanup
Command: npx skills add https://github.com/talent-factory/claude-plugins --skill post-merge-cleanup

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates the cleanup of git assets and task statuses after a PR merge.

Core Features & Use Cases

  • Git Cleanup: Removes worktrees, local branches, and remote branches
  • Multi-Source Task Tracking: Supports filesystem STATUS.md and Linear
  • Safe Defaults: Dry-run mode, PR verification, confirmation prompts
  • Idempotent: Safe to run multiple times
  • Smart Detection: Auto-detects task source based on ID pattern

Quick Start

Invoke the CLI with /git-workflow:post-merge-cleanup <task-id> to clean up git assets and update task status.

Frequently Asked Questions about post-merge-cleanup

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

FAQPage Schema
How do I automate git cleanup after a PR merge?

You can automate git cleanup after a PR merge by running the post-merge-cleanup command with your task ID. It removes worktrees, local branches, and remote branches, and updates task statuses in STATUS.md or Linear with safety checks and dry-run previews.

How to clean up git worktrees and local branches automatically?

To clean up git worktrees and local branches automatically, use a post-merge cleanup tool that detects merged PRs and removes associated worktrees and branches. This Skill also verifies the PR merge status before deletion and supports dry-run mode to preview changes safely.

Does post-merge cleanup work with Linear issue tracking?

Yes, post-merge cleanup works with Linear issue tracking alongside filesystem-based STATUS.md. It auto-detects the task source based on the task ID pattern and updates the issue status consistently after a PR merge, keeping both tracking systems in sync.

Can I preview git branch deletion before running cleanup?

Yes, you can preview git branch deletion before running cleanup using the built-in dry-run mode. This allows you to verify which worktrees, local branches, and remote branches will be removed and what status updates will occur without making actual changes.

Is it safe to run post-merge git cleanup multiple times?

Yes, it is safe to run post-merge git cleanup multiple times because the operation is idempotent. Repeated executions will not cause errors or duplicate actions, and built-in PR verification and confirmation prompts ensure no unmerged work is accidentally deleted.

What's the best way to update task status in STATUS.md after merging a PR?

The best way to update task status in STATUS.md after merging a PR is to use an automated cleanup tool that commits and pushes status changes directly. This Skill detects the task ID, updates the STATUS.md file, and can commit and push the changes to keep your repository current.