Careless
by Design

AI with Zero Bugs in Ugly Code

Speed limits didn't track
engine improvements.

They tracked braking improvements.

Curves require vigilance.

Better brakes let drivers brake later.

"Better brakes don't just let you stop.

They let you stop caring about stopping."

work-toil became vigilance-toil.

Watching closely enough that nothing goes wrong is still toil. More stressful. Less interesting.

"Keeping the lights on"

Brownfield teams have been here for years.
No AI required.

vigilance toil

Vigilance Toil
throughput
× amt to protect

Greenfield: protect ≈ 0.
Brownfield: protect is large.

In brownfield, vigilance > work already.

AI multiplied the problem.


Work toil down 75%
=> 4x more events
=> 4x more Vigilance Toil.

AI cuts work, raises total cost.

Minions Orchestration Ecosystem

  • Movement-based branching
  • Risk-aware commit notation

Find key moments in a transcript

A daily coaching workflow. Six transitions follow, each silencing one specific vigilance question.

Step 0 · Prompt Claude and watch

Command

claude — full daily prompt (click to expand)
▐▛███▜▌   Claude Code v2.1.117
▝▜█████▛▘  Sonnet 4.6 with medium effort · Claude Max
  ▘▘ ▝▝    D:\coaching-clients\

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯ I am working with my current client, redacto. We just completed a day's training session. Today with day 03 of
  series 01. I need to start working on the lesson plan for tomorrow and write a status email for today. To get
  started, I need you to do the following.
  1. Use your fireflies MCP tool to get today's transcript. It will be too large to read into context in one step, so
  it'll get written to a file by the tool. Move that file to
  `clients////inputs/session-transcript.md`.
  2. I downloaded the retro notes. They are in my Downloads folder. Move them into inputs as well.

  /clear
            
▐▛███▜▌   Claude Code v2.1.117
▝▜█████▛▘  Sonnet 4.6 with medium effort · Claude Max
  ▘▘ ▝▝    D:\coaching-clients\

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯ I am working with my current client, redacto. We just completed a day's training session. Today with day 03 of
  series 01. I need to start working on the lesson plan for tomorrow and write a status email for today. Our first step is to understand what happened.
  1. Read `clients////inputs/session-transcript.md` and `/retro.md`.
  2. Interview me in the style of Arlo Belshee + Tricia Broderick. Ask one question at a time, and use the info you learn to fill in your understanding. Ask until you understand enough to record what happened.
  3. Write down your insights at `clients////intermediate/key-moments.md`. Gather the information that we need in order to do lesson planning and create the status email.

I do

  1. Run Claude with the prompt.
  2. Watch every step and interrupt when something looks wrong. Get the transcript.
  3. Remember everything that happened today and answer questions until I think it understands everything important.
  4. Check and refine the key-moments.md result.
Result · intermediate/raw-data.md
(click to load)

Step 1 · Written workflow

Command

Read `workflow/find-insights.md` and follow it.

I do

  1. Start the workflow. Follow the steps it guides me though.
  2. Answer the interview.
  3. Analyze the result. Modify the workflow to address problems that I see.
  4. Think through how much work it took from me and what as useful. Modify the workflow to address problems that I see.
  5. Do the downstream steps and identify the useless info that we generated. Modify the workflow to stop generating it.
Output · workflows/raw-data.md
(click to load)

Step 2 · Narrow goal

Command

Read `workflow/find-insights.md` and follow it.

I do

  1. Workflow gives Claude the narrowed goal: "find key moments."
  2. Stop interviewing about everything. Answer only to fill gaps.
Output · intermediate/find-key-moments.md
(click to load)

Step 3 · Document iteration pattern

Command

Read `workflow/find-insights.md` and follow it.

I do

  1. Start the workflow. Follow the steps it guides me though.
  2. Review the guess it gave me.
  3. Give a word vomit about my initial response and other stuff that reminded me about.
  4. Answer specific questions to target the info we need.
  5. Do document review with @ai: commands in the doc.
  6. Do the same improvement cycle stuff.
Output · intermediate/find-key-moments.md
(click to load)

Step 4 · pnpm do-today

Command

pnpm do-today

I do

  1. Run the script.
  2. Let deterministic code decide the next step.
  3. Answer the AI's questions.
  4. Stop the session when I think it is done enough.
  5. Review results.
  6. Run pnpm do-today again to start next step.
Output · intermediate/find-key-moments.md
(same as before)

Step 5 · Scripted fetch

Command

pnpm do-today

I do

  1. Wait until it calls for my attention verbally.
  2. Only visible change: it doesn't ask me to confirm its guess before downloading.
  3. On failure, look at what Claude was handed and what it returned.
  4. Engage with interview.
  5. Review results.
  6. Run pnpm do-today again to start next step.
Output · intermediate/find-key-moments.md
(same as before)

Step 6 · Iterative analysis

Command

pnpm do-today

I do

  1. Do something else until it says it has an analysis ready.
  2. Answer its refinement questions.
  3. Review results.
  4. Run pnpm do-today again to start next step.
Output · intermediate/analysis.json
(click to load)

Example 1

Movement-based branching tool.

Risk-aware commit + branching
Changed
tool
Metacognition
⬇️
Work Toil
Vigilance Toil
Did the AI pick the right risk code? Will the branch land cleanly? Is history readable?

Example 2

Find key moments

Written workflow
Narrow goal
Doc iter pattern
pnpm do-today
Scripted fetch
Iterative analysis
Changed
workflow
goal
workflow
invocation
invocation, goal
feedback, workflow
Metacognition
⬇️
⬇️
⬇️
⬇️
Work Toil
⬇️
⬇️
⬇️
⬇️
Vigilance Toil
Am I remembering to gather the right info?
Is AI over-working or taking shortcuts?
Is the AI taking the right next step?
Did the AI get the right input?
Is the output complete or misleading?

vigilance toil

Vigilance Toil ∝
throughput
× amt to protect
× cost to protect

We control the protection cost factor by building systems.

Where vigilance toil comes from

Vigilance toil = defects you have to worry about.

Two kinds of engineer

App / Lib Dev
Tool Builder
Scope
My app / lib
My customers (developers)
Goal
Make my code defect-free-enough
Reduce total developer toil
Strategy
Find and fix defects before they pile up.
Control the rate at which even careless devs create defects.

If your AI is one of the developers, you are the tool builder.

Make even crappier AI succeed.

How?

Be a Tool Builder

  • Assume a well-intentioned but careless engineer.
  • Change the universe.
  • Reduce creation rate of one error category.

The agent's universe

Vigilance toil Work toil
Memory What it believes happened in prior turns.
Reachable Context What it can find.
State control The map between agent outputs and real objects.
Goals How narrowly the task is scoped.
Tooling What's in the toolbox.
Workflow How we interleave deterministic code calls and agent calls.
Feedback What signals it gets back about action outcomes.
Identity Which agent or persona.
Adjacency Who's watching live.
In-turn messages Talking during a turn.

Safety Categories

Hope Vigilance Probabilistic Deterministic Prevention Carefree ship unreviewed accept raw LLM output watch every keystroke read every generated line manual QA + checklist sampled prompt-evals unit tests schema validation type system no edit-file (AST only) IDE rename refactor version-aware migration errors slip through errors structurally impossible App / lib devs live here Tool builders live here COGNITIVE LOAD — vigilance toil over time Silent failure Watch always Background worry Focused watch Zero Frees attention

The recipe

Engineering carelessness

Pick one to explore

Goals

Status email as structured spec Consistency violation

Tooling

Movement-based branching Policy enforcement
AST-only refactoring Accidental behavior change

Workflow

Transcript fetcher Oversight gap
Dev inner loop control Phase bleed in TDD

Feedback

Commit tool as quality reviewer Smelly code slips review
Required demo + verification Looks done, isn't

Memory

Delete completed stories Decision inconsistency

State control

Archive table for migrations Data loss

Reachable Context

Monorepo isolation Cross-package contamination
Multi-phase re-design Skip past the intermediate
Vector code search Findability gap
Plan optionality Premature option lock-in

Worked example — three iterations

Extract PaymentService from OrderProcessor

your customers

Manipulating Coding Agents

Synthesis

Closing sequence

Scan to open this deck scan for the deck

Discovery during demos

Vigilance cost:
Decision inconsistency

"Does this contradict a decision from earlier in the session? Are we building on conflicting assumptions?"

Main Levers: Memory + Reachable Context

  • Delete completed stories entirely (don't mark done)
  • Rewrite all future stories to reflect the current direction
  • Clear agent context or rewrite session history

The AI cannot blend old ideas with new ones.
It has no access to old ideas.

This direction was always the plan. It doesn't know otherwise.

Name the experience

Scope

Cross-session decision inconsistency.

Cost to protect

Zero: conflicting decisions are structurally impossible.

Lever

Memory + Reachable Context.

Recurring structured output

Vigilance cost:
Consistency violation

"Does this email follow the same structure as last time? Did it include the right sections for day N/10?"

Main Lever: Goals

"json → bullet points".

Claude writes sentences. Deterministic code assembles everything else.

Structure, recipients, rendering: zero-risk zones. Forever.

Name the experience

Scope

Format and structure drift in recurring output.

Cost to protect

Zero. Structure, recipients, and rendering each become zero-risk zones.

Lever

Goals (structured spec).

Structural refactoring in legacy code

Vigilance cost:
Accidental behavior change

"Did my restructuring change what the code actually does?"

AST tools solve this for human developers. What about AI?

Main Lever: Tooling

No edit-file tool.
Only AST transformations.

Design correctness

AI can be wrong.
Undo is as easy as do.

Behavioral safety

Guaranteed by the tool.
Not possible to violate.

Only the first failure mode remains possible.

Name the experience

Scope

Behavior preservation during refactoring.

Cost to protect

Zero within scope. Behavioral safety is guaranteed by the tool.

Lever

Tooling (operation semantics).

Database migrations

Vigilance cost:
Data loss

"Did the migration change what the data means? Can I recover it if something went wrong?"

Main Lever: State control

1. Archive table: all rows preserved before migration runs.

2. Bidirectional remapping: deterministic verification before execution.

3. Extracted library: AI writes the definition; the library executes.

Deterministic pre  →  AI creative decision  →  deterministic execution.

Name the experience

Scope

Schema migrations against live data.

Cost to protect

Zero. Data loss is structurally impossible.

Lever

State control (Determinism sandwich).

Code review under agentic load

Vigilance cost:
Smelly code slips review

"Did the AI land code that's technically correct but full of things a reviewer would flag?"

Main Lever: Feedback

Every commit returns
a structured quality report.

Lint, type, tests, dead code, complexity, missing-test heuristics. Each problem tagged must-fix or could-fix.

The AI sees its own code through the reviewer's filter and re-invokes commit until the report is clean.

The human only sees commits that already passed.

Name the experience

Scope

Known code-quality categories at commit time.

Cost to protect

Zero on those categories. Deterministic checks fire synchronously at the moment of action.

Lever

Feedback (the tool result is the quality verdict).

User-visible work

Vigilance cost:
Looks done, isn't

"Did the AI ship something that looks done and passes tests but doesn't actually work?"

Main Lever: Feedback

  • Required demo. Without one, the plan tool won't advance.
  • Demo verification. A browser walker runs the demo; failures are returned to the coder.
  • Demo walk. I record freeform notes against verified demos only.
  • Note triage. A separate system splits notes into now work and future plan items.

Two timescales. Three actors.
All deterministic.

Name the experience

Scope

"Is this demo-able?" for every user-visible chunk.

Cost to protect

Zero. The plan tool gates advancement on demo verification.

Lever

Feedback (multi-actor, multi-timescale loops).

TDD with an agent

Vigilance cost:
Phase bleed in the inner loop

"Did Claude skip the refactor and shove logic into the test? Write the test after the code? Mix test edits and production edits in the same change?"

Main Lever: Workflow

One workflow, five universes.

A Minions mission orchestrates the sequence. Deterministic code handles commits and chooses the next phase.

  • Plan refactor: read-only tools. Output: a refactor plan.
  • Apply refactor: AST tools only. Loop until the plan is empty.
  • Write the test: only test files writable.
  • Make it pass: production tree writable; test files read-only.
  • Remove duplication: AST tools again. Same loop, different refactor goal.

No single Claude call can do TDD wrong
because the wrong move isn't in its toolbox.

Name the experience

Scope

TDD discipline across one feature's inner loop.

Cost to protect

Zero. Phase bleed is structurally impossible at each boundary.

Lever

Workflow (phased mission; tools and writable surface change per phase).

Brownfield monorepo

Vigilance cost:
Cross-package contamination

"Did my change to package A silently alter package B?"

Main Lever: Reachable Context

Shrink what the agent can see to exactly what its task should touch.

  • Other packages: only API types and factories are reachable. No implementation.
  • This package's adapters and ports: reachable. The agent can choose to alter how it relates to others.
  • Refactoring tools span both sides, but only when the API is internal to the monorepo.

The agent can use other packages correctly. It cannot silently change them.

Name the experience

Scope

Cross-package change inside a monorepo.

Cost to protect

Zero. Other packages' implementations are not in the agent's reachable surface.

Lever

Reachable Context (API-only exposure across the boundary).

Multi-phase migration

Vigilance cost:
Skip past the intermediate

"Did the AI optimize for the eventual shape and skip the partial-progress state I asked for?"

Main Lever: Reachable Context

Truncate the horizon to the next durable resting point.

  • Design the endpoint, then design Phase 1 as a fully working partial state.
  • During Phase 1 execution, hide the endpoint from reachable context.
  • The agent sees Phase 1 as the final destination. It cannot helpfully jump ahead.
  • Apply recursively. Each scope has its own destination; none can see further.

Premature optimization for the wrong target becomes structurally impossible.

Name the experience

Scope

Multi-phase re-design with intermediate landing states.

Cost to protect

Zero within the current phase. Future phases simply do not exist for this execution.

Lever

Reachable Context (horizon truncated per phase).

Findability in legacy code

Vigilance cost:
Findability gap

"Did the AI miss the relevant code because grep wasn't the right way in?"

Main Lever: Reachable Context

Expand the reachable surface in a direction that matches how the agent asks questions.

  • Pre-compute a summary for each class and method.
  • Load the summaries into a vector database.
  • Add a search tool that queries the vector DB and is preferred over grep.

The agent can find code by intent, not just by literal token. "Did it miss anything?" shifts from often-yes to occasionally-yes.

Name the experience

Scope

Code findability across a large codebase.

Cost to protect

Reduced, not zero. Semantic search complements lexical search; misses get rarer.

Lever

Reachable Context (a semantic index added to the agent's reach).

Planning under uncertainty

Vigilance cost:
Premature option lock-in

"Did the AI lock in on the first plausible option without exploring the space?"

Main Lever: Reachable Context

Hide the comparison from the agents being compared.

  • The plan lives in source control via a plan MCP tool. An "options" node says: brainstorm here.
  • The tool spawns one probably-wrong branch per option, replacing the node with a commitment to that option.
  • The branches run in parallel. None knows it is one of several. Each believes its option is the plan.
  • After they terminate, failures drop out. We combine the best of the survivors.

Each branch executes one option as well as it can, because alternatives are not in its reachable context.

Name the experience

Scope

Plan-time option exploration across uncertain design space.

Cost to protect

Zero. Option exploration is structural; per-branch focus is total.

Lever

Reachable Context (alternatives hidden per branch).

What we did each time

We didn't ask for more care.
We redesigned the world.

Memory  ·  Reachable Context  ·  Goals  ·  Tooling  ·  Workflow  ·  State control  ·  Feedback

Each choice created a zero-risk zone. Each zone permanently freed vigilance budget for the next thing.

vigilance toil

Vigilance Toil
throughput
× amt to protect
× cost to protect

Vigilance toil is the cost of having to worry about whether you can stop.

engine

AI

Throughput and skill.

brakes

Universe

Careless AI still succeeds.

"Better brakes let you stop caring about stopping."

Recipe — Step 1

Apply the vigilance-as-process template

  1. Pick the scope where carelessness will apply.
  2. Stand up an empty guardian slot in your workflow.
  3. Stand up a one-step workflow: in → agent → out.
  4. Write down today's vigilance expectation list — everything you currently watch for.
  5. Stand up an empty spot-checker. Cover nothing yet.

Worked example — extract PaymentService

Setting up the loop

  • Scope: extract PaymentService from a 4 000-line OrderProcessor.
  • Guardian slot: empty behavior-equiv-check stage in the extract pipeline.
  • Workflow: agent extracts → run guardians → run spot checker.
  • Vigilance expectation list: behavior change, transaction-boundary moved, error path swallowed, observability lost, hidden side effect on inventory, mocked-test fragility, thread-safety change.
  • Spot-checker: empty.

The loop is standing. Time to pick what to attack first.

Recipe — Step 2

Select costly vigilance from expectation list

  1. Read the vigilance expectation list, and pick the one that happens most often + the one that is hardest to verify.
  2. Pick whichever of those causes you the most pain. That is the category you will try to silence this loop.

Worked example — extract PaymentService

What hurts most per extraction run

  • Behavior change — every diff needs full read of moved code and callsites. Highest cost.
  • Transaction-boundary moved — need to inspect @Transactional spans.
  • Observability lost — need to scan for vanished log/metric calls.

Selected: Behavior change.

Recipe — Step 3

Run spot-checker to surface an example hole

  1. Run the current spot-checker on a fresh agent output that passed your guardians.
  2. Anything it finds = an example hole. Write it down concretely.
  3. If it found nothing, then do a manual review.
  4. What you caught but it missed = an example hole. Write it down concretely.

Worked example — extract PaymentService

A hole in behavior preservation

  • Spot-checker is empty, so it finds nothing.
  • Manual review caught: a try/catch in OrderProcessor.refund() swallowed a StripeException; the extracted version re-throws it.
  • Hole: exception-handling shape changed during extraction. Behavior diverged at the error path.

Recipe — Step 4

Apply a lever to prevent one error category

  1. Take the example hole and generalise it to its category.
  2. Choose a universe lever that structurally prevents that whole category. If you can't, then choose a guardian lever that will guarantee detection.
  3. Implement the change. Re-run against every prior failure case to confirm.

Worked example — extract PaymentService

Locking behavior change with Tooling

  • Lever chosen: Tooling.
  • Pull edit-file out of the toolbox. Hand the agent an AST extract-method-to-class transform instead.
  • Behavior preservation is now guaranteed by the transform — including exception shape, control flow, side effects.
  • Verification: 0 of 12 prior behavior-change cases reproduce.

Recipe — Step 5

Adjust vigilance expectation list

  1. Strike the locked category off the expectation list, or narrow it to just what you have to be vigilant about now.
  2. Add any new categories to the expectation list that this uncovered.
  3. Re-cost the remaining categories — the cheap ones may now dominate.
  4. Loop back to step 2 with the updated list.

Worked example — extract PaymentService

The expectation list shrinks

  • Behavior change — locked by AST refactor.
  • Transaction-boundary moved — now top of the list.
  • Observability lost — cheap to attack via a "no orphan log" lint; queue after.

Next loop: select transaction-boundary preservation.

Recipe — Step 6

Manually choose whether to accept or reject this work product

  1. Inspect the actual artifact the agent produced this run.
  2. Decide: ship it or revert it and re-run another loop inside the safer universe.
  3. Record the residual risk profile of whichever you chose.

Worked example — extract PaymentService

Three loops later

  • Universe catches: behavior change, transaction-boundary moved, orphan logs.
  • Residual: design correctness of the new PaymentService seams — still at Vigilance level.
  • Decision: accept this extraction. Residual is bounded, named, and visible.

Vigilance about behavior, transactions, and observability is gone, permanently.

Worked example — extract PaymentService

Three loops of the recipe

Same scope. Same expectation list, shrinking.
One category gets locked per loop.

Iteration 1

Selected vigilance: Behavior change

Spot-check

Diff OrderProcessor.refund() against extracted version; trace every exception path.

Categories surfaced

Exception shape changed. Side-effect order changed. Return type widened.

Lever applied

Tooling. Remove edit-file; require an AST extract-method-to-class transform.

Outcome

Behavior change locked — structurally impossible within the transform's scope.

Iteration 2

Selected vigilance: Transaction-boundary moved

Spot-check

Diff the call graph reachable under each @Transactional annotation, before vs after.

Categories surfaced

Transactional method moved out of its enclosing span. Nested transaction created where there was none.

Lever applied

Tooling. Extend the refactor to refuse moves that break transactional scope; surface the violation as a structured error.

Outcome

Transactional-scope drift locked at the structural level.

Iteration 3

Selected vigilance: Observability lost

Spot-check

Set difference on log statements and metric names; trace-span boundary comparison.

Categories surfaced

Log lines silently dropped. Metric counter renamed without alias. Trace span collapsed across the seam.

Lever applied

Tooling + Feedback. Add a "no orphan log / no orphan metric" lint as a commit gate; pipe its result back to the agent before it tries again.

Outcome

Observability loss locked. The agent self-corrects before commit.

Three loops in

What's still on the list

  • Behavior change. Locked (Tooling).
  • Transaction-boundary moved. Locked (Tooling).
  • Observability lost. Locked (Tooling + Feedback).
  • Hidden side effect on inventory. Next loop.
  • Mocked-test fragility. Cheap; queue after.
  • Thread-safety change. Defer until cost rises.

Every extraction now ships with three permanently-free categories.

Between agent turns: two different agents

Agent 1 Agent 2 Transform verify, archive, commit results Select next step any deterministic or non-deterministic Define request narrow / re-shape the next request Curate memory edit session file, then new, resume, or fork Pick agent swap agent, LLM, or system prompt TURN N TURN N+1 Tool deterministic action feedback Real world Workflow files Code files Other files Source control Foreign systems

Between agent turns: two different agents

Agent 1 Agent 2 Transform verify, archive, commit results Select next step any deterministic or non-deterministic Define request narrow / re-shape the next request Curate memory edit session file, then new, resume, or fork Pick agent swap agent, LLM, or system prompt TURN N TURN N+1 Tool deterministic call result Real world Workflow files Code files Other files Source control Foreign systems State control Workflow Goals Memory Identity Tooling Feedback Workflow Reachable Context State control Not useful for vigilance toil • System prompt • Skills • Interrupting mid-turn • Agent identity • LLM choice
← → Space  ·  T = TOC