- Home
- Skills
- Workflow Automation
- Parallel Git Worktrees: Run Multiple Agents Without Clashes
Works with the AI Agents you already use
Parallel Git Worktrees: Run Multiple Agents Without Clashes
Manage isolated parallel Git worktrees with automated port allocation, database namespacing, and runtime isolation.
$6
Parallel Git Worktrees: Run Multiple Agents Without Clashes
Example session with this skill installed
I need to work on the refactor-auth branch while keeping my current dev server running on main. Set up a second checkout for me.
- Read your context and instructions
- Compiled the parallel git worktrees
Worktree created at ../project-refactor-auth.
Port block 3010-3019 allocated (Base: 3000).
Environment overrides applied to .env.local.
Dependencies installed via pnpm.
You can now run the dev server in the new directory on port 3010.
Connects securely to your tools. The creator never sees your data.
About this skill
The problem
Running multiple checkouts of the same repository leads to port collisions, database schema corruption from competing migrations, and session clobbering. Developers and AI agents often lose hours when one workspace silently adopts the resources or runtime state of another.
What it does
- Orchestrates Git worktrees as isolated lanes with dedicated port blocks to prevent EADDRINUSE errors.
- Configures per-worktree environment overrides for databases, caches, and search indices to stop data cross-contamination.
- Manages runtime version pinning and dependency installation for each checkout to ensure version consistency.
- Provides automated scripts for lane creation, port registration, and clean teardown of worktree metadata.
- Handles session isolation for shared backends to prevent one lane from logging another out.
Frameworks & tools
Git, Bash, Node.js (Vite, Next.js, Webpack), Python, Ruby on Rails, Django, Docker Compose, and version managers like nvm or asdf.
Why this beats prompting it yourself
Manually setting up worktrees usually skips the non-obvious "shared mutable state" like HMR ports or database migrations. This skill enforces a rigorous isolation checklist and port-allocation registry that prevents hard-to-debug runtime failures that generic prompts ignore.
Use cases
- Working on a high-priority hotfix without stashing or switching away from a complex feature branch.
- Deploying a fleet of AI agents to work on independent tasks within the same repository.
- Comparing two versions of a frontend UI side-by-side on different local ports.
- Running integration tests on a feature branch while keeping a stable dev server active on main.
Known limitations
On Windows, nvm-windows cannot switch Node versions per shell, limiting concurrent lanes to a single global Node version. Requires manual pruning if worktree directories are deleted via file explorer.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Workflow Automation.
nvm-windows limits lanes to one Node version globally. Manual directory deletion requires a git worktree prune command to clear metadata.
How to use
- 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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 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
This skill has been used 13 times.
Trust & safety
Security scan
Security scan passed 2 months ago
- Software
Python