Fleet Engineering Is Insane... The Next Evolution Of Vibe Coding
AAI LABS
Computing/SoftwareManagementInternet Technology
Transcript
00:00:00We never run Claude Code in just one session, and our whole team works this way.
00:00:03While one session is busy, we're reviewing what another just handed back and sending it the next thing to work on,
00:00:09so nobody's actually waiting on a single agent.
00:00:11That's the whole point, because your time stays fully used while one session works and you deal with another.
00:00:17But the second you run them in parallel, you run into problems, and nothing looks wrong on the surface.
00:00:22Every session seems busy and the output reads fine, but underneath, they get in each other's way,
00:00:27and you don't catch it until something's broken.
00:00:29And even when they're not stepping on each other, you still hit a point where you've got so many sessions going
00:00:34that you lose track of what each one is doing, or what each one was even for.
00:00:38So like always, we had to find ways to manage it, and some are already built in,
00:00:42while others are outside tools that work insanely well.
00:00:45If you don't know us, we're a software company, and this is our channel AI Labs,
00:00:49where we show you how to optimize your processes with AI, just like we've optimized our own.
00:00:54So in this video, we'll go over everything we use to keep a bunch of sessions running in parallel,
00:00:59If you're working with multiple Claude Code sessions at once, there's a bunch of problems you usually run into.
00:01:05You don't know which session you're in, or what each one's actually doing.
00:01:09It gets hard to keep up with all of them, and the output they're giving you.
00:01:12Sometimes you need to come back to a specific session that had some important context,
00:01:16and you don't remember where you saved it, and if you've started too many sessions,
00:01:20you can easily forget what this one was even for.
00:01:22But that's just keeping track of them.
00:01:24The real trouble starts when they're all working at the same time, because if you're using multiple sessions,
00:01:29you already know they don't share live context with each other, since they each have their own memory.
00:01:34So if all your context and settings are in the global Claude.md,
00:01:38basically the main instructions file Claude reads to understand your project,
00:01:42or any other file that one session keeps updating,
00:01:44the other sessions won't know that context changed.
00:01:47They won't refresh from the global files on their own,
00:01:49so they just keep working off the outdated info.
00:01:52Each session only reads the global files at the start, or later if you manually ask it to.
00:01:57And if they need to edit the same files, they'll end up overwriting each other's changes too.
00:02:02Now Claude Code isn't just for coding anymore,
00:02:04so you can use multiple sessions for non-coding stuff as well.
00:02:07But in the coding tasks specifically, the complexity of the issues really start to add up.
00:02:12So that's why we've split this video into two parts.
00:02:14First, we'll go over how to get past the basic issues you face just using Claude Code in general,
00:02:19and then we'll focus on the problems you hit in your coding tasks and how you can fix them.
00:02:23And the solutions we cover in the general section are going to help you with the coding tasks as well.
00:02:28So we'll start with the basics.
00:02:29You probably already know some of these, but they're what everything else builds on,
00:02:33and we get into the more advanced stuff right after.
00:02:35If a session gets closed for some unexpected reason, you don't actually lose it.
00:02:40You can pick the last one back up by running the Claude command with the continue flag,
00:02:44and it'll continue the last session you had running on your device.
00:02:47And if you want a specific session instead of just the last one,
00:02:50you run the Claude command with the resume flag, which lets you resume one from a list,
00:02:54or you can add the session name right after it to jump straight back into that exact session with all its context.
00:03:00Once you're back in a session, you might not even remember what it was doing.
00:03:03So to catch back up, you just run the recap command in your terminal,
00:03:07and it gives you a quick summary of what that session was working on.
00:03:10And if you want to move from one session into a new one but carry everything over,
00:03:14you use the export command.
00:03:16It basically turns your whole chat into a text or markdown file,
00:03:20which you can then drop into a new session so it picks up where the old one left off.
00:03:24They're all really basic commands, but in day-to-day use,
00:03:27they make a big difference to both your productivity and what the model gives back.
00:03:31Take the animations in our videos.
00:03:32They're built with an internal animation system and Claude code.
00:03:36So when we go back to change in animation, we resume the session we built it in or continue it if it closed on us.
00:03:42And if it's been sitting so long we can't remember what that session was even doing,
00:03:46recap catches us back up.
00:03:47But let's say you've got multiple sessions all working on the same shared file.
00:03:51Now you don't want them to collide or overwrite each other's changes,
00:03:54so you decide file ownership right at the start.
00:03:57You give one session ownership of a file and that's the only one allowed to change it.
00:04:01The rest can read it and use it as a reference, but they can't write to it.
00:04:05And you set this up by just telling each session right in its prompt not to write to those files.
00:04:10Now let's say you're building something from scratch that's got independent parts,
00:04:14the kind of thing you can build in parallel to get it done faster.
00:04:17In that case, the workflow our team follows is to first make a plan using Claude code's plan mode.
00:04:22During planning, you give the agent all the information you have about the task
00:04:26and you ask it to break that down into independent tasks that each session can run in parallel to hit one single end goal.
00:04:33This planning and breakdown phase really matters because it gets you an almost perfect setup for your sessions to work on
00:04:39without fighting over files or overwriting each other's changes.
00:04:43It also makes sure every session has the same shared context it needs to finish the task.
00:04:47Once the planning's done, you hand over each independent task to a separate session
00:04:52so they can all work together to finish the whole project.
00:04:55And to do that, we use the handoff skill.
00:04:57Now remember the export command from earlier?
00:04:59Handoff is basically the smarter version of that.
00:05:01Export just dumps your whole chat into a file,
00:05:04so the new session inherits all that messy, slowed down context.
00:05:08Handoff actually compresses everything into a clean handoff document
00:05:11that points to your existing files instead of copying them in,
00:05:15so the new session starts fresh and focused.
00:05:17That document holds all the necessary information plus references to the files tied to that context
00:05:22and it even lists the skills the agent should install to get the task done properly.
00:05:27You install the skill with this command and then invoke it in your session using the handoff keyword.
00:05:32So once planning's done, you just ask your planning session to create handover documents for each task with the handoff skill
00:05:38and it generates one handover document per task, each pointing back to the plan file it made.
00:05:44Now to actually hand each task off to a separate Claude session, you use the Claude Agent dashboard.
00:05:49The dashboard is basically an interactive interface right inside your terminal
00:05:53where you can see all the sessions currently running in the background.
00:05:57You can move through them or open anyone to see what it's working on.
00:06:00You open it using the Claude Agent's command and you'll see a list of sessions that are either finished or still running.
00:06:06You can also type in a prompt and it'll launch a background Claude code session for it,
00:06:10so you point it at each handoff document separately and it starts working toward your final goal in parallel
00:06:15across different sessions, all of which you can keep an eye on from the dashboard.
00:06:19You can also start background sessions another way, by running the Claude command with the background flag and then your prompt.
00:06:25And if you're already in a session and wanted to keep running in the background,
00:06:29you just use the BG command which is short for background and it carries on running in the background and leaves your terminal free.
00:06:35Either way, you can see all your background sessions and how they're progressing in the dashboard.
00:06:39Using this workflow, you can break down almost any task into smaller pieces and control them from the Claude Agent dashboard.
00:06:46So those fixes cover you for general use.
00:06:49But the moment you're actually building software, a whole new set of problems shows up on top of the ones we just talked about.
00:06:55When you run multiple Claude code sessions on the same project, they can trample over each other by editing the same files.
00:07:01They overwrite each other's changes because they don't have the context of what the other sessions are doing.
00:07:05If you've got a remote GitHub repo, which means your code is online, then the sessions also start fighting when they have to push new code online and when they have to switch GitHub branches.
00:07:15One session might push to one branch while another switches to a different one and that quickly messes up your branches and your whole repo.
00:07:22And if you're running the app on localhost and you've got multiple localhost servers going, they'll try to kill each other because they all want to start on localhost 3000.
00:07:31All your Claude sessions also share the same project dependencies.
00:07:34So if one session swaps out a dependency or changes how the whole app is built or changes the database, the other sessions break because they've got no idea that change ever happened.
00:07:43To overcome these development-specific issues, the first solution we have is Git WorkTrees.
00:07:49Git WorkTree is a built-in Git feature that lets you work on multiple branches at the same time, each in its own folder, all from the same project on your computer.
00:07:58So instead of cloning the whole project into a separate folder every time you want a different branch, each branch just gets its own folder and you don't have to keep switching back and forth.
00:08:07To use WorkTrees, you can just ask ClaudeCode to create a new WorkTree for you and then you can start your experimentation in that WorkTree.
00:08:14So when you're running multiple sessions, each one works in its own separate WorkTree.
00:08:18That means they can't override each other's changes by editing the same files and they won't clash over branches either because each session has its own isolated copy to work on.
00:08:28And if you're enjoying the video so far, subscribe to the channel and hit the hype button.
00:08:32This small gesture of support goes a long way for us.
00:08:35WorkTrees stop your sessions clashing over code, but you're still the one manually handing each task to each session.
00:08:41OpenAI Symphony automates that part.
00:08:43You might have heard of this tool already, but we've never actually covered it on the channel.
00:08:47It's an open source orchestrator, which is basically a system that manages a bunch of coding agents working at once, and it was built for OpenAI's own Codex agents.
00:08:55The main idea is that your to-do list becomes the single place that tracks everything, so it shows the live progress of every session working on it.
00:09:03That way you can see how much is done and how much is left, and it makes sure all the tasks stay independent of each other.
00:09:09Symphony does this through Linear, which is a project management tool where each column stands for the current state of a task, and OpenAI built according to the harness engineering principles, which just means the whole codebase is planned, then written, and then also tested by AI agents instead of people.
00:09:24Now, since Symphony is open source, someone made their own version of it that works with Claude Code.
00:09:30What it does is run a daemon, which is basically a background process that's always running on your computer, and it keeps checking the issues in your GitHub repo, which are the tasks you make there.
00:09:40So if a new issue shows up with a specific label, like to-do, it automatically launches a background Claude Code session and starts working on it.
00:09:48Then it creates a separate branch for that task, and when it's done, it opens a pull request, which is basically asking to merge its finished work into your main code.
00:09:55But Worktrees and the Symphony forks only fix part of the problem.
00:09:59Worktrees just stop your sessions overwriting each other's files and causing Git chaos, and the forks just smooth out your workflow.
00:10:06The sessions will still break when one of them makes a dependency change, and they'll still fight over each other's local host servers.
00:10:13To actually solve these development problems, you need sandboxing.
00:10:16That's basically running the agent in a disposable, fully isolated copy of your development environment so it can work on its own without touching your real machine.
00:10:25And for that, we use Docker Sandbox, who also sponsored today's video.
00:10:28Each sandbox runs on a dedicated micro-VM with a hard security boundary, meaning when Claude installs packages or builds the project, all of that stays contained inside the sandbox, and your real system is left untouched.
00:10:41It's the only sandboxing approach that lets a coding agent build and run containers while staying isolated, and it pairs naturally with Claude Code's parallel sub-agents, each in its own Git worktree.
00:10:52To install Docker Sandbox on your computer, you run the installation command, and then you log in with this command.
00:10:57Once you're logged in, you create a sandbox with the sbx command, using the name flag, then your sandbox name, then Claude.
00:11:04Once it's launched, the AI agent you talk to runs inside that isolated sandbox.
00:11:09By default, the agent inside the sandbox writes its changes straight to your working tree, meaning your actual project files.
00:11:16To take it a step further, Docker Sandboxes give you clone mode.
00:11:19When you create the sandbox, you add the clone flag, and it makes the sandbox with a clone of your project.
00:11:24That way, any changes the agent makes inside the sandbox don't touch your real files, they only happen inside the clone.
00:11:31Now let's say you need to build a big feature in your app, and you're thinking about manually firing up multiple Claude Code sessions to do it.
00:11:38You don't really need to do that anymore.
00:11:39The models today are powerful enough to handle that whole workflow for you, because their ability to spin up and manage different sub-agents or tasks has gotten really better.
00:11:48Nowadays, you can just ask Claude Code to plan out the entire feature first, then take each sub-task one by one, spin up a Docker Sandbox for it, and hand that sub-task to the sandbox.
00:11:58That way, every sub-task gets done in its own isolated environment, and the changes don't affect what the other sessions are doing.
00:12:04That same planning session acts as the orchestrator, managing all the sandboxes and pulling in the changes from each one.
00:12:11When a sandbox finishes its work, the planner can delete it once it's confirmed the task is done.
00:12:16And while the sandboxes are running, you can watch their progress from the sandbox dashboard.
00:12:21Now all the skills and workflows and everything else we build and show you in these videos can be found in AI Labs Pro, which is our community.
00:12:27That's where you'll get the resources, the starter packs and more, along with a place to interact with a bunch of like-minded people, including our team.
00:12:35So if you've found value in what we do and want to support the channel, this is the best way to do it.
00:12:39The link's in the description.
00:12:41That brings us to the end of this video.
00:12:43If you'd like to support the channel and help us keep making videos like this, you can do so by using the super thanks button below.
00:12:49As always, thank you for watching and I'll see you in the next one.