MCPInstall

sc-worktree

Git worktree management for multi-agent parallel development. Use when spawning multiple agents to work on isolated features simultaneously.

Installs
91
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/tony363/superclaude --skill sc-worktree
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads sc-worktree automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Worktree Management Skill

Git worktree isolation for parallel agent development with simple, safe workflows.

Quick Start

# Create isolated worktree for a task
/sc:worktree create feature-auth

# List all active worktrees
/sc:worktree list

# Propose changes for human review
/sc:worktree propose feature-auth

# Clean up stale worktrees
/sc:worktree cleanup

Behavioral Flow

  1. Create - Initialize isolated worktree with unique naming
  2. Validate - Preflight checks (clean repo, no conflicts)
  3. Assign - Spawn subagent with CWD set to worktree
  4. Work - Agent operates in isolation, commits to branch
  5. Propose - Push branch and create PR for human review
  6. Cleanup - Remove merged/stale worktrees

Commands

CommandPurposeGit Operations
create <task-id>Create isolated worktreegit worktree add -b wt/<task>
listShow all active worktreesgit worktree list
status <task-id>Check worktree stategit status, git log
cleanup [--all]Remove stale worktreesgit worktree remove, prune
propose <task-id>Create PR for human reviewgit push, gh pr create

Flags

FlagTypeDefaultDescription
--commitsbooltrueAgent commits directly to branch
--patchesboolfalseAgent produces patch files only
--run-testsboolfalseRun tests before proposing
--forceboolfalseOverride existing worktree/branch
--basestringmainBase branch for worktree

Evidence Requirements

This skill does NOT require hard evidence. Worktree operations are self-documenting through:

  • Git worktree list output
  • Branch history
  • PR creation confirmation

Naming Convention

Worktrees use deterministic naming to prevent collisions:

Path:   .worktrees/<task-id>/
Branch: wt/<task-id>

Example:

Path:   .worktrees/feature-auth/
Branch: wt/feature-auth

Operations

Create Worktree

/sc:worktree create feature-auth

# Executes:
# 1. mkdir -p .worktrees
# 2. git worktree add -b wt/feature-auth .worktrees/feature-auth
# 3. Returns worktree path for subagent CWD

List Worktrees

/sc:worktree list

# Shows:
# - Active worktrees
# - Associated branches
# - Last commit info

Check Status

/sc:worktree status feature-auth

# Shows:
# - Uncommitted changes
# - Commits ahead of base branch
# - Conflict warnings

Propose Changes

/sc:worktree propose feature-auth

# Executes:
# 1. git push -u origin wt/feature-auth
# 2. gh pr create --title "feat: feature-auth" --body "..."
# 3. Returns PR URL for human review

Cleanup Worktrees

/sc:worktree cleanup          # Remove merged worktrees
/sc:worktree cleanup --all    # Remove ALL worktrees
/sc:worktree cleanup feature-auth  # Remove specific worktree

# Executes:
# 1. git worktree remove .worktrees/<task-id>
# 2. git branch -d wt/<task-id>
# 3. git worktree prune

Subagent Integration

When spawning a subagent to work in a worktree:

# 1. Create worktree
/sc:worktree create feature-auth

# 2. Spawn subagent with CWD
Task(
    prompt="Implement JWT authentication",
    subagent_type="general-purpose",
    # CWD implicitly set to .worktrees/feature-auth/
)

# 3. Agent works in isolation
# - All file operations scoped to worktree
# - Commits go to wt/feature-auth branch

# 4. Propose for review
/sc:worktree propose feature-auth

Preflight Checks

Before creating a worktree, the skill validates:

  1. Repository State

    • Repo is clean OR --force flag provided
    • Main branch is up to date
  2. Branch Availability

    • wt/<task-id> branch doesn't exist OR explicit reuse
    • No conflicting remote branch
  3. Path Availability

    • .worktrees/<task-id> doesn't exist OR --force flag

Conflict Detection

Before proposing, the skill checks for conflicts:

# Fetch latest changes
git fetch origin main

# Check if worktree is behind
git merge-base --is-ancestor origin/main HEAD

# Warn but don't block if behind
# Human reviewer handles merge strategy

Examples

Single Agent Workflow

# Create worktree
/sc:worktree create add-logging

# Work in worktree (agent operates here)
# ... agent makes changes, commits ...

# Propose changes
/sc:worktree propose add-logging

# Human reviews PR, merges

# Cleanup
/sc:worktree cleanup add-logging

Parallel Multi-Agent Workflow

# Orchestrator creates multiple worktrees
/sc:worktree create feature-auth
/sc:worktree create feature-logging
/sc:worktree create feature-metrics

# Spawn agents in parallel (each with own worktree)
# Agent A -> .worktrees/feature-auth/
# Agent B -> .worktrees/feature-logging/
# Agent C -> .worktrees/feature-metrics/

# Propose all changes
/sc:worktree propose feature-auth
/sc:worktree propose feature-logging
/sc:worktree propose feature-metrics

# Human reviews 3 PRs, merges sequentially

# Cleanup all
/sc:worktree cleanup --all

Patch Mode (No Direct Commits)

/sc:worktree create refactor-api --patches

# Agent produces .patch files instead of commits
# Orchestrator reviews patches before applying

/sc:worktree propose refactor-api  # Creates PR from patches

MCP Integration

PAL MCP (Validation & Review)

ToolWhen to UsePurpose
mcp__pal__precommitBefore proposeValidate changes in worktree
mcp__pal__codereviewBefore proposeReview worktree changes
mcp__pal__consensusConflict resolutionMulti-model merge strategy

PAL Usage Patterns

# Validate worktree changes before proposing
mcp__pal__precommit(
    path=".worktrees/feature-auth",
    step="Validating worktree changes",
    findings="Security, test coverage, completeness",
    compare_to="main"
)

# Review worktree branch
mcp__pal__codereview(
    review_type="full",
    step="Reviewing feature-auth worktree",
    relevant_files=[".worktrees/feature-auth/src/auth.py"]
)

Rube MCP (Automation & Notifications)

ToolWhen to UsePurpose
mcp__rube__RUBE_SEARCH_TOOLSGitHub integrationFind PR tools
mcp__rube__RUBE_MULTI_EXECUTE_TOOLPropose commandCreate PR, notify team

Rube Usage Patterns

# Create PR and notify team
mcp__rube__RUBE_MULTI_EXECUTE_TOOL(tools=[
    {"tool_slug": "GITHUB_CREATE_PULL_REQUEST", "arguments": {
        "repo": "myapp",
        "title": "feat: feature-auth from worktree",
        "body": "## Worktree: feature-auth\nCreated via /sc:worktree",
        "base": "main",
        "head": "wt/feature-auth"
    }},
    {"tool_slug": "SLACK_SEND_MESSAGE", "arguments": {
        "channel": "#pull-requests",
        "text": "New PR from worktree: wt/feature-auth"
    }}
])

Flags (Extended)

FlagTypeDefaultDescription
--pal-reviewboolfalseUse PAL codereview before propose
--create-prbooltrueCreate GitHub PR via Rube
--notifystring-Notify via Rube (slack, teams)
--draftboolfalseCreate draft PR

Tool Coordination

  • Bash - Git worktree commands, directory operations
  • Read - Check worktree status and logs
  • Task - Spawn subagents with worktree CWD
  • PAL MCP - Pre-propose validation, code review
  • Rube MCP - PR creation, team notifications

Safety Guarantees

  1. Isolation - Each worktree has separate working directory
  2. No Auto-Merge - Human review required for all merges
  3. Unique Naming - Deterministic paths prevent collisions
  4. Crash-Safe - cleanup --all removes stale worktrees
  5. Warning-Only Conflicts - Conflicts warn but don't block

Limitations

  • No automatic quality scoring (use CI/tests)
  • No lease tracking (periodic cleanup instead)
  • No sophisticated conflict resolution (human review)
  • No auto-merge to main (PR-based workflow)

FAQ

What does the sc-worktree skill do?

Git worktree management for multi-agent parallel development. Use when spawning multiple agents to work on isolated features simultaneously.

How do I install sc-worktree?

Run npx skills add https://github.com/tony363/superclaude --skill sc-worktree in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/sc-worktree/ (personal) or .claude/skills/sc-worktree/ (project).

Which AI agents can use sc-worktree?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is sc-worktree safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains sc-worktree?

It is published by tony363 in tony363/superclaude. It has 91 recorded installs.

More from tony363/superclaude

View all →

agent-performance-engineer

tony363/superclaude

Expert performance engineer specializing in system optimization, bottleneck identification, and scalability engineering. Masters performance testing, profiling, and tuning across applications, databases, and infrastructure with focus on achieving optimal response times and resource efficiency.

agent-security-engineer

tony363/superclaude

Expert infrastructure security engineer specializing in DevSecOps, cloud security, and compliance frameworks. Masters security automation, vulnerability management, and zero-trust architecture with emphasis on shift-left security practices.

Security392 installs

sc-estimate

tony363/superclaude

Provide development estimates for tasks, features, or projects with intelligent analysis. Use when planning timelines, assessing complexity, or scoping resources.

agent-fullstack-developer

tony363/superclaude

End-to-end feature owner with expertise across the entire stack. Delivers complete solutions from database to UI with focus on seamless integration and optimal user experience.

Frontend & Design154 installs

sc-design

tony363/superclaude

Design system architecture, APIs, and component interfaces with comprehensive specifications. Use when planning architecture, designing APIs, creating component interfaces, or modeling databases.

Frontend & Design113 installs

agent-technical-writer

tony363/superclaude

Open the skill to read its SKILL.md instructions.

Docs & Writing108 installs

Popular ai & agents skills

View category →

google-agents-cli-publish

google/agents-cli

This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).

AI & Agents513.9K installs

google-agents-cli-eval

google/agents-cli

This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).

AI & Agents513.5K installs

skill-creator

anthropics/skills

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

OfficialAI & Agents416.4K installs

codex-pet

prime-skills/runcomfy-agent-skills

Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.

AI & Agents402.1K installs

full-output-enforcement

leonxlnx/taste-skill

Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.

AI & Agents401K installs

executing-plans

obra/superpowers

Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available

AI & Agents245.7K installs