Two approaches
Trellis supports two ways to run multiple agents:
This guide focuses on Multi-Session - the worktree-based approach.
Why Multi-Session
Some tasks are independent. Adding a login page doesn’t affect adding a settings page. With separate worktrees, agents can’t interfere with each other.Configuration
Before starting, createworktree.yaml in your project root:
id: Unique identifierbranch: Git branch nameprd: Requirements for this task
Starting parallel sessions
Use the/trellis:parallel command in Claude Code. It reads worktree.yaml and:
- Creates worktrees for each task
- Spawns Claude Code sessions
- Sets up branches
Monitoring progress
Check status with:Session pipeline
Each session follows phases:- Plan - Understand requirements, identify files to modify
- Implement - Write the code
- Check - Review against specs, self-fix issues
- PR - Create pull request
When to use this
Good for:- Independent features
- Parallel bug fixes
- Generating variations (different approaches to same problem)
- Features that depend on each other
- Work that touches the same files
- When you need to iterate with the AI
Cleanup
When done, clean up worktrees:Platform support
Multi-Session requires hooks for automatic context injection (currently supported by Claude Code and iFlow).
Agent pipeline
Each multi-session task uses a 6-agent pipeline:
You also need enough API credits. Three sessions means three times the token usage.