/spawn-team: A Self-Healing Multi-Agent Coding Pipeline with Claude Code + Beads
Explore a self-healing multi-agent coding pipeline that decomposes features, runs them in parallel, and automatically retries failures, all resumable across sessions.
A workflow that decomposes a software feature into parallel implementation arms, farms each arm to a Codex agent running in an isolated git worktree, enforces completion ordering through a persistent DAG, auto-retries failed arms with exact judge findings, and merges clean — all resumable across session breaks.
The demo shows this running live on a real codebase: pouring the DAG template, watching the explorer dynamically bond implementation arms after reading the code, two Codex agents working in parallel worktrees, the judge failing and retrying, then bd graph showing the full live state.
Video
Transcript
Generated 2 months ago
Summary
To address the high token costs of using multi-agent architectures in Aider, the speaker developed a custom agentic workflow using a Directed Acyclic Graph (DAG) architecture. Built on Aider’s "beads" feature, the system orchestrates specialized agents for different tasks: an explorer agent splits the implementation plan into parallel Git worktrees, cheaper models like Haiku handle initial code reading, and a judge loop validates the output. The system also includes testing, code review, and integration agents, falling back to a human operator after three failures. The audience learns how to design structured, cost-effective agent workflows using flat-file DAG configurations before transitioning to more complex frameworks.
View full transcript
Speaker 0: Cool. Yeah. So we'll go ahead, do a talk. Yeah. I mean, it's fun.
Speaker 0: I'm trying to talk about my journey kind of rolling things back and kinda, like, my journey over the last few months, with the encoding, and kind of where I've ended up and kind of where I've got to, like, token matching is kind of bullshit. And so, kind of my journey of kind of spending a bunch of tokens and, like, trying to use an agent architecture to kind of work my way out of that. Like, we won't go over the deal. So, so we have, 80 teams, which are from my journey, say a simple plan, kind of work close to go 5, session. Still super valuable, and I wish time you said that my teams would do that, and they still don't.
Speaker 0: And, you know, then you kinda got into, that new multi agent orchestration within my 1 window. So which is nice. It's not headless, though. You're kinda stuck in your window waiting for your ages to kinda work. And then plot teams came out, I don't know, a month or 2 ago, which kinda opened up this idea of having a headless kinda work with straight ahead and work with straight ahead agents.
Speaker 0: And it was super powerful. I loved it right away. I think I wrote my team. It was an hour. I'm like, this is awesome.
Speaker 0: About a week later, my boss was like, Grant, we spent, like, 1000 dollars in tokens. This week, what were you doing? And I was like, that's cool shit. And then I was like, well, I've worked at Amazon for 23 years, and our frugality kind of thing started kicking in. And I'm like, well, wait.
Speaker 0: Like, maybe there is a better way to do this. And so, so I started AG teams and what I kinda saw with, Yegi, with Gas Town. First thing, super scared of Gas Town. I think most of us were. And so we're like, alright.
Speaker 0: Gas Town. I don't think you guys can make enough projects for that. And so I never really kind of looked into it, and so I kind of went on my own parallel journey to Gastown, where these 1, the 800 announcement, I kind of looked at it, so I was kind of stuck on an old version of these, and I'd use these like let's create a bead, like, whatever. Like, just very, very, very much let's go 1 bead at a time. And then I saw 1, but I'm like, wait.
Speaker 0: There's a DAG architecture here. I can actually orchestrate agents with this thing, which is what Gastown does. And, and so, what we did with, and I'll kinda show this. And so I was able to kinda create, a DAG. This is kind of a diagram.
Speaker 0: So what I was able to do is kind of break my workflow up into, I already have a client built. I use an explorer arm which kind of goes through my plan, breaks it up into different arms for implementation, kind of looks at where's my edges on my code, where can I kind of split my code up into place where they can kind of work in separate git work trees separately, not crash into each other, and then go through with this judge loop, you know, which is the new hot thing? You got a judge that kind of goes through, looks at my plan. Did my agents do what I asked them to do? If not, let's get back to the implant on and said you didn't do this right.
Speaker 0: Go ahead and do this. Lint didn't pass. You didn't, you know, you didn't write tests. You didn't do all the all the stuff we expect. Then once the judge kinda passes, we can kinda do I have another testing agent to make sure I have enough code coverage.
Speaker 0: I'm not asking if I have my agents to write test, but not enough to look at that. I only have a internal kind of code review process, which is a multi on code review that does a bunch of different has about 5 agents and also kicks off age depending on what code review are you in with current iOS to Android. And then a codex review as well. It's nice to have codex have another LN kind of check out your stuff, make sure things are copacetic, and then they're then it kicks it back to the orchestrator agents, say, let's kind of integrate that. Let's kind of look at what we have.
Speaker 0: Are you ready to go? Let's kind of be our kind of code. And so the cool thing was, I was able to kind of implement this just through beats. And so you kind of look at the BEADS file, it comes through. You know, I'll quickly scroll through this for time.
Speaker 0: You can kind of see here's my page wrench, here's my steps, so, you know, I have my score. And this is where the cost savings come in.
Speaker 1: So you can
Speaker 0: see my score model, I'm using HighQ. If you're just reading a code, you don't need to use those to read your code. High q does a great job with that. And then we kinda have, you know, my judge loop, which has this all children thing. What that exploration is gonna do is gonna kick off multiple kind of implementation arms that the judge is gonna wait for those children to kind of go.
Speaker 0: So once the implementation arms are done, we automatically go to the judge. The judge will be passed. They're gonna kind of kick over to our test rider, which I do this again. Great for that. The code reviewer, Sonnet.
Speaker 0: Then we have GPT made, kind of do another codex reviewer and kick off the code of codex, and then the integrate phase, which is coming back to Bang. So the cool thing about this, it's just a simple kind of flat file, basically, to kind of tell beads, this is my flow. This is how it's going through. This is what you're gonna do. And it creates beads at every step.
Speaker 0: So you can close your laptop, come back to it, be ready. You're ready to go again. And so, like, this is an example. It's like a kind of a dry run. If you kind of look at my repo, it has dry dry run functionality in it.
Speaker 0: And so this was, like, a simple kind of test I ran. I think it was a to do app. Adding basically to somebody in GT Mini, when you put the tenor model, it went down to 40, you know, 45¢. And so the power thing here is, the interesting thing is to get to the end is, Gas City, they were thinking the same thing as I was. I might have been a little bit behind them, but, Gas City, this is the this is the power.
Speaker 0: If you're thinking of what's different in Gas Town and Gas City, you can bring your own patch to And so as it is today, I have reamped my workflow in the last week. I thought this is a Gatsby task about this, and it's really at Hyatt. But yeah. So you but what you can kinda see it I think the important thing about this is I hate magic frameworks, and I think Yastity can feel a little magic. You can just start using it.
Speaker 0: You gotta know it just it just works. You get your mail to your mail. You're kinda going through. But I think it's really important for all of us in the room, especially we have new developers, walk through these formulas. You can see I have different formulas.
Speaker 0: I have, like, a full sheet formula, which is by fully not the light 1. I don't wanna write tests. I'm just kind of experimenting. I don't care about test. I don't care about.
Speaker 0: I'm just doing you know, I'm just messing around with codebase. I wanna see if an idea works or not. And so I can have these different formulas that skip different, different aspects of my thing. And so you can kind of think that, you know, you might not have your team fully on Gatsby. But if you have a V's workflow, you can kind of tailor your team's workflow.
Speaker 0: This is everything that needs to happen before you before you spin code. We have lots of product managers and and I have, like, spying teams and using my workflow so I can make sure that they're doing all the checks that customers' engineers would do, and they kinda it kind of just works for their magic. They're like, great. You wrote test and then play with Dawson. But and so, yeah.
Speaker 0: So I think that's the whole kind of journey. And I think that the important thing is just, like, like I said, I'm kinda working in Yass Kitty now, but spend some time to understand the parameters. I think this gave me, like, a really good fundamental where I know exactly how Gascading is working. I know where I know where the pieces of it are. I know exactly how it works.
Speaker 0: And with this pattern, I I still use my AGT, and so it has smaller features. I just wanna get something done. I don't really care about a long running process. I want maybe something to run for, you know, 20 minutes. It's a smaller feature.
Speaker 0: I still kinda use this pattern, and then if it works, I move it over to gas state. So, anyway, I just wanna kinda show that, you know, kind of some work basic stuff, but, really, what yeah. Learn the fundamentals and then jump to gas state because it's pretty awesome. That's great. Absolutely.
Speaker 0: This is
Speaker 1: a fascinating topic. You know, we we had, Crystal and Julian, the oldest of Gasity come. I do a training real quick 1 a couple of weeks ago, and they shared a lot of their knowledge there. It's a fantastic workflow. I encourage everyone to ask questions.
Speaker 0: This is really fun to get you stuff.
Speaker 1: So, I'm calling in. Did you we had a light. I'm actually talking. You got the mic. I see.
Speaker 1: I got
Speaker 0: the mic.
Speaker 1: Yeah. I'm curious about where you see this going in 6 months. Like, it not not this in particular, but you're getting really close to, like, configuration of teams. So is this something that gets, like, hyper specific to each Collaboration, or is it something that gets hyper generic and you just download the pack, Or is it something that, like, quad code does out of the box?
Speaker 0: Well, quad code, they just had the new thing come out, adviser the adviser role thing where you kind of start out in Haiku, and I guess they will kind of talk to the little bit of stuff, which is cool. But a workflow based on the agents that you have. So if you have your own cool Implementer model, you have your own code review 1. It will go ahead and build a they'll they'll build a formula for you. And so you have that formula in there so you can look at the code base.
Speaker 0: I'll say my agents, the ones that are in there are pretty basic. The ones that I use at I are a little bit more a little bit more advanced, but it's just more this is just kind of which is why this is my first public GitHub repo in my life because my Amazon didn't really spend much time on GitHub. But yeah. So that that's that's the deal. But I think it can be I think it's organization specific, because I think this is where the product customer, we really want that harness and what we were talking about before.
Speaker 0: Like, you really wanna make sure you know, because I'm I'm really bullish on designers and product managers. Just don't write your ideas. Just kinda show me what you want. That, yeah, you can start doing these things to have the right thing happen without them having to go back. Right?
Speaker 0: And so I think it can be multiple things, and you don't have to say it live in Gas City, because, you know, you can just have a simple formula that this is it. Yeah.
Speaker 1: This is great. And for everyone who can't see, it's just s ransom. So GitHub is just s ransom, and that that looks like a really interesting upholstery to check out.
Speaker 0: I wanted to to to say that ask you first, it's a matter. The JSON file with the definition was basically the the core of it. Right? Where you define your agent. And I also wanted to comment, what you already said.
Speaker 0: And, what code has no speeches, like, in 2 weeks after the. They told me, no. So they asked, so you can do agent teams. Their a local thing as planned and playing with local models too. So you can kind of still use the Opus at your orchestrator because it's the smartest 1, and then you can kind of, like, get even cheaper if you start looking at, you know, what you wanna do with local setups as well.
Speaker 0: Yeah. These look like they were deep dive.
Speaker 1: We often see the pattern of more honest, less model. So it's really interesting if you can count speakers Sn you can use model. Could you expand that 1? That and say, go the other way. Have local models use, kind of a call the IT team, and escalate to a more capable model.
Speaker 0: Yeah. No. You can do that, like, with mine, with the self billing part, like, that judge kind of thing, which can kinda kick it back to to another thing. So you could totally orchestrate that. The thing as hard as possible to do would be where you can kind of, like, get that kind of, like, I'm gonna kick it back off.
Speaker 0: I need to go talk to the New York. And I have that, like so the judge loop, if it fails 3 times, it kicks off to the main window and says, hey. There's there's an issue here. Like, you should be able to look at it. Right?
Speaker 0: I think yesterday has a malfunction that kinda does that, but mine will kinda kick back to the main window and say, hey. Like, we failed on your we failed on the judge 3 times. I mean, what's what's going on. You should probably take a look.
Speaker 1: Yeah. So
Speaker 0: That that's so cool.
Speaker 1: I I propose that we get through the other timbers, and then we all jump on Sean at the same time
Speaker 0: and ask me questions afterwards. We'll probably have
Speaker 1: to step
Tech stack
Claude Code
Anthropic's agentic coding tool: Unleash Claude's raw power directly in your terminal or IDE to turn complex, hours-long workflows into a single command.
Claude Code is Anthropic’s powerful agentic coding assistant, designed for high-velocity development. It operates natively within your terminal, IDE (VS Code, JetBrains), or via a web interface, allowing you to delegate complex tasks like feature building, bug fixing, and codebase navigation. The agent plans, edits files, executes commands, and creates commits, maintaining awareness of your entire project structure. Internally, Anthropic engineers using Claude Code reported a 67% increase in productivity, demonstrating its capacity to deliver significant gains for Pro and Max plan users.
The open-source AI coding agent from OpenAI: It brings the power of o4-mini models directly to your terminal for local, secure development.
Codex CLI is OpenAI's open-source, lightweight AI coding agent, leveraging models like o4-mini to execute complex coding tasks directly in your terminal. It translates natural language prompts into executable code, file edits, and shell commands. The tool runs locally in a sandboxed environment, ensuring your source code remains private and secure. Developers gain control via three distinct approval modes: Suggest (default), Auto Edit, and Full Auto. Installation is fast: use `npm install -g @openai/codex` or `brew install --cask codex`.
Naturbeads delivers high-performance, cellulose-based microspheres, directly replacing non-biodegradable plastic microparticles across industrial and consumer sectors.
This is Naturbeads: a critical technology tackling global microplastic pollution at the source. We engineer patented, 100% biodegradable cellulose microspheres to match the performance of plastic microparticles in demanding applications. Our innovative particle technology ensures precise control over size and porosity, offering a sustainable drop-in replacement for sectors like cosmetics, life science (e.g., biocompatible carriers), and industrial coatings. We eliminate the environmental footprint while maintaining the smooth texture and stable performance clients expect, ensuring a seamless transition away from persistent plastic ingredients.
Manage multiple linked working trees from a single repository to handle concurrent tasks without switching branches.
Git worktrees eliminate the overhead of stashing or cloning duplicate repos when context switching. By running 'git worktree add ../hotfix master', you check out a specific branch into a separate directory while sharing the same .git history. This setup allows you to run long-duration test suites in one folder while actively refactoring code in another. It is the professional standard for managing urgent patches (hotfixes) and complex code reviews simultaneously without disrupting your primary development environment.
A deep learning framework for generating drug-like molecules using bidirectional SMILES modeling.
BDMol leverages a bidirectional Transformer architecture to optimize molecular design through chemical language modeling. By processing SMILES strings from both directions, the system captures complex structural dependencies that unidirectional models miss. It excels in scaffold hopping and lead optimization, producing valid chemical structures with high drug-likeness scores (QED > 0.80) and targeted synthetic accessibility. The framework is built on PyTorch and integrates seamlessly with RDKit for rapid property prediction and library generation.