- Home
- Skills
- Workflow Automation
- Git Worktree Manager
Works with the AI Agents you already use
Git Worktree Manager
Stash, switch, lose your build cache, forget what you stashed — the branch-juggling tax that worktrees were built to eliminate.
$8.99
Git Worktree Manager
Example session with this skill installed
I want to run three Claude Code agents in parallel on our pnpm monorepo (Next.js web app plus a Node API, Postgres in Docker). Right now they all share one checkout and keep overwriting each other's changes and ports.
- Read your context and instructions
- Compiled the git worktree manager
Worktree setup for three parallel agents: one checkout per agent, isolated ports and databases, fixed branch names and a cleanup routine.
Directory layout
~/code/shop/ main checkout, you only
~/code/shop-wt/agent-1/ worktree, branch agent/1-<task>
~/code/shop-wt/agent-2/
~/code/shop-wt/agent-3/
Create a worktree
git worktree add ../shop-wt/agent-1 -b agent/1-checkout-refactor origin/main
cd ../shop-wt/agent-1 && pnpm install --frozen-lockfile
Per-worktree environment
Each worktree gets its own .env.local (git-ignored):
WEB_PORT=3101 # agent-2: 3201, agent-3: 3301
API_PORT=4101
DATABASE_URL=postgres://dev:dev@localhost:5432/shop_agent1
COMPOSE_PROJECT_NAME=shop_agent1
Keep one Postgres container and give each agent its own database, created by a seed script.
Branch conventions
agent/<n>-<short-task>, always branched from freshorigin/main.- Agents commit only in their own worktree; you merge through PRs.
- Never check out the same branch in two worktrees.
Cleanup
git worktree remove ../shop-wt/agent-1
git branch -d agent/1-checkout-refactor
dropdb shop_agent1
git worktree prune
Next steps
- Add a
scripts/wt-new.shthat creates the worktree, env file and database in one step. - Add
shop-wt/paths to your agents' allowed working directories.
Connects securely to your tools. The creator never sees your data.
About this skill
Stash, switch, lose your build cache, forget what you stashed — the branch-juggling tax that worktrees were built to eliminate. Most developers know worktrees exist; almost none use them well because the workflow isn't obvious. This skill manages your worktree setup end-to-end: creating and naming worktrees for concurrent branches, setting up the right directory structure so each worktree has its own node_modules and build cache, handling shared vs. isolated config, and cleaning up safely when you're done. It also helps you design a multi-worktree workflow for your specific project — hotfix alongside feature work, review alongside active development, without context-switching cost. Give it your repo structure and your current branch situation; it returns a worktree setup you can run immediately.
- Does not manage cloud-based environments. - Requires local Git installation. - Command execution requires user approval for safety.
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 any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 4 months ago
Permissions
No special permissions declared or detected