One project, one workspace
Every project has its own workbench and its own branch. That lets several AI agents work on one laptop at the same time without saving each other's work.
As of November 2026. Tools: git 2.54, Orca 1.4.269, Claude Code. The commands in this article use a made-up example, not my real projects.
The situation
Alongside my job I have more than twenty projects. Most of the work in them is done by AI agents in the terminal. Time is short, so I want two agents working on two things at once.
The simplest way is one folder with the repository and two sessions open in it. That works until one agent finishes and saves its work. If it saves everything it finds changed in the folder, it also takes the other agent’s unfinished work. Nothing is lost, but half-done work looks finished in the history, and one project’s description sits on top of another project’s changes.
What I gave the AI and what I did not
I trusted the agent with the work inside a project: writing, editing files, saving changes, and merging finished work.
I kept the decision of where each agent works. An agent does not create or choose a new workspace on its own. I open the one that belongs to the project. The reason is simple: an agent sees only its own session. It does not know another one is running next to it.
What a workspace is, in plain words
Git, the program that remembers the history of files, can lay out the same files into several folders at once. This is called a worktree. It is another folder with the same files, connected to the same repository but switched to its own branch. The history is shared, unfinished work is not. What an agent changes in one folder, the other folder does not see until it is merged.
I think of it as a workshop. The repository is the storeroom with materials, a workspace is a workbench. Two people at one bench grab tools out of each other’s hands. Two people at two benches do not get in each other’s way, and they carry a piece back to the storeroom only when it is finished.
Orca is the application where I see those benches side by side. It calls a worktree a workspace, opens a terminal for each one and can start an agent in it. The worktrees and branches themselves can be made without it, with git alone. Orca saves me switching between windows.
The rule the agent reads
The agent learns about workspaces from a rules file it reads at the start of every session. My rule, rewritten for a made-up repository with the projects blog, faktury (invoices) and appka (app):
- Každý projekt má vlastný workspace a vlastnú vetvu `ukazka/<projekt>`. V cudzom nepracuj.
- Prvý krok vo workspace je `git merge main`.
- Pridávaj len súbory, ktoré si menil ty, a vymenuj ich. Nikdy `git add -A` ani `git commit -a`.
- Hotové zadanie zlúč do `main` skriptom `nastroje/zluc.sh`.
My rules are in Slovak. In English: every project has its own workspace and its own branch, do not work in someone else’s. The first step in a workspace is git merge main. Add only the files you changed and name them; never git add -A or git commit -a. Merge a finished task into main with the merge script.
The core is the first line. One project has one permanent workspace and one permanent branch. New ones are not created, not even for a new task. With dozens of projects I would otherwise spend my time creating and deleting.
Creating a workspace for the project blog with git alone:
git worktree add ../ukazka-workspaces/blog -b ukazka/blog main
The same through Orca from the command line:
orca worktree create --repo id:<repozitar> --name blog --base-branch main --setup run
The whole ritual of one session then looks like this:
cd ../ukazka-workspaces/blog
git merge main
# ... the agent works ...
git add blog/clanky/vymysleny-vrch.md
git commit -m "blog: prvý článok rozpísaný"
sh nastroje/zluc.sh
The merge script does four things in order: it checks that nothing is left unsaved, pulls the main branch into the project branch, merges the branch into the main one, and says what to do next. By hand that is four commands and three places to make a mistake. It does not delete the workspace after merging; it waits for the next task.
Second round: what I had to add
What is not in git is missing in a new workspace. Git carries over into a new folder only what it tracks. The settings file and the attachments folder are deliberately untracked, so they were not in the new workspace and nothing in it could run. In September 2026 I therefore added a setup script that runs after a workspace is created. It does not copy the missing things; it creates links to them in the main folder. The data is on disk once and two versions cannot drift apart.
What does not apply in a workspace. Apps that keep their data outside the repository share that data across all workspaces. When I start the same server from two workspaces at once, they write into one database and fight over the same port. And everything that runs on its own for me, the control panel (I call it the control room), the morning batch and deployment, reads only the main branch. What stays on a project branch does not exist for the system.
The batch has its own bench. Agents that work unattended do not work in my workspaces. They have one of their own, do each task on a separate branch, and the work reaches the main branch only after it passes a check.
Today I have 3 repositories and 60 workspaces in Orca.
What went wrong
In September 2026 the checker that reviews the agents’ work from the batch reverted a change that the batch had not made; another session had. Parallel work on one repository is normal for me, and whoever sees only their own session easily mistakes someone else’s commit for an error. Since then the rule is that someone else’s commit is never reverted.
Two more rules exist for the same reason. I merge after every finished task, not after the whole project, so that the difference between branches does not pile up. And in a conflict in a shared file, both sides are kept; other people’s lines are not overwritten. New lines in a project overview are always written at the top of the section.
How to check
Three commands for moments when I am not sure where I am:
git branch --show-current
Prints the branch this folder is on right now. It should be the project branch, not main.
git status
Shows what is changed and unsaved. Before merging, the list should be empty.
git log --oneline main..HEAD
Lists the saved steps that are on the branch but not yet in the main one. If it prints anything, that work does not exist yet for the rest of the system.
What to watch out for
- A workspace is not a backup. It is another folder on the same disk. The backup exists only once it is pushed to GitHub.
- One branch, one workspace. Without forcing it, git will not let the same branch be open in two workspaces at once. That is a safeguard, not a bug.
- Links and ignore patterns. The setup script creates links to folders. A pattern in the ignore file that ends with a slash only matches a real folder, not a link. Linked attachments then show up as new files to save. That is why I write patterns without the trailing slash.
- Sensitive files. A link to the attachments means the agent in every workspace sees the same attachments. Anything I do not want to show the agent must not be there either.
- Responsibility. What gets merged into the main branch is my decision, even if the agent typed the command.
Takeaways
Two agents in one folder will sooner or later save each other’s work. A workspace is a second folder with the same files on its own branch, and it solves that problem without any extra tool; git is enough. What has worked for me is not to create a workspace per task but to keep one permanent workspace per project. The price is discipline: merge the main branch at the start and your own work at the end. When I skip that, the work stays on the branch and nobody knows about it.
Exercise for today: in any test repository, run git worktree add ../pokus -b pokus, change one file in the new folder and look into the original one. The change will not be there. Cleanup: git worktree remove --force ../pokus throws away the test folder including the change, and git branch -D pokus deletes the test branch. Both commands delete without asking, so only on a test.
Sources
- Git documentation, git-worktree: https://git-scm.com/docs/git-worktree (behaviour checked in git 2.54, November 2026)
- Git documentation, gitignore: https://git-scm.com/docs/gitignore
- Orca, command help
orca worktree --helpin version 1.4.269, November 2026; vendor documentation: https://orca.dev/docs
Previous episode: A map of my workshop. Next episode: Orca from A to Z.
I prepared this text with the help of AI from my own notes.