Overview
When you want to drive multiple tasks forward in the same repository without them interfering with each other, use parallel collaboration. Qoder CLI CN offers several isolation mechanisms: put tasks into separate Git checkouts with Worktrees, drive multiple subtasks in parallel with background Agents / Tasks, and split complex work across dedicated subagents with Subagents.
This way each task has its own workspace and context, avoiding multiple sessions sharing one directory and overwriting each other's changes.
Worktree isolation
Worktrees let each task proceed in a separate Git working tree without affecting the others. Start with --worktree:
- If no name is given, Qoder generates a worktree name automatically.
- A new named worktree is placed under
<repo>/.qoder/worktrees/<flattened-name>, with a corresponding temporary branch created. - If a worktree with the same name already exists, it is reused instead of being recreated.
Parallel sessions
With worktrees, you can start a session per task and let them proceed in parallel in their own directories:
Background Agents and Subagents
For a single complex task, you can split it across multiple Subagents and drive the subtasks in parallel. Use /tasks to see the background tasks currently running:
isolation: worktree to its definition. A clean Subagent worktree is deleted automatically when it finishes; one with changes is kept.
For creating, configuring, and orchestrating Subagents, see Subagents.
Resuming and cleanup
When a session ends, Qoder prints the worktree path and the command to resume that session. An interactive exit checks the worktree for uncommitted files and new commits: a clean worktree can be deleted automatically, while one with local files or commits prompts you to keep or delete.
To clean up manually:
Tips
- One task, one worktree: put unrelated tasks into their own worktrees to avoid overlapping changes.
- When you need local files: a new worktree is a clean checkout with no untracked files by default. To copy files like
.env, declare them in a.worktreeincludeat the repository root — see Running Tasks. - Clean up promptly: after a task is done and merged, delete worktrees and temporary branches you no longer need, keeping the repository tidy.