Is there a terminal state to agentic coding?

As always: I work for AWS as of writing. This post is my personal opinion and does not reflect the views of my employer.


In previous blog post, I have touched the problematic of automated coding (a.k.a. vibecoding) and how /review command in Claude Code (mis)behaved for me. As a piece of satire, I suggested adding another subscription to fix my problems. tl;dr: that is exactly what I did and I finally got to the "terminal state" I was looking for. Almost.

Let me walk you through my experience so far in this installment, dedicated to AI code review and "reconciliation" agentic coding loop. I have been using CodeRabbit for about six months now, since April. Unfortunately this is not sponsored by CodeRabbit, but I do think it is a must-have tool, with all its imperfections.

Also, glad you asked – I only use AI for spellchecks etc. and at least 95% is written by hand. Proof? Trust me bro.

Ancient Aliens meme: "Source: trust me bro!"

"The Good, the Bad…"

I decided to introduce CodeRabbit to my coding workflows as a reviewer. It leaves detailed comments inline, natively in GitHub, and comes with a generous 14 days free trial and free use for OSS (and ever since it was very instrumental to keep my public repos sane).

CodeRabbit's walkthrough comment on staqan-yt-cli #183: a summary, a Changes table per file, review effort and merge risk

Let's start with the good stuff. By design, CodeRabbit operates on PRs on an incremental basis – ticking things off as they get fixed historically, adding new review comments inline with code and sometimes even adding code snippets that would fix the identified issue (sick, right?).

CodeRabbit inline review comment on staqan-yt-cli #139 flagging a redundant try/catch, with a one-line suggested change

This tool brought me closest ever to the "terminal state", with a UX of "hey, I took a look, and I saw you fixed things so let me mark my previous threads as resolved in GitHub". As any sensible human reviewer would do.

A CodeRabbit inline finding on staqan-yt-cli #187, marked "Addressed in commit 10c3649" and resolved

So this incremental design does get me to a finish line of sorts, in fewer rounds. And the arguments I win in the comments get saved as learnings for future PRs, so I don't have to win them twice. Well, sometimes I do. Less noise, less distraction, more convergence and sort of a direction.

coderabbitai approved these changes, then the PR was merged with all checks passed

Now for the bad part. The most interrupting piece was that committing on PRs a little bit too often can trigger "this is an active-development piece so let me stop reviewing things automatically unless you tell me to resume" default behavior. And this broke the automated submit-review-resubmit loop within Claude Code monitors for me, having to manually retrigger the workflow again with @coderabbitai resume (long to type and no completion on GitHub too… even for the @-mention part). Turns out it is a setting, auto_pause_after_reviewed_commits, default 5, which I never touched, but can be a bit disorienting as OOTB. I deliberately have agents commit often so that they can go across smaller diffs during debugs.

Speaking of my setup-specific quirks. I plaintexted agents saying something like "if you want rabbit do anything for you – contact it on the PR itself, and use commands". Turns out, when CodeRabbit hits quotas, my agents decided hitting @coderabbitai full review almost every commit was a good idea. PRs with such communications feel distinctly different.

Take a look at this PR as an example, ensure you expand all history, and notice, while it has a bit of everything (a lot of comments, long diff etc.), the bigger problem is struggling to get to a terminal state quickly, despite the incremental states. Less about building upon initial review territory, more like forget everything and take a fresh look every time an agent decides to ask for a "full review", which is exactly what I wanted to avoid. Each time with a goal to find "something", and the terminal state may never come.

Repeated @coderabbitai full review comments on a treecheck PR, each answered by Action performed, then changes requested again

There are some hiccups with integration too. CodeRabbit may say "Approved" in a chat reply, literally, while the review status for the PR would be still stuck at "changes requested", and in one case it admitted it "did not update the recorded review decision". So the agent ends up talking to the bot in plain text to get the PR unstuck. At least there is someone to talk to.

CodeRabbit says APPROVED in a comment, but the PR still records CHANGES_REQUESTED until the stale review is dismissed

Another papercut, but this is not on CodeRabbit folks (who I already love so much for letting me sleep a bit more at nights). It is with gh pr command that does not show the review comments against the proposed diff. In short, CodeRabbit leaves reviews as both diff inline review, and ordinary PR comments (overview, or if there are comments to related code but not in diff proposed). Most of stuff is inline comments and there is simply no way to use gh pr to fetch the reviews (an open issue since 2020), so that Claude Code (or any other coding agent) could poll for review changes and participate effectively.

It goes the other way too: gh has no way to reply inside a review thread, which is where CodeRabbit wants the conversation, so the agent answers everything as top-level PR comments. Unless you ask your AI workforce to use gh api, or it finds out that is possible itself, and that route would waste quite some tokens. More of a gh problem than a Claude Code or CodeRabbit one, but the UX still suffers.

Now, with the ugly.

Shall we dance, or "the ugly" part of automated code-review loop

If your task is "find a mistake in this picture" and you are paid for each identified one, you will report anything, however irrelevant the finding is, or how uncertain you are, right? You would, and I would, optimize for that reward function. This is what I feel happens with Claude reviews every time and with CodeRabbit on initial reviews and forced full-reviews. Well, you are kinda asking it yourself: find mistakes is your task. And oh boy them LLMs will look hard.

Stick figure tells a computer to say "i am alive", the computer prints "I AM ALIVE", the figure gasps "oh my god."

On top of that, with Claude Code in GitHub Actions as a reviewer there is also no feedback loop – not like you can talk it through in comments, which I think would be cool. Well, technically you can, but not in CI/CD: Claude Code's /review command on local session looks to be designed exactly for this. There is also an option to copy and paste the nice prepared prompts from CodeRabbit to a model of your choosing and have it have a deeper look. But across all tools I used so far, none of the harnesses, pun intended, harness them all – automated reviews, room and UX for human intervention, automated fixes for identified issues, you name it.

Having a space where agents can interact is good, but what is more important is proper responsibility separation and isolation of them. As such, if actors have different goals (such as write code and review code) – those likely should be separate roles with separate contexts, to avoid conflicts of interest. This alone led to fewer "unnecessary" changes back and forth. The problem of "how it impacted the UI" still persists though, due to unwillingness of all the methods mentioned so far to check out "the actual product". I do not trust the E2E tests written by the session that authored the code. This is more of a sanity check, another slice of swiss cheese in my stack.

Giving all those AI-enabled tools to both write code and tests for the written code can (and, evidently, does) lead to cheating, like "fixing" tests to fit the review, the compilation, or even the failing tests themselves. Or making tests that cannot fail at all: in one PR, a test called "byte-identical output through a pipe" never used a pipe. CodeRabbit flagged it 6 seconds after the PR was already merged, but that is on the agent merging too early, CodeRabbit operated as it should.

Test 'byte-identical output through a pipe' runs spawnSync('bun', [file]) with no shell pipe

There needs to be an arbitrator, a deal breaker to say – hey, that looks off, explain yourself or go fix. Once an agent working on a server hosted on my local machine wrote a script with rsync --delete pointed at my home directory, and the only thing that stopped it was me reading the diff. Even with such separation of responsibility areas, my workflow is still far from perfect. Which leads us to the next problem.

Cognitive throughput limits of human beings (tl;dr version)

"Human's cognitive throughput limits" is the wording that describes my situation the best. This is not about permission management (a.k.a having to press "Yes/approve" every once in a while) nor is it about having to copy-paste review findings, we did walk around that somehow (with a gh api snippet like this one).

Even with above solved, I believe code review process still requires real humans, with both knowledge and willingness. In other words, competency and free time. We cannot hold AI accountable for service outages or user-facing impact. Not as if my code reaches real users, but I still want to be confident in my code.

The number of lines of code written per unit of time was and still is a stupid way to measure human coders' performance. It completely neglects architecture and review work. And where is quality, and what happens if they squash merge? Now, with "the superpowers of AI", LOC/unit of time as a variable is essentially unbounded. However, humans did not change that much, and neither did humans' physical capabilities. You can spin up more agents in parallel; you can't clone yourself. More realistic, while not completely impossible but very challenging option: hire someone with the same context overnight. Pretty hard to find a good dev these days.

Anakin and Padme meme: we hired five more devs to keep up with reviews; so the review queue got shorter, right? Each of them runs five agents; the queue got shorter, right?

The bottleneck shifted from writing code and understanding it through that process, to mostly comprehending code someone else authored (and everyone is a PM now too?). In the previous post I said I never merge without review. That changed somewhat: I still try to read diffs, but I read less of the code itself and focus more on E2E and interactive testing, partly because most of my projects have a somewhat solid base by now, and UX and functionality matter more to me. Some suboptimal commits still slip through auto mode, and my merge strategy is still squash. For both a nicer tree and to keep agents from being misguided by looking at their past selves running in circles.

We will explore this in a separate blogpost with some evidence, but let's go back on track.

Harness engineering

You might have already seen the word "harness" in context of AI agents. In my understanding, a "harness" is the tool that orchestrates the coding agent. Claude Code, Codex, Devin, even OpenClaw – they all are, or contain, a harness. They decide what the agent can do, when it stops, and what happens with the output. The word itself has gotten pretty vague lately, but that is a topic for yet another post.

Remember the cheating problem? This is exactly where harness engineering matters. If the harness lets the agent both write code and modify tests in the same loop with no external check, cheating will happen naturally, as a path of least resistance. The agent optimizes for "green CI" and sometimes the shortest path to it is "fixing" tests to fit or maybe even deleting some!

Surely, harness, in a sense of "software like Claude Code", is not something we modify directly, but more like we try to nudge agent to use some features a harness provides, in a way we like, and sometimes nudging away – this is what "harness engineering" is for me, from a perspective of a "harness consumer". I think making your own harness is generally a bad idea unless you are paid to do so, but who am I to stop you?

CodeRabbit flags a test named 'stays deterministic' that accepts either answer and asks it to assert the exact winner; marked addressed in commit daa097c

For what it is worth, here is where I am today. On some of my (hobby) repos, CodeRabbit approval is effectively "the" merge gate: once approved, the agent proceeds to merge. Hobby or not, these tools can break real things, like burning through API quota or removing important files on my disk, so this is more of an experimental run. Others are stricter: for the Terraform repos of my projects, I check 100% of plans and approve every one manually.

treecheck is a new project I have been working on, to quickly compute hashes for a directory tree and find any data degradation, and it can cause more chaos (like literally wiping what it is supposed to protect), so I test it very carefully, manually, and in phases. For staqan-yt-cli, the biggest user is my OpenClaw (remember Lera from a previous post?), and she'd file a GitHub issue for any bug or unexpected behavior.

Most importantly, building a feature or a bugfix never starts on its own: I validate the issue first, mostly in ranting session with my agents, and we validate and define the problem and possible approaches, so I can trust the delegated build process more than in "full auto". Problem definition is the part I keep interactive (my rants, or feedback from the field turned into issues with draft approaches); PR creation, review and tests are where I let automation do more. The gates are not perfect: states get stuck, and agents are rawdogging the GitHub API, at risk of forgetting the original task.

So here's the question I'm sitting with: should the review-and-fix reconciliation loop live inside the harness, like what Devin pitches: fully autonomous, reviewing its own output and iterating until everyone is happy? Or is the human intervention to review the code and… review the reviews acting like a circuit-breaker in this system? Are human pauses between diffs to take an actual look, the faster path long-term? Is shipping more/faster really that important?

Having a human in the loop feels slower, because models are faster than us. It is slower per cycle, and if speed is the only thing you measure, the human is the bottleneck. But in a combined function of speed, accuracy and quality, fewer cycles wasted on cheated tests and cosmetic back-and-forth might make it come out ahead. However in real world, I do not think there is a consensus. And I believe we should be talking more about the design of these boundaries, as the real engineering problem we, humans, for our own sake, must figure out. And that's before we even talk about what all these loops cost in tokens. Then again, tokens get cheaper and humans don't, but that's a different story.

Conclusion?

I made some progress with getting closer to terminal state in code review. CodeRabbit brought me forward for the write-review-fix loop, but is this really the best we can get to, without our repos turning into black boxes? It also opened a bigger question: where does the human belong? Not whether we belong there at all, but where exactly in the loop, and how do we design harnesses to work around humans' limitations?

My GitHub contribution graph: a blank April and May marked 'rethinking how I want all this to be', and an arrow at early April marked 'CodeRabbit starts here'

The grass field from the previous post did get greener. But look at the blank in April and May: that was me trying to design my ideal development flow, and rereading some of the code from before. I am paying more attention to what's underneath it now, even at the cost of some speed. For now, at least.