#1 Product of the week · Launched March 3, 2026
worktree-compose

worktree-compose

Zero-config Docker Compose isolation for git worktrees. The Hunger Games for your AI coding agents.

FreeAI AgentsAI Coding15,834 impressions#1 of its week1 comment

Comments

>log in to comment
  • Mostafa Ali[maker]· 8mo ago

    Built this because running multiple agents or experiments in parallel was painful. If you benchmark LLMs, run coding agents, or experiment with stacks in isolation, this tool saves setup time. Would love feedback from the dev and AI tooling community 🚀

worktree-compose automatically gives every git worktree its own isolated Docker Compose stack. It solves environment conflicts when running parallel developers or AI agents by isolating ports, databases, caches, and containers with zero configuration. Launch multiple experiments, compare live URLs, and promote the best result.

Zero-config Docker Compose isolation for each git worktree, giving separate ports, databases, caches and containers.

for
Developers using git worktrees and AI coding agents who need isolated Docker environments.
pricing
free
license
MIT
mostafasudo/worktree-compose 48 7TypeScriptupdated 2 months ago
works withDocker ComposeGit worktreesClaude CodeCodex

Key features

6 features of worktree-compose
  • Zero Config — Run `wtc start` and each worktree automatically receives its own isolated Docker Compose stack.
  • Port Isolation — Unique ports are assigned per worktree using a deterministic formula, eliminating collisions.
  • Container Isolation — Separate COMPOSE_PROJECT_NAME, networks and volumes ensure containers don’t interfere.
  • File Sync — Compose files, Dockerfiles and .env are synced from the main branch before each start.
  • Env Injection — Port overrides are injected into .env without overwriting existing variables.
  • MCP Server — Built-in MCP server lets Claude Code, Codex and other AI agents manage stacks programmatically.

Use cases

  • Run parallel feature experiments in separate worktrees without port or DB conflicts
  • Allow multiple AI agents to test code changes simultaneously on isolated stacks
  • Promote changes from a worktree to the main branch after successful testing

worktree-compose vs alternatives

worktree-composePocketenvUnified MCP ServerFinePostalDataPI
Best forIsolated Docker stacks per worktreeGeneral sandbox runtimeComprehensive MCP integrationAI-agent-centric developmentGeolocation data API
PricingFreeFreeSubscriptionFreeSubscription
DevHunt upvotes1973297576
LaunchedMar 2026Apr 2026Jan 2026Jan 2023Apr 2026

worktree-compose FAQ

How does worktree-compose avoid port conflicts?+

It calculates a unique port for each service using the formula 20000 + default_port + worktree_index, guaranteeing no collisions.

Do I need to modify my Docker Compose files?+

No, the tool syncs your existing compose files and injects isolated ports automatically.

Can AI agents control the stacks?+

Yes, the built-in MCP server exposes commands that Claude Code, Codex and other agents can invoke.

What commands are available?+

`wtc start`, `wtc stop`, `wtc restart`, `wtc list`, `wtc promote`, and `wtc clean` cover the full workflow.

Is any configuration required?+

It works out of the box; optional `.wtcrc.json` or `wtc` key in package.json can customize sync and env overrides.

Summarized by DevHunt from worktree-compose.com · Sep 27, 2026. Details may change; check the official site.