Docs/Workflows
Worktrees
Give every agent its own branch and folder so parallel work never collides.
A worktree is a second working folder for the same Git repository, checked out on its own branch. ZLI uses worktrees so several agents can change one project at the same time without touching each other's files.
A worktree per agent
A new chat can start in its own worktree and branch. Each agent edits its own folder; none of them sees the others' half-finished changes. When an agent finishes, you review its branch and merge it back.
Moving a chat to another branch
The branch menu in the chat bar works after the first message too. The chat moves to the branch, keeps its conversation, and the agent is told it moved.
- A chat never changes files under another agent. If another agent works in that branch's folder, the chat gets its own worktree on a new branch.
- Uncommitted changes stay in the folder the chat leaves.
- A running chat asks before a branch switch would affect it.
If creating a worktree fails, the chat shows Git's error with Try again and Dismiss.
Copying files and running setup
A new worktree is a clean checkout, so files Git ignores, such as .env, are not there. Add a zli.json at the repository root to copy them in and run setup commands:
{
"version": 1,
"worktree": {
"copy": [".env", "apps/web/.env.local"],
"setup": ["pnpm install --frozen-lockfile"]
}
}
Setup commands run in their own terminals, and only after you approve them.
Terminals
Each chat has its own shells, numbered from Terminal 1. Terminals belong to a background process, so they keep running when you restart the window.