worktree

Coordinate parallel git worktrees with Bash scripting to isolate agent workspaces.

116|56|Updated Jan 18, 2026
One-click install
npx skills add https://github.com/Soul-Brews-Studio/oracle-skills-cli --skill worktree-soul-brews-studio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: worktree
Source: https://github.com/Soul-Brews-Studio/oracle-skills-cli/tree/main/src/skills/worktree
Command: npx skills add https://github.com/Soul-Brews-Studio/oracle-skills-cli --skill worktree-soul-brews-studio

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Git worktree management to enable parallel agent workflows by isolating workspaces per agent or task.

Core Features & Use Cases

  • Create separate worktrees for each agent with a dedicated branch.
  • List all active worktrees with their associated branches and states.
  • Open an agent's workspace in your editor and switch context via branches.

Quick Start

Open a terminal in your repository and run:

  • List: git worktree list
  • Create a new agent: NEXT=1; while [ -d "$PARENT_DIR/$REPO_NAME.wt-$NEXT" ]; do NEXT=$((NEXT+1)); done; WT_PATH="$PARENT_DIR/$REPO_NAME.wt-$NEXT"; git worktree add "$WT_PATH" -b agents/$NEXT
  • Show path for agent N: REPO_NAME=$(basename "$(pwd)"); PARENT_DIR=$(dirname "$(pwd)"); echo "$PARENT_DIR/$REPO_NAME.wt-N"
  • Remove agent N: WT_PATH="$PARENT_DIR/$REPO_NAME.wt-N"; git worktree remove "$WT_PATH"; git branch -d agents/N

Frequently Asked Questions about worktree

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

FAQPage Schema
What are git worktrees used for in parallel agent workflows?

Git worktrees create isolated workspaces linked to a single repository, allowing multiple agents to run concurrent tasks without interfering with the main branch. This enables parallel experiments, testing, and agent-based development workflows.

How do I create a new git worktree for an agent on a dedicated branch?

To create a git worktree, use a bash script to find an available directory path, then run `git worktree add "$WT_PATH" -b agents/$NEXT`. This sets up an isolated workspace with a dedicated branch for the agent.

Can I list all active git worktrees and their associated branches?

Yes, you can list all active git worktrees by running the `git worktree list` command in your terminal. This displays each worktree's path, its associated branch, and its current state.

Does git worktree management require any special dependencies or tools?

No, managing git worktrees for parallel agents requires no special dependencies. It relies entirely on standard Git worktree commands and Bash scripting, making it accessible for any software development team.

How do I remove an agent's git worktree and delete its branch?

To remove a git worktree, run `git worktree remove "$WT_PATH"` with the agent's specific path, then delete its branch using `git branch -d agents/N`. This cleans up the isolated workspace entirely.