Worktree Tidy

    1

    Find finished git worktrees by checking their PR state, then remove them safely: dry run first, never --force.

    $3

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    worktree-tidy

    Example session with this skill installed

    Clean up my worktrees.

    • Read your context and instructions
    • Compiled the worktree-tidy

    Dry run for my-app: 7 would go (3 GB freed), 1 missing folder to prune, 2 kept. Kept: feature-x has 4 uncommitted files; spike-y has no PR and 2 commits on no remote, last touched 3 months ago. Say go to remove the 7 and prune the missing one.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Agents and parallel work leave piles of git worktrees behind. This skill works out which ones are finished and removes only those.

    How it decides

    A worktree is safe to remove when it has no uncommitted or untracked files and its HEAD is saved elsewhere:

    • in its PR, in any state. This works with squash merges and deleted remote branches, because it compares against the PR's own head commit.
    • or, with no PR, on a remote branch.

    Anything else is kept: uncommitted files, commits that exist nowhere else, or a detached HEAD.

    How it runs

    1. A dry run lists every worktree with its action (remove, keep or missing), PR state, uncommitted file count, extra commits, branch and path.
    2. You get a short summary: how many would go, the space freed, and keep rows that look stale.
    3. Only after you say go does it run --apply.

    It never uses --force, rm -rf or git branch -D. Local branches are left alone, so nothing committed is lost. It also cleans up Claude Code agent worktrees under .claude/worktrees/, which aren't removed automatically when the agent changed something.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Productivity.

    Removes worktrees only, never branches. Needs GitHub for PR state. A branch reused for several PRs is judged against its latest PR.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed today

    Software
    GitGitHub CLI (gh), signed inBash

    The repo's origin must be on GitHub, because PR state comes from gh. Without a PR, a worktree is only removed when its HEAD is on a remote branch.

    Permissions

    Allowed Hosts

    github.com (via gh and git fetch)

    File Scopes

    the
    repo's
    worktree
    folders
    (removed
    only
    with
    --apply
    after
    your
    go)

    Runs git fetch --prune on origin. Never force-removes and never deletes branches.

    Listedtoday

    What's inside

    Frequently Asked Questions

    Find finished git worktrees by checking their PR state, then remove them safely: dry run first, never --force.

    This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

    Connect your AI agent to Agensi through MCP, then ask it to use worktree-tidy on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

    New in Productivity