← statichum.studio

Per-worktree environment isolation (services, databases, submodules), not just worktree lifecycle

dev tool real project ••• trending

Developers running multiple branches and AI agents in parallel via git worktrees keep hitting the same wall: worktrees isolate files but not the surrounding environment. Each worktree still shares one Docker stack and database, and `git worktree` famously won't initialize submodules, which breaks monorepos. The 2026 crop of worktree managers automates create/switch/merge but punts on per-worktree services and submodules.

builder note

The wedge the AI-agent rush exposed but nobody fixed is that parallel work needs isolated services, not just isolated files... ship Compose templating (unique ports plus namespaced volumes/DB) and conditional submodule init on `worktree add`, and stay vendor-neutral instead of bolting onto one agent CLI.

landscape (3 existing solutions)

Worktree lifecycle management is now crowded and effectively solved. The unsolved part is environment isolation: standing up isolated services/DBs per worktree and auto-initializing submodules, which every parallel-worktree tool currently leaves to the user.

worktrunk CLI for parallel-agent worktrees with per-worktree dev-server ports and setup hooks, but advertises no Docker/database isolation and no submodule initialization.
gwq Pure lifecycle (create/switch/remove plus a fuzzy finder); nothing about per-worktree services, databases, or submodules.
git worktree (native) Submodule support is incomplete, so a new worktree leaves submodule directories empty, and Docker/DB state is shared across all worktrees.

sources (2)

hn https://news.ycombinator.com/item?id=48373764 "Worktrees don't support git submodules and it's killing me in my monorepo" 2026-06-02
hn https://news.ycombinator.com/item?id=48421405 "git worktrees can be super frustrating to manage especially across multiple agent sessions" 2026-06-06
gitworktreemonorepodockerai-agents