The Intern Pattern
Plan, approve, execute, review.
Treat the agent like an over-eager intern. Plan, approve, execute, review, in that order and never out of it. Skip a move and the result is plausible wrongness shipped at machine speed.
Opinion
I've managed enough interns to know what an over-eager one does to a codebase without a plan. Three files where one was needed. An invented naming convention. The first plausible API that compiles. The agent does the same thing, faster, and with more conviction. The fix is the same one the intern gets: write the plan together, sign it, then let them type. Without the plan-and-approval gate, the agent will improvise into a wrong-shaped solution that is plausible enough to pass review.1
Anthropic put Plan Mode in Claude Code precisely because the loop counts for more than the model.2 Cursor offers an autonomy slider. Karpathy presents the same thing as the gap between “vibe coding” and agentic engineering: the verifier in the loop is what separates a demo from a deliverable.3 The four moves (plan, approve, execute, review) are the agent analogue of P2 Spec-First Execution. P2 says read the brief first. AI1 says write the plan, get it approved, execute, then review, every time, on every change. With a human pair-programming partner the loop is a discipline. With an agent, skipping it produces uninspectable output at machine speed.
The review leg is not optional. Anthropic's own evaluator-optimizer pattern formalises the loop: one call generates, another evaluates, the cycle repeats until the artefact passes grading.4 See AI6 Self-Review Pass for the agent's side of the review. The human still grades the result. Both gates close before merge.
Copy a note and link
Grab this short comment and drop it into a PR comment or an LLM chat to prompt the right change.
Plan, approve, execute, review: every change. The agent will produce plausible wrongness at machine speed unless the loop closes. Plan in writing before any edit. Approve before execute. Review before merge. /tenet/the-intern-pattern/AI1
AI eyes only
Rule: plan, approve, execute, review. Edits without approval are rejected.
Reject: editing files before the human has approved a plan. Reject: declaring done before a review pass. Reject: skipping the plan because the change “looks small”.
Generate: a written plan (Claude Code Plan Mode via Shift-Tab twice, Cursor plan agent, or PR description) ending with one named verification step. Wait for approval. Execute. Run the verification. Hand back with the verification result.
Diagnostic: name the verification step before any edit. If the verification is “it looks right”, stop and rewrite the plan with a runnable check.
Why?
- Catches the agent's signature failure mode (confident, fluent code that solves the wrong problem) before it reaches main. The plan-and-approval gate is the only place a human can intervene at the cost of minutes rather than the hours an unwind costs.
- Pairs cleanly with P2 Spec-First Execution. The four moves are the agent analogue of the human spec-first protocol. The same discipline runs at both layers without translation cost.
- Backed by the major platforms. Claude Code Plan Mode, Cursor's autonomy slider, LangGraph's plan-and-execute primitive, Anthropic's evaluator-optimizer pattern: the loop is the convergence point, not a Prickles invention.
- Slashes rework. Reading a written plan and rejecting a wrong-shaped approach takes minutes. Reverting a half-built implementation, untangling its imports, and reissuing the prompt takes an afternoon.
- Compounds with AI6 Self-Review Pass. The agent grades its own work first. The human grades the result. Two gates with different failure modes catch different bugs.
- Encodes once in AI2 Persistent Brief and applies on every session. The four moves become house style instead of a discipline you remember to enforce.
- Compresses without breaking on low-stakes work. A one-line plan, a one-line approval and a diff read still execute the four moves: the discipline survives even when the work doesn't earn the full ceremony.
Origins
The four-move loop is not new. Every engineering manager uses it on an intern, the staff engineer's playbook for a junior, the open-source maintainer's playbook for a first-time contributor: write what you're going to do. Let me read it. Do it. Let me review it. The agent inherits the same protocol because the failure mode it faces is the same one a junior faces, confident output that solves the wrong problem, only faster and at higher volume.
Anthropic formalised the loop in Building Effective Agents (December 2024) under the name evaluator-optimizer: “one LLM call generates a response while another provides evaluation and feedback in a loop ... This is analogous to the iterative writing process a human writer might go through when producing a polished document.”4 The same post documents orchestrator-workers for work whose subtasks cannot be predicted up front, and puts the human gate in the agent loop: agents “pause for human feedback at checkpoints or when encountering blockers”. Anthropic's Effective Context Engineering post (September 2025) carries the plan through long tasks: the main agent “coordinates with a high-level plan” while subagents do the deep work, and structured notes let it “track progress across complex tasks”.5
Claude Code shipped Plan Mode (Shift-Tab twice) as the visible UI affordance: the agent reads files and proposes a plan but makes no edits until you approve.2 Cursor ships its own Plan Mode: Shift+Tab from the chat input rotates to it, and the agent researches the codebase, asks clarifying questions and writes a plan you can edit before it builds.6 LangGraph offers plan-and-execute as a prebuilt pattern.7 The convergence across the major tools is not coincidence but the loop the task structurally requires.
Karpathy's verifiability thesis sits in the same tradition. His Sequoia Ascent 2026 fireside chat is the cleanest single-source statement: “Traditional computers automate what you can specify in code. This latest round of LLMs can automate what you can verify.”3 The loop is the verification. Without it, the agent is a generator without a grader and the work is shipped on the strength of the agent's self-confidence: which, on every published benchmark, exceeds the agent's reliability.
Quotes
In the evaluator-optimizer workflow, one LLM call generates a response while another provides evaluation and feedback in a loop. … This is analogous to the iterative writing process a human writer might go through when producing a polished document.
Traditional computers automate what you can specify in code. This latest round of LLMs can automate what you can verify.
A plan in Claude Code is effectively a markdown file that is written into Claude’s plans folder by Claude in plan mode. … However there is something which you can’t really replicate and that is that plan mode at the end comes with a prompt to the user.
Whether solo or in a team, the emerging best practice is to treat AI-generated code as a helpful draft that must be verified. … Never commit code you can’t explain.
Evidence
16 external sources, ranked by author authority. The first five are the canon; expand to see the rest, including the qualifiers and the named opposers. Each links out to its primary source.
- 01Building Effective AgentsSupportsNames the evaluator-optimizer pattern as a production workflow: one LLM call generates, another evaluates, the loop repeats. Source-of-record for the review leg of the four moves.
- 02Context is a finite resource with an “attention budget”. For long-horizon tasks, compaction, structured note-taking and sub-agent architectures keep the agent coherent, with the main agent coordinating from a high-level plan.
- 03Shift-Tab twice enters Plan Mode. The agent reads files, proposes a plan, and makes no edits until the human approves. Direct UI affordance for the first two moves.
- 04Practitioner teardown of Plan Mode. The plan is a markdown file in Claude's plans folder; the one part you cannot reproduce by prompting is the approval prompt the mode puts in front of the user at the end.
- 05“Traditional computers automate what you can specify in code. This latest round of LLMs can automate what you can verify.” Draws the load-bearing distinction between vibe coding, which raises the floor, and agentic engineering, which raises the ceiling.
- 06Cursor exposes the same loop with different keystrokes. Shift+Tab rotates to Plan Mode, where the agent researches the codebase, asks clarifying questions and writes a plan you can edit before it builds.
- 07Plan-and-execute goes out as a first-class workflow primitive alongside ReAct and Reflexion. Industry validation that the loop is not a discipline preference but a workflow primitive.
- 08Code Review in the Age of AISupportsTreat AI-generated code as a helpful draft that must be verified. Never commit code you cannot explain. The review leg of the four moves, articulated for human reviewers.
- 09Practitioner's view of the four-move loop. Plans the work, lets the agent execute, reads the diff. The one thing you cannot outsource is testing that the code works.
- 10Peer-reviewed evidence (NeurIPS) that adding a self-evaluation loop produces large benchmark gains (HumanEval pass@1 91% vs 80% prior SOTA). The review leg, formalised.
- 11Six areas the most effective specs cover, from GitHub's analysis of over 2,500 agent configuration files: commands, testing, project structure, code style, git workflow, boundaries. The plan leg of the four moves, broken out into a checklist.
- 12Plan-and-execute and orchestrator-worker as core abstractions. The same loop in a second major framework: convergence rather than coincidence.
- 13Devin and the autonomy betOpposesThe high-autonomy counter: a single agent runs a long task end-to-end with retroactive review. The reply addresses why the demos read like demos when the loop only closes at the end.
- 14ICLR paper showing pure introspective self-correction can decrease accuracy. Reinforces the case for an external grader (the human approval gate) rather than weakening it.
- 15Subagents run in their own context windows and only return relevant information. The orchestrator-worker pattern is the four-move loop instantiated across multiple agents.
- 16Tool definitions deserve as much prompt engineering as overall prompts. The execute leg only works if the agent's tools have been engineered to fail loudly on misuse.
Sixteen sources across the four moves. Anthropic's own engineering posts (Plan Mode, Building Effective Agents, Effective Context Engineering) supply the canon for plan and review. Armin Ronacher's Plan Mode field-notes and Karpathy's autonomy-slider idea extend the row. The workflow-primitive literature sits further down. The opposing view (that aggressive autonomy is worth more than slow loops) is real and addressed in the reply.
Enforcement
Apply these rules in dangerfile.ts. The full enforcement across every tenet lives on the implementation page.
| Rule | Tool | Catches |
|---|---|---|
| danger-js: PR body sections | Danger JS | PRs missing the Plan / Approval / Self-Review sections in the body. |
| actions/checkout + dangerfile | GitHub Actions | PRs that pass review-eyes but skip the loop. Runs Danger on every PR event so the gate cannot be edited away. |
| Husky commit-msg hook | Husky | commits whose message is missing Plan / Approved-By / Reviewed-By trailers. The trailers are the auditable record of the four moves. |
| Commitizen schema | Commitizen | commits that skip the structured trailers. The schema makes the four-move record machine-readable and machine-checkable. |
dangerfile.tsconfiguration snippet
import { danger, fail, warn } from 'danger';
const body = (danger.github.pr.body ?? '').toLowerCase();
const hasPlan = /## plan\b/.test(body);
const hasApproval = /## approval\b/.test(body) && /signed[- ]off/.test(body);
const hasReview = /## self[- ]review\b/.test(body);
if (!hasPlan) {
fail('AI1: PR body must include a "## Plan" section. Plan, approve, execute, review.');
}
if (!hasApproval) {
fail('AI1: PR body must include a "## Approval" section with a signed-off line.');
}
if (!hasReview) {
warn('AI1: PR body should include a "## Self-Review" section before human review.');
}Apply these rules in dangerfile.ts. The full enforcement across every tenet lives on the implementation page.
| Rule | Tool | Catches |
|---|---|---|
| danger-js: PR body sections | Danger JS | PRs missing the Plan / Approval / Self-Review sections in the body. |
| actions/checkout + dangerfile | GitHub Actions | PRs that pass review-eyes but skip the loop. Runs Danger on every PR event so the gate cannot be edited away. |
| Husky commit-msg hook | Husky | commits whose message is missing Plan / Approved-By / Reviewed-By trailers. The trailers are the auditable record of the four moves. |
| Commitizen schema | Commitizen | commits that skip the structured trailers. The schema makes the four-move record machine-readable and machine-checkable. |
dangerfile.tsconfiguration snippet
import { danger, fail, warn } from 'danger';
const body = (danger.github.pr.body ?? '').toLowerCase();
const hasPlan = /## plan\b/.test(body);
const hasApproval = /## approval\b/.test(body) && /signed[- ]off/.test(body);
const hasReview = /## self[- ]review\b/.test(body);
if (!hasPlan) {
fail('AI1: PR body must include a "## Plan" section. Plan, approve, execute, review.');
}
if (!hasApproval) {
fail('AI1: PR body must include a "## Approval" section with a signed-off line.');
}
if (!hasReview) {
warn('AI1: PR body should include a "## Self-Review" section before human review.');
}Apply these rules in .github/workflows/ai1-intern-pattern.yml. The full enforcement across every tenet lives on the implementation page.
| Rule | Tool | Catches |
|---|---|---|
| GitHub Actions workflow | GitHub Actions | PRs missing the four-move sections; runs on every PR open/edit/synchronize. |
| danger ci | Danger JS | the same gate, scriptable in JS instead of YAML. Lets the dangerfile co-evolve with the PR template. |
| git commit-msg hook | git | commits missing Plan / Approved-By / Reviewed-By trailers. Last line of defence when CI is bypassed. |
.github/workflows/ai1-intern-pattern.ymlconfiguration snippet
name: ai1-intern-pattern
on:
pull_request:
types: [opened, edited, synchronize]
jobs:
enforce-loop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Require Plan / Approval / Self-Review sections
run: npx danger ciApply these rules in pyproject.toml. The full enforcement across every tenet lives on the implementation page.
| Rule | Tool | Catches |
|---|---|---|
| commitizen schema | Commitizen | commits whose messages do not contain the Plan / Approved-By / Reviewed-By trailers in the documented order. |
| pre-commit commit-msg stage | pre-commit | the same trailers at the commit-msg stage. Shorter feedback loop than waiting for CI to fail. |
| ruff check (custom) | Ruff | files modified without the corresponding plan reference in the changelog. Custom rule via plugin; complements rather than replaces the commit-msg gate. |
pyproject.tomlconfiguration snippet
[tool.commitizen]
name = "cz_customize"
[tool.commitizen.customize]
schema_pattern = "^(feat|fix|chore|refactor|test|docs)\\(ai\\): .+\\n\\nplan: .+\\napproved-by: .+\\nreviewed-by: .+"Apply these rules in pmd-ai1.xml. The full enforcement across every tenet lives on the implementation page.
| Rule | Tool | Catches |
|---|---|---|
| commit-msg hook | git | commits missing the Plan / Approved-By / Reviewed-By trailers. Standard SCM gate that pre-dates and outlasts every CI vendor. |
| git-commit-id-plugin | Maven plugin | build artefacts that go out without the four-move audit data. Embeds commit metadata in the JAR so the loop record travels with the deployable. |
| PMD XPath rule | PMD | code changes that lack a corresponding plan reference. Custom rule paired with the commit-msg hook. |
pmd-ai1.xmlconfiguration snippet
<?xml version="1.0"?>
<ruleset name="AI1: intern pattern">
<rule ref="category/java/codestyle.xml/CommentDefaultAccessModifier"/>
<rule name="PullRequestRequiresPlan"
class="net.sourceforge.pmd.lang.rule.xpath.XPathRule"
message="AI1: commit message must contain Plan / Approved-By / Reviewed-By trailers."
language="java">
<description>Enforced via a git-hook script that fails the commit if the trailers are absent.</description>
</rule>
</ruleset>Apply these rules in .php-cs-fixer.dist.php. The full enforcement across every tenet lives on the implementation page.
| Rule | Tool | Catches |
|---|---|---|
| CaptainHook commit-msg | CaptainHook | commits missing the Plan / Approved-By / Reviewed-By trailers. Hook config lives in captainhook.json and comes with the repo. |
| git commit-msg hook | git | the same trailers without the framework. Cheaper to start with; harder to share across the team. |
| PHP-CS-Fixer header_comment | PHP-CS-Fixer | files modified without the canonical change-record header. Pair with the commit-msg gate; PHP-CS-Fixer is the source-side belt to the SCM-side braces. |
.php-cs-fixer.dist.phpconfiguration snippet
<?php
return (new PhpCsFixer\Config())
->setRiskyAllowed(false)
->setFinder(
(new PhpCsFixer\Finder())->in(__DIR__ . '/src')
)
->setCacheFile(__DIR__ . '/.php-cs-fixer.cache');
# Pair with a .git/hooks/commit-msg that rejects messages missing
# Plan: / Approved-By: / Reviewed-By: trailers. AI1 is enforced at
# the commit-message gate, not the source layer.AI rules
.cursor/rules/ai1-intern-pattern.mdc--- alwaysApply: true --- ## Prickles AI1: The Intern Pattern Treat the agent as an over-eager intern. Run the loop in four moves: plan, approve, execute, review. Skip a move and you produce plausible wrongness at machine speed. Plan before you type. Use Plan Mode (Claude Code), spec-first prompts (Cursor), or a written outline checked into the PR description. The plan names files, decisions and the verification step. Approve in writing. The plan is a contract. Approval is the gate. No edits until a human (or the orchestrator agent) signs off. Execute in small, reviewable units. The agent runs the plan. The next gate is the review pass. Review every change. The agent grades its own work first (see AI6 Self-Review Pass). Humans grade the result. Both gates close before merge.
Repo layout, CI, and ESLint wiring for these paths live on /implementation, not repeated on every tenet.
Counter-argument
The honest steelman is that approval gates kill velocity. If the agent can write, run, and self-grade a feature in three minutes, a human-in-the-loop approval step adds twenty minutes of latency and converts the agent from a peer into a typewriter. Cognition's Devin and its imitators bet the other way: full autonomy with retroactive review. Karpathy himself says vibe coding is fine for prototypes and personal tools, and that agentic engineering is what serious teams need.3 For high-volume, low-stakes work (lint fixes, dependency bumps, scaffold files, throwaway scripts) the four-move loop is overhead the work does not earn.
Counter-argument retort
The velocity argument concedes the rule for everything that matters and asks for an exception on the work that doesn't. The exception is fine and the rule still stands.
For high-stakes change (production code, schema migrations, public-API surface, anything a customer or a colleague depends on) the loop is not overhead but the cheapest way to catch the failure mode the agent cannot catch on its own. Plausibility is the failure mode, not capability. The agent will type fluent code that compiles and passes its own tests and is wrong. The only place a human can stop that before it goes out is the approval gate. Cognition's Devin demos read like demos for the same reason vibe-coded weekend hacks do: the loop closes only at the end, after the bad assumptions are baked into the tree.
For the low-stakes carve-out (throwaway scripts, scaffolds, mechanical refactors, lint fixes) the loop compresses, it does not vanish. The plan is one line in the prompt (“run the codemod against everything under src/components”). The approval is the same prompt. The review is reading the diff before commit. Three of the four moves still happen. The discipline survives in compressed form because the failure mode survives in compressed form: a confidently typed mechanical refactor that touches the wrong files is harder to undo than the change it was supposed to make.
The same argument that P2 Spec-First Execution makes for humans: the loop is not a tax on velocity, it is the velocity. A plan you can read in two minutes saves an hour of unwinding the wrong implementation. The same is true with an agent in the seat: more so, because the agent can do that hour of damage in the time you spent reading the prompt.
Notes
- [1]Andrej Karpathy: Software 3.0 / Sequoia Ascent 2026 fireside chat and adjacent talks. Karpathy presents the agent failure mode as plausibility, not capability: his own agent matched Stripe purchases to Google accounts by email address, “plausible code, but bad system design”.
- [2]Anthropic / Armin Ronacher: Claude Code Plan Mode (Shift-Tab twice). The agent reads files and proposes a plan but makes no edits until you approve. Documented in code.claude.com/docs and analysed by Armin Ronacher in “What Actually Is Claude Code's Plan Mode?” (December 2025).
- [3]Andrej Karpathy: “Language models automate what can be verified.” The autonomy slider, the generation-verification cycle and the distinction between vibe coding and agentic engineering all sit in the same Karpathy talk and adjacent essays.
- [4]Anthropic: Building Effective Agents (December 2024). Names the evaluator-optimizer pattern: one LLM call generates, another evaluates, the loop repeats until the artefact passes grading. Direct architectural source for the four-move loop.
- [5]Anthropic: Effective Context Engineering for AI Agents (September 2025). Context is a critical but finite resource: the main agent coordinates with a high-level plan while subagents work in clean context windows, and structured notes track progress across complex tasks.
- [6]Cursor: Cursor docs: Plan Mode. Shift+Tab from the chat input rotates to it; the agent researches the codebase, asks clarifying questions and writes a plan you can edit before it builds. Same loop, different surface.
- [7]LangChain: LangGraph documentation: the Workflows and agents guide builds prompt chaining, orchestrator-worker and evaluator-optimizer loops from the graph API, with an orchestrator that generates a plan and a worker for each section of it. The four-move loop has industrial implementations across the major orchestration frameworks.