For a while now we have been building our own software factory at CircleCI; initially for our own use, but whatever we build for our own teams doubles as a test of what we could hand to our customers.
When we first began unleashing agents across the organization, we quickly identified several unanticipated steps to maximize agent value and mitigate their risk. The factory evolved substantially from there. This article covers how we improved on that initial rollout, what broke once the improvements started working (and how we operate now).
Hypothesis
Our first hypothesis was the one most organizations start with: put an agent in every engineer’s hands and development speeds up. Plenty of companies are still at this stage, with each engineer using Claude Code on their own, one task at a time. I would describe it as a fine place to start and a poor place to stay.
At this stage, every session began from zero. Agents don’t pause to ask for context when it’s missing. They guess, usually by finding the closest open-source convention and running with it. The obvious problem became that the code looked right but wasn’t using our style and patterns, and fixing it cost more tokens and time than the agent had saved.
Claude gives you the same output it gives everyone else. What makes the output yours is the paved path: a pre-built, opinionated way of doing something your team has already agreed on and encoded into tooling.
We already had one, in the form of standard service scaffolding, shared pipeline templates, and common libraries that handle auth or logging the way our company does it. The trouble was that it lived in documentation and conventions that an agent couldn’t easily pick up. So we decided to encode it for agents, on the hypothesis we should have started with: an agent can only move as fast as what it has to inherit.
That hypothesis held up, and it created a new problem. Once teams had the encoded conventions, their agents started quickly producing good pull requests, and review became the bottleneck. We first felt it on the v3 API work, where changes sat waiting on reviewers. Other teams in the organization had run into it sooner.
By then, agents were writing the code and humans were prompting other agents to review it. That’s madness! We had automated the typing and kept the queue. Changes were now ready faster than anyone could approve them, so the constraint had moved from writing code to getting it into production.
Our final hypothesis followed from that conclusion: taking humans out of the loop wherever we safely can would reduce the bottleneck (or as Circle CI Senior Staff Software Engineer Claire Alvis says, “fewer meatbags in the loop”).
Review was the obvious place to start. A person relaying a prompt to a reviewing agent adds very little judgment, and a bot that engineers could trust as a reviewer would speed up the rate at which changes reach production. Once that worked, the next step was to combine writing and reviewing into a single system with fewer people in the middle.
Setup
Encoding the paved path came first. Teams wrote CLAUDE.md files, per repo and per person, so the agent stopped relearning our conventions in every session. The workflows we kept repeating (shipping a PR, debugging CI, reviewing a diff) became skills, and the skills got bundled into shared plugins that live in one repo with our company-wide rules encoded.
That repo is what properly unlocked us, because when one team added a skill or rule to the repo, every other team’s agents picked it up automatically. If you take one piece of this setup, take the shared plugins repo. The v3 API was the first real test of all this, and connecting agents to our other systems through MCP servers came later. We designed guardrails that were agent-friendly, and they let us move very quickly on the API itself.
Testing our final hypothesis necessitated a bot that engineers could trust to review their changes. Claire built one largely on her own in May: we call it factory-bot. It is a GitHub user that engineers request as a reviewer. It began modestly, with Slack posts and simple deterministic checks, before it grew LLM review with prompt-injection guards, labels on GitHub, and real past PRs used as test cases for the reviewer itself.
It reads our internal plugins and skills (our institutional knowledge, encoded for agents) along with the CLAUDE.md and agent markdown files from whichever repo it is working in, and it has some built-in handling for token spend, because getting good outcomes at a sensible cost matters as much as the review. Its comments show a red, amber, or green verdict you can read at a glance.
Results
The first sign it was working was the commit count. With factory-bot reviewing, changes were finally reaching production at the rate they were being written. The number landing each week rose to around 200, closer to 40 a day (compared to roughly 10 per day before).
We should be upfront that this comparison flatters us a little, because the open source language server repo was stable beforehand and our appetite for changes grew at the same time as our ability to ship them. It’s a virtuous cycle: you build a factory and then think about all the things you can point the factory at that you couldn’t before due to time and cost constraints.
The bot itself kept growing too, going from Claire alone to a dozen or more contributors; a sign it had stopped being a side project.
The next big shift came when Claire got the same engine running on a developer’s own machine. It went from reviewing changes to making them. From a Linear ticket, it builds the change, then reviews and merges it, with a human approving every plan.
Now an idea goes in, and tested, reviewed code comes out, making it a true factory.
Not long after, it moved into its own repo, circleci/factory, with its full history intact and the old bot services dropped. During its first week there, a central service went into production that coordinates work across developers’ machines and remote test environments, splits large plans into smaller ones, and reruns failed jobs on its own.
In its first eight days in the new repo, circleci/factory received over 500 changes, all authored by the original factory running on Claire’s laptop. Partway through, we made the move from a single machine to the cloud. When the cloud version took over, it began making changes to itself.
TL;DR
Looking back, the one piece of advice we’d recommend is to set up a shared repository of plugins, and then put real effort into telling people it exists. The repo itself was the easy part. Once it was there, people started adding new rules and skills at quite a pace. This sounds like the goal, but it meant engineers had no way of knowing what was in it from one week to the next.
For a long time, we had a plugin that did a very good job of assessing the authorization patterns in a service across our gateway, our proxies, and our backend services, but half the organization had no idea it existed, so they went on repeating mistakes we had already made. Building a plugin isn’t good enough on its own, because you also have to say plainly what is in the shared tooling and that you want people to adopt it, particularly as they take on more agent-based coding.
The other lesson is one that arrives later and more quietly, and it’s about the CLAUDE.md files. Most teams have an agent write one for each repo, commit it, and move on, and from then on every future agent trusts what it says while the code changes underneath it.
Some teams are good at keeping theirs current as part of their own routines, but we wanted something that doesn’t depend on anyone remembering. This is what Claire’s repo fixer does (covered in a separate post): It runs across every repo in the organization and opens a PR to say, in effect, here’s a change to your CLAUDE.md, when the code has moved but the file hasn’t.
Where this leaves us is somewhere we did not plan to be when we first handed out agents: the factory is now used to build more of the factory.
Admittedly, this progression wasn’t a fully naive discovery. We had read about other teams’ factory journeys. But we’re all engineers, and we’re not going to take it at face value. We want to try it ourselves.
We understand that our customers will operate much in the same way, so we built our factory in a generic fashion, with the idea that customers could use it to configure their own, based on their company’s risk tolerance, compliance, and governance.
If the pattern so far is any guide, we’ll continue to encounter bottlenecks, because every one we removed (writing the code, then reviewing it) only showed us the next. At each stage, we zoom out and the problems get a little more meta. We’ll keep working out what it takes for the factory to handle each new layer, testing it on ourselves first, with the knowledge that what works for us will work for our customers too.





