# Agent workflows can automate recurring codebase maintenance

Markdown copy of https://realalpha.app/s/agent-workflows-can-automate-recurring-codebase-maintenance/ on Real Alpha, the best minutes from long interviews with the people building AI. Cite and link the page, not this copy.

- Speaker: [Boris Cherny](https://realalpha.app/builders/boris-cherny/) · Boris Cherny is creator of Claude Code at Anthropic. · Created Claude Code at Anthropic and leads its team; previously spent about five years at Meta.
- Host: [Diana Hu](https://realalpha.app/people/diana-hu/) · Managing partner, Y Combinator · CTO of Escher Reality; after Niantic bought it, ran AR for Pokémon GO.
- Show: Lightcone
- Episode: [Boris Cherny: We Cut 80% of Claude Code’s Prompt](https://realalpha.app/v/qyPCVqFUyDo/), Jul 27, 2026
- Moment: 24:51 to 30:23 of the episode (6 min), playing on https://realalpha.app/s/agent-workflows-can-automate-recurring-codebase-maintenance/; the episode from there: https://realalpha.app/v/qyPCVqFUyDo/?t=1491

## Quote

> “So Quad kind of goes out every day across all our codebases, it finds these nearly duplicated abstractions, and **it unifies them**.”
> — [Boris Cherny](https://realalpha.app/builders/boris-cherny/) at [29:17](https://realalpha.app/v/qyPCVqFUyDo/?t=1757) · Lightcone

## Takeaways

1. Dynamic workflows can split complex work across agent stages.
2. Routines can repeatedly handle maintenance across codebases.
3. Claude’s routines submit daily pull requests for review.

## About this segment

Boris Cherny explains how dynamic workflows coordinate agents across multiple stages, and how recurring routines clean up code, add tests and unify abstractions. The team runs hundreds or thousands of agents a day.

From “Boris Cherny: We Cut 80% of Claude Code’s Prompt”, Jul 27, 2026. [Watch the full episode](https://realalpha.app/v/qyPCVqFUyDo/)

## Transcript

Transcribed by machine (Whisper) from the episode’s audio, so a word may be off here and there.

[25:02](https://realalpha.app/v/qyPCVqFUyDo/?t=1502) I think this is another of the tips. The best cloud users are able to spawn tasks that are really providing you a lot of leverage, like thousands of agents. How do you do that? There's a few different ways to do it. The easiest way is dynamic workflows. To use dynamic workflows is a fairly new feature in cloud code. And all you have to say is use a workflow. That's it. And then Claude will just trigger the dynamic workflow.

[25:32](https://realalpha.app/v/qyPCVqFUyDo/?t=1532) What a dynamic workflow is, is essentially we have the BUN runtime. We use BUN as a sandbox and we start a virtual machine within BUN. And we let Claude start a lot of agents and orchestrate them. And it doesn't just do one agent. It doesn't just do like 10 parallel agents. What it might do is, let's say a task is like rewrite the code base or do really in-depth data analysis over some really complicated data or maybe like build a very complex feature that takes multiple stages and maybe dozens of pull requests.

[26:04](https://realalpha.app/v/qyPCVqFUyDo/?t=1564) And so what it's going to do is it's going to start a bunch of agents to do kind of like the first pass. Based on that, it might do a second step where it has another set of agents that verify the work or that summarize the work. Then it might do like a third stage where it'll fan out again. So it'll kind of productively orchestrate a bunch of different agents. So my background is functional programming.

[26:27](https://realalpha.app/v/qyPCVqFUyDo/?t=1587) And so the way that we design this is it's essentially an algebra for agents. So there's a way to run agents in sequence. There's a way to run agents in parallel. And Cloud has different tools in order to orchestrate these agents inside of the sandbox to use tokens efficiently to do really, really complex work. It's kind of cool and something that just hasn't really been written about a lot. Like, this is actually like a new form of test time compute.

[26:55](https://realalpha.app/v/qyPCVqFUyDo/?t=1615) Like, when we talk about the scaling laws and kind of we talk about the model getting more intelligent over time, historically, it's been a function of the size of the neural net, the amount of training data, and the number of flops that you put in to the training. And then recently, we also added test time compute. So this is essentially a fancy researcher way of saying, how many tokens does it generate?

[27:17](https://realalpha.app/v/qyPCVqFUyDo/?t=1637) And now, dynamic workflows are essentially a new way to orchestrate test-time compute. And it's a new way to kind of really, really ramp up the amount of test-time compute that you use to do a really hard task. So, this is a very long way to say, this is one way to launch thousands of... agents in a way that is productive and efficient. A second way to do it is loops and routines. Loop is essentially a cron job that's running locally for quad.

[27:43](https://realalpha.app/v/qyPCVqFUyDo/?t=1663) Routine is the same thing, but it's running in the cloud. So you can close your laptop. And this is slightly different, because for a dynamic workflow, it's one task, and you break it up into chunks. For loops and routines, it's one task that is repetitive, that doesn't share context, but it might share memory. And you kind of do this over and over. or you can do it maybe every hour, every five minutes, every day.

[28:07](https://realalpha.app/v/qyPCVqFUyDo/?t=1687) And so the thing that we've started doing is we actually have Claude maintaining itself now. And the way we do this is we have a Slack channel where we just had Claude start a bunch of different routines to maintain its own code base. And we actually do this for the CLI, for the iOS app, for the Android app, for the desktop app. And, for example, one routine is clean up dead code. This is a single prompt. It's like one sentence.

[28:32](https://realalpha.app/v/qyPCVqFUyDo/?t=1712) Cloud runs this every day. It'll look for dead code across all the code bases using static and dynamic analysis. We didn't prompt that. It just kind of figured it out. And it'll put up pull requests every day to delete the dead code. Another example is shipping experiments that should go out. So the experiment's already out to 100%. It'll delete it from the code base and it'll just ship it. Another one is writing tests for areas of the code base that need test coverage.

[28:59](https://realalpha.app/v/qyPCVqFUyDo/?t=1739) Another one is deleting tests that don't need to be there because they were kind of useless tests added by older models or added by people at some point. One that I really love is this, I forget what we called it. I think we called it abstraction police. And the idea is there are, often in a big code base, there's kind of the same abstraction and it appears multiple times. And if you kind of squint, it actually maybe should just be the same abstraction.

[29:23](https://realalpha.app/v/qyPCVqFUyDo/?t=1763) But kind of over time, for whatever reason, you rebuilt it multiple ways in different parts of the code base. So Quad kind of goes out every day across all our codebases, it finds these nearly duplicated abstractions, and it unifies them. And so now we have every day maybe 20 or 30 of these routines. It's running across all of our codebases, and it's not totally there yet, but we're on the path to fully automating the maintenance of our apps by doing this.

[29:50](https://realalpha.app/v/qyPCVqFUyDo/?t=1790) And this is, again, hundreds of agents running every day, sometimes thousands of agents every day. It's doing the work of, you know, dozens or hundreds of engineers. This is kind of what it used to take to do this kind of work. And this means that engineers can just, like, do the thing they actually want to do, which is ship new products and talk to users and do stuff that's actually fun. I guess next conclusion for this, which you have mentioned in the past,
