Skip to main content
Tips

practitioner tip

The Evaluator-Optimizer Pattern That Keeps AI Output Honest

AIErudit angle: Trustworthy AI delivery means every claim gets checked against real evidence — source code, docs, config — not the model's confidence. This tip shows how to build an evaluator-optimizer as an on-demand inline skill that audits the previous output and assigns evidence-backed verdicts. It's the discipline that catches silent drift between a plan and what actually shipped.

evaluator-optimizerverificationclaude-codetips
Tip visual

Published: Feb 25, 2026 Updated: 2026-05-19

Original: https://wmedia.es/en/tips/claude-code-evaluator-optimizer-pattern

The Evaluator-Optimizer is one of five workflow patterns Anthropic defines in Building Effective Agents: one LLM generates, another evaluates and provides feedback in a loop. Claude Code doesn't have that automatic loop — but you can build it as an inline skill invoked on demand.

The pattern's core: every claim from the previous output is checked against real evidence — source code, official documentation, configuration files. Not opinions. Verifiable facts.

Result:

/evaluate       # 1 evaluation pass
/evaluate 2     # 2 passes (the second evaluates the evaluation itself)

Why a skill, not a sub-agent

The evaluator needs to see what was just produced. A sub-agent or a skill with context: fork loses conversation context — it would have to rediscover everything from scratch.

flowchart TD
    A["Does the evaluator need to see\nthe previous output?"] -->|Yes| B["Inline skill"]
    A -->|No| C["Needs isolation?"]
    C -->|Yes| D[Sub-agent]
    C -->|No| E["Skill with context: fork"]

The official documentation backs this: "Consider Skills instead when you want reusable prompts or workflows that run in the main conversation context rather than isolated subagent context."

The skill

  • disable-model-invocation: true — you decide when to evaluate, not Claude
  • allowed-tools — the evaluator needs to read and search to verify claims
  • $ARGUMENTS — /evaluate 2 runs two passes; no argument runs one

The verdict system

VerdictMeaning
VERIFIEDDirect evidence supports it
PARTIALLY CORRECTCore idea holds but details are wrong
UNVERIFIEDNo evidence found to confirm or deny
INCORRECTEvidence directly contradicts it
OUTDATEDWas true at some point but current state differs

Rule: every verdict cites a specific source — file path with line number, URL, command output. "I believe" is not evidence. No source = UNVERIFIED.

In practice

I ran /evaluate on the very analysis that produced the skill. Result: 21 claims, 18 verified, 3 partially correct. None incorrect — but three solid assumptions had nuances I wouldn't have caught without the pattern. The full article covers the process end to end: Evaluator-Optimizer in Claude Code: From Pattern to Skill.

Where I use /evaluate most day-to-day is right after plan mode. Plan mode produces a step-by-step plan; /evaluate checks it against the real codebase before Claude touches anything. And sometimes, after implementing, I evaluate again against the original plan to catch silent drift.

Official docs: Skills · Building Effective Agents — Anthropic