AI coding agent workflow: plan, run in parallel, review, merge, measure

AI coding agent workflow: plan, run in parallel, review, merge, measure

An AI coding agent workflow is the daily loop you run around agents like Claude Code or Codex: pick and size tasks, have the agent plan, run several tasks in parallel, review the results with evidence, merge, and measure what it cost. This guide walks through each step with the commands that do it, as of November 2026.

In shortTL;DR
  • Treat agent work as a loop of five steps: size the task, plan, run, review, merge. Skip one and the next step gets more expensive.
  • Plan anything bigger than a one-file change: Shift+Tab or /plan in Claude Code and Codex, then edit the plan before approving it.
  • Give each parallel task its own git worktree (claude -w <name> in Claude Code) so agents never edit the same checkout.
  • Ask for evidence, not a summary: the command the agent ran and its output. Then use a fresh reviewer such as /code-review or Codex /review.
  • Measure merged, working changes and cost per merged pull request, and watch change fail rate, because faster output can mean less stable delivery.

What is an AI coding agent workflow?

An AI coding agent workflow is the repeatable routine you use to hand coding tasks to an agent, keep several running, and turn their output into merged, working code. The agent does the typing and the command running. You decide what gets built, what "done" means, and what ships.

The difference from autocomplete-style AI is where your time goes. With an assistant in the editor, you write code and accept suggestions. With an agent such as Claude Code or Codex, you write a task, the agent reads the repository, edits files, runs tests and reports back. Your work moves to the two ends of the loop: preparing the task and judging the result.

A workable day has five steps:

StepYour jobAgent's jobClaude CodeCodex
1. SizePick tasks, define doneNone yetA spec file or failing testA spec file or failing test
2. PlanRead and edit the planExplore, proposeShift+Tab or /plan, Ctrl+G to edit/plan or Shift+Tab
3. RunStart, steer the first minuteEdit, run checksclaude -w <name>, /batchGit worktrees, subagents
4. ReviewRead evidence, then the diffSelf-check, fix/code-review, /verify/review
5. Merge and measureApprove, track costOpen PR, answer commentsgh, /usageGitHub PR reviews

The rest of this guide takes those steps in order. If you are new to agents, start with our Claude Code tips for the basic controls.

How do you pick and size tasks for a coding agent?

Pick tasks where you can state what done looks like in one or two sentences and the agent can check it by running something. Anything that ends with a test turning green, a build passing or a page matching a mockup is a good agent task.

Anthropic's best practices put the core problem plainly: Claude stops when the work looks done, and without a check to run, "looks done" is all it has. So the sizing question is less "how big is this?" and more "how will the agent know it finished?"

Good first-of-the-day tasks:

  • A bug with a clear reproduction: "login fails after the session times out; write a failing test, then fix it."
  • A feature that copies an existing pattern: "build a calendar widget following the pattern in HotDogWidget.php, no new libraries."
  • A mechanical change across many files: a logger migration, a renamed API, updated imports.
  • Tests for code that has none.

Poor agent tasks are the ones where the hard part is a decision only you can make: pricing logic nobody has written down, a design with no mockup, or "make it faster" with no number. Make the decision first, write it into the task, then hand it over. Our guide on how to write tasks for AI agents has a template.

When you don't know what you want yet, let the agent interview you. This prompt is adapted from the Claude Code docs and works in Codex as well:

prompt
I want to add rate limiting to the public API but haven't thought it through yet.Interview me with multiple-choice questions until you could write the spec,then write it to SPEC.md. Include what is out of scope and the edge cases that need tests.

Then start a fresh session to build from SPEC.md, so the build begins with a clean context and a written definition of done.

How should a coding agent plan before writing code?

Have the agent read the code and write a plan in a mode where it cannot edit files, then correct the plan before any code exists. Fixing a wrong assumption in a plan takes a minute; fixing it in a 600-line diff takes an afternoon.

In Claude Code, plan mode lets Claude read files and run exploratory commands but blocks edits to your source until you approve the plan (permission modes docs). You enter it three ways:

  1. Press Shift+Tab to cycle permission modes until plan mode is on.
  2. Prefix a single prompt with /plan.
  3. Start the session with claude --permission-mode plan.

When the plan appears, press Ctrl+G to open it in your editor and change it directly. Approving the plan exits plan mode and Claude starts editing.

OpenAI's Codex best practices recommend Plan mode as the default for complex work, toggled with /plan or Shift+Tab, because it lets Codex gather context and ask clarifying questions before implementing.

What to look for in a plan:

  • Files it intends to touch. A surprise file is often a misunderstanding.
  • The check it will run. If the plan has no test or build step, add one.
  • What it will not do. Scope creep shows up in plans as "also refactor X."
  • Data changes. Migrations, renamed fields and API shapes deserve a second read.

Skip planning for typos, one-line fixes and renames. The extra round trip only pays off when the agent could plausibly take the wrong path.

How do you run several coding agents in parallel?

Give each task its own checkout with git worktrees, start one agent per worktree, and keep the tasks independent enough that they don't edit the same files. Parallel agents multiply output only when their work does not collide.

A person pinning sticky notes to a task board with columns for planned and in-progress work
Parallel agents need the same thing a team board gives people: separate tasks with clear owners.

In Claude Code, claude -w feature-auth starts a session in a new worktree. A worktree is a fresh checkout, so gitignored files like .env are missing. List the small files each worktree needs in .worktreeinclude at the repo root (same syntax as .gitignore) and Claude Code copies them in:

.worktreeinclude
.env.env.localconfig/dev-credentials.json

Keep node_modules out of that file, since it copies rather than links. Put the install command in CLAUDE.md instead, so the agent runs it in each new checkout. Codex's guidance is the same in spirit: it lists running live tasks on the same files without git worktrees as a common mistake.

A morning routine for parallel work:

  1. Pick two to four independent tasks from your list.
  2. Start each in its own worktree with a specific prompt and a check to run.
  3. Watch the first minute of each. Press Esc the moment one drifts and redirect it.
  4. Switch to your own work while they run.
  5. Come back when each reports done, and review in the order they finished.

For one large mechanical change, Claude Code's /batch splits the work into 5 to 30 units, shows you the plan, then runs each unit in its own worktree and opens a pull request for it. The git worktrees guide covers ports, databases and cleanup.

Tip

The limit on parallel agents is your review capacity, not CPU. If pull requests pile up unreviewed, run fewer tasks with better definitions of done.

Agents on a laptop stop when the lid closes. If you want long tasks to keep going while you are away, Orkio rents an always-on, isolated cloud box where Claude Code and Codex keep working, and you review the pull requests from your phone or the web later.

How do you review what a coding agent built?

Review in three passes: read the agent's evidence, get a fresh reviewer's findings, then read the diff yourself. Each pass is cheaper than the next, so the first two catch what they can before you spend your attention.

Pass 1: evidence. Ask for the command the agent ran and its output, or a screenshot. The Claude Code docs note that "all tests pass" on its own tells you little, and reading the output is faster than rerunning the check. Put the request in your task or in CLAUDE.md / AGENTS.md.

Pass 2: a reviewer that did not write the code. A reviewer that never saw the conversation is not swayed by the reasoning that produced the code.

  • Claude Code: /code-review reviews the diff in a fresh subagent. /verify has Claude build and run the app and look at the result.
  • Codex: /review can review against a base branch, uncommitted changes, a specific commit, or custom instructions.
  • Either tool: a second session that reviews the changed files against your spec.

This review prompt, adapted from the Claude Code docs, checks the work against what you asked for instead of hunting for nitpicks:

prompt
Use a subagent to review the rate limiter diff against SPEC.md.Check every requirement is implemented and the listed edge cases have tests.Report gaps that affect correctness and skip style.

Keep "skip style". A reviewer asked to find problems will always find something, and fixing every finding adds abstractions and tests for cases that cannot happen.

Pass 3: you. Read the diff with the plan beside it. Look for files outside the plan, deleted tests, weakened assertions, new dependencies and changed configuration. Our AI code review guide covers what automated reviewers catch and what they miss, and can you trust AI-generated code goes deeper on the human pass.

How do you merge agent work safely?

Let the agent open the pull request and answer review comments, and keep a person as the one who approves the merge. Enforce that with branch protection, not with a line in a prompt.

The Claude Code docs draw a useful line between instructions the model reads (your prompt, CLAUDE.md, skills) and rules the tooling enforces every time (hooks, deny rules, managed settings, CI, branch protection). For merging, the second kind is what counts:

RuleWhere to put itWhy
Tests and typecheck passCI required check, or a Stop hookThe agent cannot finish or merge while red
No pushes to mainBranch protectionApplies to every agent and person
Never read .env or secretsdeny rules in .claude/settings.jsonDeny rules hold in every permission mode
A person approvesRequired review on the branchKeeps the last word with you

A Stop hook that runs your typecheck sends the agent back to work whenever it tries to finish with errors:

.claude/settings.json
{  "hooks": {    "Stop": [      {        "hooks": [{ "type": "command", "command": "pnpm tsc --noEmit 1>&2 || exit 2" }]      }    ]  }}

Merge in the order tasks finished review, and rebase the rest on the updated main before merging them. When two agent branches conflict, ask one agent to rebase and resolve against the other's merged change, then rerun its checks.

How do you steer an agent when it goes wrong?

Stop it early, roll back cleanly, and restart with a better prompt instead of piling on corrections. The Claude Code docs suggest watching the first minute, pressing Esc the moment Claude drifts, and running /clear after two failed corrections.

The controls worth knowing by heart in Claude Code:

  • Esc stops the current action and keeps everything up to that point.
  • /rewind, or Esc twice on an empty prompt, rolls the code, the conversation or both back to an earlier prompt.
  • /clear starts fresh. A third correction mostly adds to a conversation that already holds two failed attempts.
  • /rename oauth-migration names a session so claude --resume oauth-migration picks it up on another day.

Checkpoints only cover files the agent changed with its own edit tools, not files a shell command touched, so commit often and treat git as the real safety net.

How do you measure whether your agent workflow works?

Measure merged, working changes and what they cost, and watch stability next to speed. Output that grows while change failures grow too is not a win.

The 2025 DORA report, based on nearly 5,000 technology professionals, found AI adoption linked to higher software delivery throughput but still negatively related to delivery stability. Its summary: AI amplifies what is already there, so teams without strong tests and fast feedback see more change volume turn into more instability.

90%of respondents use AI at work
80%+believe AI increased their productivity
30%report little or no trust in AI-generated code
Source: Google Cloud, Announcing the 2025 DORA report

A weekly check that fits on one screen:

MetricWhat it tells youWhere to get it
Merged agent pull requestsReal output, not started tasksYour Git host, filtered by branch prefix
Cost per merged pull requestWhether the spend pays off/usage in Claude Code, provider billing
Review rounds per pull requestTask qualityPR history
Change fail rateStabilityIncidents and reverts against deploys
Deployment rework rateUnplanned fix-up workHotfix deploys

The last two are two of DORA's five delivery metrics, alongside change lead time, deployment frequency and failed deployment recovery time. If you run agents on your own Claude account inside an Orkio box, its Insights view shows spend against API-equivalent usage per project, per model and per merged pull request. For the finance side, see how to measure AI ROI in engineering.

A one-day checklist to start the workflow

Run this for one day on real tasks, then adjust.

  1. Write a short CLAUDE.md or AGENTS.md with the exact test, typecheck and lint commands.
  2. Pick three tasks that each end in a check the agent can run.
  3. Plan each one in plan mode and edit the plan before approving.
  4. Start each in its own worktree, and watch the first minute.
  5. When one reports done, read its evidence, run /code-review or /review, then read the diff.
  6. Let the agent open the pull request; you approve the merge.
  7. At the end of the day, note merged pull requests, review rounds and what /usage shows.

After a week, move any rule you corrected twice into CLAUDE.md, and any rule that must never break into a hook or a deny rule.

Frequently asked questions

How many coding agents should I run at once?

Run as many as you can review, not as many as your machine can start. Start with two to four parallel tasks, each with a clear definition of done and its own worktree. If pull requests start waiting more than a day for review, run fewer.

Should I use plan mode for every task?

No. Plan mode adds a round trip, so skip it for small, obvious changes like a typo or a one-line fix. Use it when a task touches several files, changes a data shape, or when you are not sure how the agent will approach it.

Can I let a coding agent merge its own pull requests?

You can, but you should not for anything that reaches users. Keep a person as the final approver through branch protection, and let the agent open the pull request, run checks and answer review comments. Reserve automatic merges for low-risk changes such as dependency bumps that pass CI.

What is the difference between an AI coding assistant workflow and an agent workflow?

An assistant workflow keeps you in the editor accepting suggestions line by line. An agent workflow hands over a whole task, lets the agent edit files and run commands on its own, and moves your effort to writing the task, reviewing the result and deciding what merges.

How do I know if coding agents are making my team faster?

Compare merged, working changes per week and cost per merged pull request against a baseline from before you adopted agents. Track change fail rate and rework alongside throughput, since the 2025 DORA report found AI adoption linked to higher throughput but also to lower delivery stability.

SOURCES

  1. Claude Code docs: Best practices
  2. Claude Code docs: Choose a permission mode
  3. OpenAI: Codex best practices
  4. Google Cloud: Announcing the 2025 DORA report
  5. DORA: Software delivery performance metrics
  • #ai coding
  • #coding agents
  • #workflow
  • #claude code
  • #codex
Orkio team

The team building Orkio. We write about putting AI to work: coding agents that run overnight, always-on boxes and pull requests ready by morning.

Keep reading

All posts

07:06 · YOU MERGED #128

Go to sleep. Wake up to pull requests.

Start for $19 a month
© 2026 Orkio · Hosted in Europe TürkçeStatus