๐ŸŽฌ AI Engineering
Module 1 ยท Part 1 ยท The AI-Engineering Way of Working

Using Coding Agents โ€” the Actual Loop

Drive Claude Code through a complete frame โ†’ plan โ†’ approve โ†’ build โ†’ review โ†’ test โ†’ commit loop, scaffold THG Radar, and learn when agents shine vs. when they wreck things.

spine step: scaffold THG RadarD2 Spec Simulator10-question quiz ยท pass 8/10

ยง1 ยท You are the director, not the typist

A coding agent is an unusually fast, unusually literal engineer. It will build exactly what you said โ€” which is rarely exactly what you meant. Your job splits cleanly:

You ownThe agent owns
Frame โ€” what & why, constraints, non-goalsExploring the codebase
Approving the planWriting the code
Reviewing the diff (M3 teaches the 10%)Running mechanical fixes
Deciding to commit / deployDrafting tests

The loop โ€” click each step

Click a step. Green = yours, blue = the agent's.
Every arrow you skip is a place where a wrong assumption becomes shipped code. The loop isn't ceremony โ€” it's where your leverage lives.

ยง2 ยท Plan mode โ€” think before touching files

Claude Code's plan mode is read-only: the agent researches your codebase and proposes an implementation plan, but cannot edit files or run mutating commands until you approve. Shift+Tab cycles permission modes (default โ†’ acceptEdits โ†’ plan). (Verified against code.claude.com docs, 2026-09-03.)

Rejecting a bad plan costs seconds. Rejecting bad code costs a session. Anything non-trivial starts in plan mode โ€” the plan is your first and cheapest review gate.

ยง3 ยท Where agents shine vs. wreck things

SHINE

  • Scaffolding & boilerplate
  • Well-specified small features
  • Tests
  • Migrations drafted for your review
  • Mechanical refactors
  • Explaining unfamiliar code

WRECK

  • Vague specs ("make it better")
  • Security-sensitive code accepted unreviewed
  • Huge multi-concern diffs
  • "Just fix it" on unexplored systems
  • Money / prod data / external sends without a gate

Heuristic: the agent is safest where a mistake is cheap to see and cheap to undo. That's why git commits are your undo button and why steps stay small.

ยง4 ยท Watch it happen: scaffold THG Radar

The spine project starts now. THG Radar = internal tool tracking client integration go-lives (Cloudflare Worker + Hono; D1 and UI come in later modules). Real commands:

mkdir thg-radar && cd thg-radar && git init
npm create cloudflare@latest . -- --type hello-world --lang ts
claude    # start Claude Code in the repo

First prompt โ€” notice it frames, constrains, and states non-goals:

We're building THG Radar: a small internal tool tracking client
integration go-lives. Stack: Cloudflare Worker + Hono, D1 later,
plain HTML UI later.

For now, in PLAN MODE first: propose the minimal scaffold โ€”
a Hono app with GET /health returning {"ok":true} and a static
index page saying "THG Radar". Nothing else.

Non-goals for this session: no database, no auth, no UI framework,
no extra dependencies beyond hono.

Approve the plan โ†’ let it build โ†’ review the diff (git diff) โ†’ test locally (npx wrangler dev, hit http://localhost:8787/health) โ†’ commit:

git add -A && git commit -m "scaffold: hono worker with /health"
Do NOT deploy yet. Deploy is M8's job, behind Zero Trust. Shipping unauthenticated internal tools is how incidents start.

ยง5 ยท Small steps beat big bangs

๐ŸŽ›๏ธ Dashboard: D2 Spec Simulator

Pick a feature, choose a vague vs a sharp spec, and see the plausibly different agent outputs side by side, divergences called out. The lesson: output quality is set before the agent types.

๐ŸŽ›๏ธ Open the Spec Simulator โ†’
  1. Run the ยง4 scaffold for real (or in a scratch dir).
  2. Then deliberately give the vague version: "set up a project for tracking go-lives". Compare the plans. Count the assumptions the agent had to invent.
  3. Reject one plan on purpose and redirect it. Feel how cheap plan-stage steering is.

โœ… Checkpoint quiz

Pass = 8/10 (80%). Unlimited retries; only passes are recorded.

Done with M1? Next: M2 โ€” Shaping the Build (specs, guardrails, review gates).