Blog

AI & technology

The Agent Said Done. Who Checked?

A coding agent that stops early costs more than one that gets something wrong, because nothing tells you. We looked at our own setup for the things that decide when an agent is finished, and found three gaps.

· Sandon Jurowski

Share𝕏⬡inYf✉

A wrong answer from a coding agent is easy to deal with. You see it, you say so, it tries again.

The expensive failure is quieter. The agent says the work is done, and it is not. The tests were never run, or one of them failed and the summary did not mention it. You find out later, when the cost of finding out is higher.

Two diagrams about this crossed our feed this week. One sorted AI engineering into four layers, the other into six. We are not going to argue about the count. Both end at the same question, and it is a good one: when the agent says it is finished, what decides whether that is true?

Four layers, each one wrapping the last

Prompt: what the model should do
Context: what the model can see
Harness: what the model can do, and what checks it
Loop: when the work is finished, and what stops it

The brakes an agent cannot fake

The four-layer diagram calls the last layer loop engineering. Its useful idea is a short list of brakes that sit outside the model, so the model cannot talk its way past them:

  • A limit on attempts. The loop ends after a set number of passes.
  • A check for no progress. The same change and the same error, twice, means stop.
  • A budget. Tokens, money or time run out and the loop ends.
  • A completion check. A test or a second reviewer decides the work is done. The agent does not.

The point of all four is the same. An instruction that says "run the tests before you finish" is advice. A check that runs the tests is a fact.

What Claude Code gives you

One of these brakes is built in, and it is off until you set it up. Claude Code can run a hook when the agent stops. If that hook runs a fast check and exits with code 2 when the check fails, the agent is sent back to keep working. The documentation caps this at eight continuations in a row, so it cannot loop forever.

That one hook is a completion check and a limit on attempts at once. The hooks page has the details.

The same split between advice and fact applies to permissions. The permissions page says it plainly: "Permission rules are enforced by Claude Code, not by the model." A line in your instructions file shapes what the agent tries. It does not stop anything.

What we found in our own setup

We ran this question over our own repository. Three things came back.

A rule that was only words. Our instructions have said since June never to run git reset --hard with uncommitted work in the tree. We wrote that after a reset discarded a change nobody had saved. When we looked this week, no permission rule backed it. The agent was asked not to, and nothing more. There is one now: Claude Code refuses the command, and a person runs it by hand when it is really wanted.

A check that is always red. One of our automated checks has failed on each of the last three pull requests we looked at, for a reason unrelated to any of them. We merged all three. A check that fails every time tells you nothing, and it teaches everyone to ignore red.

Thin coverage where it matters here. We sorted the checks in our own setup tool by layer. Permissions has the most. The loop has one check. So does memory, and so does the layer for seeing what the agent did.

What we changed

Our setup check, JQ Groundcrew, now sorts its findings by layer, and each layer says what the tool does not check there. A row of passes should not read as "covered" when only one thing was looked at. That is in the published version as of November 21, 2026.

It also reads your instruction files for commands they forbid, and tells you when no permission rule backs one. It reads words, not meaning, so it finds a command only when the line writes it out. It will miss "never push to main". We say that on the page.

What we have built since, and what we have not

When this post went up, our session board could not tell a session that finished after running a check from one that finished without running anything. It can now. A session that edits code and stops with no test, lint, type-check or build command afterwards is labelled, and so is one whose last check failed. The rule reads commands, so it can be wrong; the board lets you say so, and remembers.

Two brakes are still missing from our own tools. The board does not notice an agent repeating the same failed step, and it does not show what a session has cost.

Added November 22, 2026: the loop now has a second check. From version 0.1.8 the setup check looks for a run with nobody watching, written as claude -p or the GitHub action, and says when it sets no limit on turns or on spending. That is the budget brake from the list above, for the case where no person is there to notice.

Try the question yourself

You do not need our tool for this. Open your agent's settings and instructions, and ask three things:

  1. When the agent stops, does anything run?
  2. For each "never" in your instructions, is there a rule that enforces it?
  3. Is there a check everyone has learned to ignore?

If you want the answers in one page, run npx @point-seven-studio/jq-groundcrew in a project folder. It runs on your machine and sends nothing about your project anywhere. Once a day it asks npm whether a newer version exists, and you can turn that off.

About the two diagrams

The four-layer diagram is titled "The 4 Layers of Modern AI Engineering". We saw it shared by James Code Lab, and the image carries the address newsletter.karuparti.com. The six-layer one is a document titled "Harness Engineering". We have not reproduced either image or its text, and we could not confirm the numbers the second one quotes, so none of them appear here. The list of four brakes is the first diagram's idea, restated in our words.

Anthropic's documentation can change. If this post and the documentation disagree, the documentation is right. We are not affiliated with Anthropic.

  • ai
  • claude-code
  • how-to

A little space for yourself

The most interesting story might be your own.

A quiet place to write, reflect, and see your life a little more clearly.

Start your journal