git-worktree-manager

git-worktree-manager is an agent for Claude Code, OpenCode from d-o-hub/github-template-ai-agents. It costs 43 tokens per session (1,610 once invoked), scanned A, original, MIT.

An agent for managing Git worktrees, which let one repository have multiple working directories for separate branches.

In plain words
What is it for?
Use it to create, list, organize, monitor, switch between, and clean up Git worktrees.
Why use it?
It keeps parallel feature work organized and helps avoid disturbing the main working directory.

Agent for Claude CodeOpenCode

Written for OpenCode and Claude Code: installed under .opencode/, but also a Claude Code subagent (agents/*.md). Also seen: mentions subagents; positional $N argument.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is git worktree add ../worktrees/feature-branch-name feature-branch-name.

Good fit Use it to create, list, organize, monitor, switch between, and clean up Git worktrees.

Compare 6 agents from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/d-o-hub/github-template-ai-agents
agentmods
npx agentmods add agents/d-o-hub/github-template-ai-agents/git-worktree-manager

Made for: Claude Code, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for git-worktree-manager

README.md
[![agentmods](https://agentmods.dev/badge/agents/d-o-hub/github-template-ai-agents/git-worktree-manager/github.svg)](https://agentmods.dev/agents/d-o-hub/github-template-ai-agents/git-worktree-manager)
Your own site
<a href="https://agentmods.dev/agents/d-o-hub/github-template-ai-agents/git-worktree-manager"><img src="https://agentmods.dev/badge/agents/d-o-hub/github-template-ai-agents/git-worktree-manager/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for git-worktree-manager

Your own site · 80×15
<a href="https://agentmods.dev/agents/d-o-hub/github-template-ai-agents/git-worktree-manager"><img src="https://agentmods.dev/badge/agents/d-o-hub/github-template-ai-agents/git-worktree-manager.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,610 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00043 $0.01610
Opus 5.5 $0.00017 $0.00644
Sonnet 5.5 $0.00009 $0.00322
Haiku 4.5 $0.00004 $0.00161

Measured 1mo ago against content hash 0f33bde25ce3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

git-worktree-manager scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.opencode/agents/git-worktree-manager.md · 288 lines

How it starts

The opening of the file, as written. The whole thing — 288 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Git Worktree Manager

You are a specialized agent for managing git worktrees in development workflows.

Role

Manage git worktrees to enable efficient multi-branch development, keeping the main working directory clean while allowing parallel work on multiple features.

Capabilities

Worktree Creation

  • Create worktrees for feature branches with proper naming conventions
  • Set up worktrees in organized directory structures
  • Initialize worktrees from existing or new branches

Worktree Management

  • List all active worktrees and their status
  • Switch between worktrees efficiently
  • Monitor worktree usage and health

Cleanup Operations

  • Identify and remove unused worktrees
  • Clean up orphaned worktree directories
  • Prune worktrees that no longer have corresponding branches

Workflow Integration

  • Integrate worktrees with git flow and branching strategies
  • Support CI/CD workflows with worktree-based testing
  • Enable parallel development on multiple features

Process

Creating a Worktree

  1. Assess Current State

    git worktree list
    git branch -a
    
  2. Choose Location and Name

    • Use ../worktrees/ directory for organization
    • Name worktrees after branch names (e.g., feature/new-ui)
    • Create parent directories if needed
  3. Create Worktree

    # For existing branch
    git worktree add ../worktrees/feature-branch-name feature-branch-name
    
    # For new branch from current HEAD
    git worktree add -b new-feature ../worktrees/new-feature
    
  4. Verify Setup

    cd ../worktrees/feature-branch-name
    git status
    git log --oneline -5
    

Managing Multiple Worktrees

  1. List and Monitor

    git worktree list --porcelain
    
  2. Navigate Between Worktrees

    # Quick navigation
    cd $(git worktree list | grep feature-name | awk '{print $1}')
    
  3. Check Worktree Status

    # Check all worktrees
    for wt in $(git worktree list --porcelain | grep worktree | sed 's/worktree //'); do
      echo "=== $wt ==="
      cd "$wt" && git status --short && git log --oneline -1
    done
    

Read the full file on GitHub · 288 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 288 lines · 43 tokens per session scan A 0f33bde25ce3

Subscribe to this mod's changes

git-worktree-manager is an agent published in the GitHub repository d-o-hub/github-template-ai-agents (2 stars, last pushed yesterday), licensed MIT. It adds 43 tokens to every session and 1,610 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other agents, from other repositories

platform-engineer

Platform and forge specialist — CI/CD, GitHub/GitLab PR lifecycle, merge-conflicts, worktrees, integrations (Slack/Linear/ClickUp/MCP), loops/swarm, triage, llm-cost-advisor, cli-for-agents, herdr. Use when: CI failure, PR/MR lifecycle, worktrees, MCP setup, incidents, integrations, swarm/loops, CLI ergonomics.

ulises-jeremias/agent-toolkit · 88 tokens

state-keeper

Use this agent to run sync reconciliation between fakoli-state's three sources of truth — the SQLite canonical state (.fakoli-state/state.db), the filesystem (packets/, .evidence-buffer/, worktrees), and git (branches, commits, claims). It surfaces drift as structured discrepancy reports — orphan branches (claimed…

fakoli/fakoli-plugins · 465 tokens

release-manager

Release preparation and deployment specialist handling versioning, changelogs, deployments, and rollbacks. MUST BE USED for all production releases. Use PROACTIVELY to prepare releases and ensure smooth deployments.

qdhenry/Claude-Command-Suite · 43 tokens

nah-diff-summarizer

NAH diff summarizer. Read-only terse summary of the current VCS diff and risk hotspots; dispatched by the NAH skill.

almoretti/martech-ai-skills-and-tools · 34 tokens

git-committer

Commits and pushes for this project. Use it for EVERY commit and push instead of running git commit/push in the main session. Give it an explicit file list, the target repo, and the commit message. It enforces this project's git rules (no blanket staging, no trailers, protected files, push order) and reports the…

Mexregkan/claude-for-researchers · 82 tokens

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens