# Verification Loops — Advanced Agent Workflows and Skills

Source: https://www.geekswithgeeks.com/en/agent-workflows/rel-verification

> Give the agent a way to check its own work with tests, linters and type checks.

## Let it see the result

Agents do much better when they can run something that tells them if the work is right: tests, a linter, a type checker, a screenshot. Tell the agent the verification command in `CLAUDE.md`, and ask it to run it before saying it is done.

## Build, measure, improve

You cannot improve what you cannot measure. Evals, checks and budgets turn a demo into a dependable system.

![Four stages: verify, evaluate, limit, observe.](assets/figures/agent-workflows/section-7-map.svg) — Figure 7.1 — Verify, evaluate, limit and observe.

## A verification script

One command that fails loudly gives the agent a clear signal. `set -e` stops at the first failing step.

```bash
#!/usr/bin/env bash
set -e
npm run lint
npm run typecheck
npm test
```

## Do not trust "done"

An agent can report success without checking. Read the test output yourself for important changes, and be suspicious of tests that were weakened to make them pass.

**Quiz:** What most improves an agent's reliability on a coding task?

- [ ] A longer prompt with more adjectives
- [x] A command it can run to verify its work
- [ ] Hiding the test results
- [ ] Fewer files in the repo

*Answer:* A command it can run to verify its work. Feedback from real checks lets the agent find and fix its own mistakes.
