The mental model in five minutes — then the part you actually came for: the verifiers that live outside the obvious test / lint / typecheck box.
Strip away the hype and an AI agent is almost embarrassingly simple. Anthropic's own definition: an agent is "LLMs using tools based on environmental feedback in a loop." (Building Effective Agents) Simon Willison shortens it to "something that runs tools in a loop to achieve a goal." That loop has four beats:
Agentic loop engineering is the craft of designing the environment, tools, and iteration structure around the model so that loop runs well — rather than obsessing over the prompt. And the single highest-leverage beat to engineer is the one in gold.
Three of the four beats are easy to get for free. The model gathers context and acts all day. The trouble is the third beat — and here is the sentence that should reframe how you use Claude Code:
"Claude stops when the work looks done. Without a check it can run, 'looks done' is the only signal available, and you become the verification loop… Give Claude something that produces a pass or fail, and the loop closes on its own." — Anthropic, Best practices for Claude Code
That failure mode has a name in this workspace: premature victory. The agent declares done because the transcript reads like success. Anthropic built a whole harness post around stopping long-running agents from "prematurely declaring victory." (Effective harnesses) The cure is always the same shape: give the agent ground truth — an authoritative signal from the environment about what is actually true, not what it asserts.
You already use the obvious verifiers: compiler · type checker · linter · unit tests. They're deterministic, fast, and trustworthy — always reach for the tightest one that can catch the failure you care about. But they only cover failures you can express as a pre-written assertion. Most interesting tasks can't. Here's the menu above the obvious rung — the ones you asked about:
/code-review. (Sub-agents)The full ordered table — trust level, latency, and wiring for each — lives in your printable reference: The Verifier Taxonomy ↗
A verifier is useless if nothing forces the agent to honor it. In Claude Code you escalate the gate as the cost of a wrong "done" rises:
Two rules make all four work: show evidence, don't assert success (make Claude print the test output or screenshot), and when using TDD, commit the failing tests first so the agent fixes the code, not the test. (Best practices)
Six scenarios where the obvious verifiers fall short. For each, choose the verifier you'd reach for. You'll get immediate feedback and a short rationale.
Suggested Lesson 2 (ask me to build it): wire a real Stop hook that blocks Claude until a check passes — turning Gate 3 from theory into a loop running on your own machine.