worktrunk

Automate Git worktree orchestration for parallel AI agents with lifecycle hooks.

3|Updated Dec 22, 2025
One-click install
npx skills add https://github.com/JoaquinCampo/Skills --skill worktrunk-joaquincampo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: worktrunk
Source: https://github.com/JoaquinCampo/Skills/tree/main/worktrunk
Command: npx skills add https://github.com/JoaquinCampo/Skills --skill worktrunk-joaquincampo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Worktrunk addresses the complexity of running multiple AI agents in parallel without colliding changes. It provides a unified CLI to manage Git worktrees as isolated environments for each agent, enabling scalable experimentation and lifecycle management.

Core Features & Use Cases

  • Isolated workspaces per agent: Each agent runs in its own worktree to avoid cross-editing.
  • Lifecycle hooks: pre-start, post-start, pre-merge, pre-remove, and more trigger automation around worktree lifecycles.
  • Deterministic port mapping: Use hash_port and templates to allocate stable ports per worktree.
  • Template-driven automation: Variables, filters, and functions enable dynamic, repeatable workflows.
  • Security and approvals: Hook approvals and guardrails for project hooks.

Quick Start

Install Worktrunk, set up shell integration, and create a new worktree for an agent with wt switch --create feature-branch and run it.

Frequently Asked Questions about worktrunk

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

FAQPage Schema
How do I run multiple AI agents in parallel without git conflicts?

To run multiple AI agents in parallel without conflicts, use Git worktrees as isolated workspaces for each agent. Worktrunk orchestrates worktree creation and lifecycle management, ensuring agents like Claude Code or Codex never cross-edit files.

Can I automate lifecycle hooks for git worktrees?

Yes, you can automate git worktree lifecycle hooks. Worktrunk supports pre-start, post-start, pre-merge, and pre-remove hooks, allowing you to trigger custom automation and enforce safety checks around each worktree's execution flow.

How do I allocate stable ports for parallel AI agent worktrees?

You allocate stable ports for parallel AI agent worktrees using deterministic port mapping. Worktrunk uses hash_port and template-driven variables to assign and manage consistent port allocation per worktree environment.

Does Worktrunk require shell integration to manage AI agent worktrees?

Yes, Worktrunk requires shell integration to manage AI agent worktrees safely. Setting up shell integration enables the CLI to properly handle hook approvals, execute template-driven variables, and apply necessary guardrails for project hooks.

What is the best way to isolate AI coding agents like Claude Code in a single repository?

The best way to isolate AI coding agents like Claude Code in a single repository is using Git worktrees. Worktrunk provides a unified CLI to create isolated workspaces, managing lifecycles and port allocation for scalable experimentation.

Are there safety checks for project hooks when automating git worktrees?

Yes, there are safety checks for project hooks when automating git worktrees. Worktrunk implements hook approvals and guardrails, ensuring secure execution of template-driven variables and preventing unauthorized shell integration actions.