Run each agent in its own tmux window

ai agents & parallel sessions

// what it does

Worktrees isolate the filesystem; tmux isolates the terminals. Create one session with a window per agent worktree — -c sets each window's start directory — then launch claude, codex, or your agent of choice in each window and detach while they work.

// shell

$ tmux new-session -d -s agents -n auth -c ../myapp-agents/auth
$ tmux new-window -t agents -n search -c ../myapp-agents/search
$ tmux attach -t agents

// gotcha

Always pass -c with the worktree path (or cd before launching): whatever directory the agent starts in is the checkout it will edit. Name windows after tasks (-n auth) or every window will be called zsh.

// resources