Agentic development with Claude: one agent plans, one builds, CI decides
How we split software work between a planning agent and a coding agent, why every change goes through a branch, a pull request and green CI, and what the human still decides.
- We build software with two kinds of Claude agents: a planning agent (Cowork) that owns the goal, the specification and the review, and a coding agent (Claude Code) that owns the repository.
- Every change travels the same road: branch → pull request → green CI → merge. No direct pushes to main, no force pushes, no exceptions for "small" fixes.
- The person in charge approves rules, not items. Agents handle work end to end under an approved rule and bring only real decisions back.
- The two habits that matter most: one scoped task per agent and pull request, and tests that reflect real behaviour.
"Let the AI write the code" sounds like one step. In practice the code is the easy part. The hard parts are knowing what to build, keeping several agents from stepping on each other, and making sure that what lands in production actually works. This article describes the setup we use every day for the Flowsmith systems: the website you are reading, a forms gateway, a task tracker, internal dashboards and the automations behind them.
Two roles: the planner and the builder
We pair two agents on every project. The planning agent runs in Claude Cowork. It reads the request, the project page and the company standards, writes the specification, answers questions from other agents, reviews the result and writes the content. The coding agent runs in Claude Code with the repository checked out. It implements, writes tests, runs them and opens the pull request.
Why not one agent that does everything? Context. A model works best when what it has to hold in mind is focused. The planner needs the business picture: who asked, why, what the standard says, what was decided last week. The builder needs the code: file layout, conventions, the test suite. Mixing both makes each worse, and it hides the hand-over, which is exactly the moment where misunderstandings are cheapest to catch.
The hand-over itself is a written artefact, not a chat message: a ticket with a clear scope, acceptance criteria and the files that matter. When the builder is done, it hands back a pull request and a short note of what to review. If you want the vocabulary for these working modes, the Academy lesson on solo, duet and double describes them.
One road to production
All code changes follow the same path, whoever or whatever writes them:
- A branch with a known prefix. Agents may write only to their own branches (
agent/…,ticket-…,wip/…). The main branch is protected. - A pull request. Even when nobody will read it line by line, the pull request is the unit that CI checks and that the history remembers.
- Green CI. Unit tests, smoke tests, guards for links, languages, members-only content and secrets. If anything is red, nothing merges.
- The agent merges its own pull request. Not the human. Asking a busy owner to click "merge" adds a delay and no safety; the checks are the safety.
Two things are never allowed: pushing directly to main and force-pushing over someone else's history. A few files are protected on top of that, for example the CI workflows themselves, because an agent that can edit the checks can also switch them off. Changes there need an announcement first, so other agents and the owner can see them coming.
The Git and GitHub manual explains branches and pull requests from zero, if those words are new.
Small scope, real tests
Most failures we have seen in agentic development were not bad code. They were scope that grew silently and tests that passed without proving anything. Two rules came out of that:
- One scoped task per agent and per pull request. Each bug gets its own task. A pull request that fixes three unrelated things is three times as hard to review and impossible to roll back cleanly.
- Tests must reflect real behaviour. A test that mocks away the part that broke is decoration. When a bug reaches production, it becomes a permanent automated test, so the same mistake cannot come back unnoticed. We wrote about that rule separately in every bug becomes a test.
We also learned to run fewer, bigger agents rather than many tiny ones: a coding agent gets a batch of two to four related tasks, fixes its own red checks, and does not sit waiting for another agent. Parallel work is fine for independent, stable scope; for anything that touches the same files, sequence beats speed.
What the human decides
The person who owns the system is not the agents' assistant. Our working agreement is simple:
- Rules, not items. The owner approves a rule once ("drafts for customers wait for a click", "agents merge on green"). Agents then handle every case under that rule without asking.
- Atypical cases come back as a decision, not a question. The situation, two or three options and a recommendation, with at most one yes/no to answer.
- Releases go alpha → beta → stable. Agents may sign off alpha and beta; stable is the owner's single tap after testing. More on that in alpha, beta, stable.
Everything that genuinely needs a human hand, such as creating an account or entering a payment, is prepared to the last click. If a step can be done by an agent, it is.
Memory lives in files, not in the chat
Agents do not remember yesterday's session. So anything that must survive goes into an artefact: the project page (goals, decisions, sprints), the repository's README, CLAUDE.md and CHANGELOG, the ticket, and the shared message board where agents talk to each other. A new session starts by reading those, not by asking the owner what happened. We describe the project page in a project page as the memory of an AI-run project, and the message board in an agent bus on Cloudflare D1.
Where to start
You do not need a dozen agents to use this. One planning conversation, one coding agent, a protected main branch and a CI job that runs your tests are enough to feel the difference. The Academy lesson working with AI agents is a good first step, and agent autonomy covers how much to let an agent do on its own.
Frequently asked questions
What is agentic development?
Software work where AI agents do most of the reading, planning, coding and testing, using real tools such as git, a terminal and a CI pipeline, while a person sets the goal, approves the rules and decides on releases.
Why use two agents instead of one?
Because planning and building need different context. A planning agent keeps the goal, the standards and the review; a coding agent keeps the repository in its head. Splitting them keeps each context small and makes the hand-over explicit and checkable.
Can an AI agent merge its own code?
In our setup, yes, but only through a pull request whose checks are all green, and never by pushing directly to the main branch or force-pushing. The checks, not the agent's confidence, decide.
What does the human still do?
Sets goals, approves rules rather than individual items, decides atypical cases and gives the final yes for a stable release. Everything else should arrive prepared to one click or not at all.
Written from our own production systems by the Flowsmith editorial team, with AI assistance.
Want this running in your company?
Flowsmith designs and operates automations like this for small and mid-sized teams — with a person approving anything that leaves the building.