Branches and worktrees
You can arrange open sessions in up to four panes. Each session has its own conversation history, but the project folder determines which files it works on. Two sessions pointed at the same folder can change the same files, even when their conversations are separate. For a Git project, you can choose among these workspace arrangements:
For two fixes that need to run at the same time, give each its own worktree so their working files are separate. Each checkout may need the project’s dependency installation and local configuration before tests can run. A worktree separates repository files; commands still run with the access granted by the operating system.
Prepare an isolated task
- Start a new Code session and select the Git project.
- Check the branch in the composer. Select the starting branch and enable a separate worktree before the first run.
- Send a request that includes any setup the new checkout needs, such as reading the README and identifying the test command.
- Confirm the session’s folder and branch before allowing edits. Install the project’s dependencies in that checkout when required.
Enable worktree before the first run to give the task a separate checkout.