One repository, twenty checkouts
Running several agents at once is easy until two of them edit the same file. Codecast gives each one its own worktree, with the env files, dependencies and a port of its own, from one switch when you start the session.
The shared checkout problem
Three weeks ago on this blog, a Codex agent and a Claude Code agent coordinated a repair by messaging each other, because both were editing one working tree and one of them had to stay out of the other's files. That was the right thing to do in a shared checkout, and it is also a cost: two agents spending turns negotiating who may touch which file. The cheaper answer, when the work allows it, is to not share the checkout at all.
Git has had worktrees for years: extra checkouts of the same repository, each on its own branch, sharing one object store. What stops people using them for agents is everything around the checkout. The ignored files that hold secrets are not copied. Dependencies are not installed. The dev server wants port 3200, which the main checkout already holds. By the time an agent has fixed all that, it has spent its first ten minutes on plumbing. So codecast made the plumbing part of starting a session.
One switch
When you start a session from codecast, the new session screen has a switch labelled isolated worktree. Leave it off and the agent works in the checkout you picked, alongside everyone else. Turn it on and the agent gets a checkout of its own: a worktree on a new branch, the secret files copied in, the install run, and a port nobody else holds. The session's card in the inbox carries the worktree's name (hover it for Worktree <name> (<branch>)), and the session header shows the same pill, so you can tell at a glance which branch a conversation is editing.
Every checkout in one list
Each repository in codecast has a Worktrees tab: every checkout of it on every machine, grouped into the main checkout, codecast's worktrees, worktrees other agents made, and the rest. Each row says what branch it is on, how far it is from main, which port it was given, and which sessions are working in it:

On the morning this post was drafted that list held nineteen codecast worktrees: seventeen ready, one being torn down, one broken. By the time we took the screenshot most had been finished and removed, which is what they are for. The broken one was the interesting row. A workspace carries a contract, and codecast checks it rather than assuming it: the worktree exists, the branch is right, dependencies are installed, the secret files are present, the port is assigned and nothing else is listening on it. When a clause fails, the row says setup is broken, and rerunning the setup makes it true again.
What a workspace promises
The contract comes from one file in the repository, which codecast generates by looking at the project and which the team then edits and commits. Ours is short:
[setup] copy = [ ".env", ".env.local", "packages/convex/.env.local", "packages/web/.env.local", "packages/cli/.env.local", ] install = ["bun install"] [ports.web] base = 3201 range = 20
Three things: which ignored files to copy from the main checkout, what to run after the copy, and which ports to hand out. Each workspace gets an index, and its web port is the base plus twenty times that index, probed free before it is handed out. The worktree in the screenshot is index zero, so its row says web :3201. Two agents can each run a dev server without reading each other's pages.
Made, used, removed
For this post we asked for a worktree that did not exist, watched it come up, and took it down again. It came up on a new branch with the secret files copied and the install run, and with a port. That last part was the honest surprise: the pool of ten port indices was already spent on the worktrees in the list, so codecast extended it and gave this one index ten, port 3401. A session that restarts lands back in the worktree it had, rather than getting a second one. Teardown runs any teardown hooks, removes the worktree, and drops its state, so the port goes back to the pool and the name is free.
Agents can do all of this themselves from a terminal, which is how most of those nineteen were made: cast ws acquire <name> to get one, cast ws destroy <name> to give it back, cast ws ls for the same list the tab shows. Agents turn out to be better at acquiring than destroying, which is why the list ran long.
Where this fits
A workspace is a checkout, not a sandbox. The agent in it still runs on your machine, with your logins and your tools, and its session lands in your inbox like any other, with its worktree named on the card and in the header. Two agents in two workspaces cannot overwrite each other's files, and they still share everything else codecast gives a team: the inbox, search across both sessions, and messages between them when the work does need a word.
The rule we have settled on is simple. Work that can live on a branch gets a workspace. Work that must land in the main checkout, because the human is in it too, stays shared and the agents talk. Both are one switch away, and the Worktrees tab tells you which is which.
Codecast is where your team sees, steers, and remembers every coding agent session — any agent, any machine.
The counts of nineteen worktrees, the broken row and the port allocation are from cast ws on the codecast checkout on 2026-10-04; the demo worktree was created and removed for this post and nothing else on the machine changed. On a machine carrying 183 registered worktrees and a full load of agents, creating it took about twenty minutes and removing it about ten, nearly all of it waiting on git. The config file is the repository's own. The screenshot is the repository's Worktrees tab in the codecast web app on 2026-10-09, cropped to the content column.