

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Accountability
incomplete
2: Evidence Debugging
incomplete
3: Refactoring
incomplete
4: Good Code
incomplete
5: Incremental Changes
incomplete
6: Workflow
incomplete
7: Multiple Agents
incomplete
8: Keep Learning
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
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.
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.
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.