We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Multiple Agents

Are you ready for the hack? The one trick that can finally make you a 10x engineer?

... okay, maybe not. But a 1.2x engineer? Or a 2x engineer? In my experience, it's closer to 1.5x.

The trick is multiple agents.

If all you do is prompt your agent, and then just sit there with a blank stare on your face while you contemplate the meaninglessness of this existence and whether you'll ever find true love, you probably won't be much more productive than if you were to just type the change yourself. Agents can produce code quickly, but part of the reason their slop is remotely tolerable is because they go through so many tool calls and iterations before showing you the result.

And that's slow.

So, oftentimes the real productivity boost comes from the fact that you can go do something else while you wait. Unfortunately, if you just spin up another instance of OpenCode in the same directory, the two agents can step on each other's work.

Use Git Worktrees

While you can simply copy your entire codebase into another directory and have a second agent work there, that's pretty clunky. Frankly, I almost never used the git worktree command before I started coding with AI, but now I use it all the time.

A Git worktree is a way to switch to another git branch, but actually work on that branch in another directory on the same machine. The worktree is still linked to the original Git repository, so you can easily share and merge the changes when you're done.

We cover worktrees in our Git 2 course. I won't rehash it all here, but the basic commands are:

# create a new worktree at FILEPATH
git worktree add FILEPATH

# list all worktrees
git worktree list

The key benefit of a worktree is that it provides a separate working directory while sharing the same Git repository and history. Each agent can work on its own branch without touching another agent's in-progress files.

I usually have two worktrees per project, one agent running in each. Honestly, I've tried to run three agents at a time, but the context-switching (at least for me) gets to be too much at that point. I'd only go that far if an agent were going to churn for literal hours unsupervised.

Assignment

Run two reviews in separate working directories so the agents don't interfere with each other's files.

Tell the original OpenCode session to run and submit the CLI tests from the original project root.