Field Notes · from real builds

Field Notes

Real lessons from building and running AI systems — every one a mistake I actually made, turned into a rule so I don’t repeat it. These are the receipts behind the one-line rules on the Tips page; the interactive deep-dive (the 7-rebuild story) lives in the Prompt Lab. Tap any card for the story.

Get better output
Verbalized sampling beats mode collapse
For open-ended generation, ask for several candidates each tagged with a probability, then pick from the low-probability tail.

Asking directly for “the best option” returns the most typical, generic answer — aligned models keep only ~24% of the base model’s diversity, vs ~67% with this technique. Only for creative work, never facts, code, or math.

How: generate N candidates, require each one’s self-estimated probability under 0.10, then choose the lowest that still clears a quality bar.
One through-line, many lenses
When several AI personas discuss one topic, give them ONE shared thesis to argue from different angles — not five separate takes.

Each persona made a true but different point, so the piece had five lenses and no spine — and the drift was felt even though every point held up alone. Write the thesis in one sentence first; every contribution must deepen it, not argue a new point about the same topic.

Delegate & orchestrate
Synthesize, don’t transcribe
When a subagent returns research, don’t hand back its bullets — that’s transcription, not thinking.

Returned a 3-bullet summary and got “I don’t think you’ve done enough thinking about this.” Work out which findings contradict what you’ve built, which expose a wrong number, which don’t actually apply, and the one thing they prove wrong.

What happened: a deeper pass found a cost constant was 5× understated and the target market structurally unwinnable — neither showed up in the first summary.
Orchestration is the spectacle
In a live AI demo, the audience experiences the visible orchestration, not the file edits.

Sequential single-agent builds look slow on screen even when they’re fast, and silence during runtime reads as “broken.” Pre-stage research into files, engineer the prompt to force visible parallel subagent dispatch, and script 60–90s of narration for the beat where agents work silently.

What happened: a 90s demo with visible parallel agents played far better than an objectively faster 60s sequential build.
Find your own secrets first
Before asking for any key, token, or config value, search for it yourself — then only ask after exhausting the obvious sources.

Repeatedly asking for values already sitting in a local config file or CI secret store. Check dotfiles, secret stores, config files, and docs before asking — and when you do ask, name exactly what you already checked.

Watchers can match themselves
Never poll with until ! pgrep -f "script-name" — the watcher’s own command line contains the keyword, so it matches itself and never exits.

Stacked watcher loops each kept their own successor alive forever. Use the runtime’s built-in completion notification, or poll a sentinel file the target writes on finish — never a process-name grep that can match the watcher itself.

Parallel agents are a budget decision
Before fanning out several of the most capable agents at once, say roughly what it will cost and ask.

A long session launched about eight top-tier subagents in parallel, copy writers and fact-checkers among them, without ever stating the cost. Moving up a tier was justified, because a cheaper draft had about 30 errors, but the fan-out itself was never priced. Now the rule is to cap the spend before launch: ask before more than about two top-tier agents or any fan-out likely to pass about 500K tokens, and if an agent fails on a spend limit, stop launching and finish with free local checks.

What happened: several agents ran at 200K to 320K tokens each, and two reviewers died mid-run on the monthly spend limit, which stalled the work until it reset. A direct read of 24 pages found the 20 real issues for a fraction of the cost.
The report is not the evidence
Give every task a fresh reviewer that reads the code, because the implementer’s own report is not proof the work is right.

Each task went to a new implementer (a fresh agent that builds the task), then to a reviewer that did not write it: the spec first, code quality second. Fresh context catches what the one directing the work misses, and two stages stop the wrong thing being built well.

What happened: a reviewer reading the code caught a comment in a public repository that cited a private planning document by number, a reference no outside reader could resolve. A rule against citing a plan in a comment was then added to the checklist the builder is given.
Silent failures kill quietly
Integrations die silently
A webhook can go dead — deleted, revoked, restructured — and nothing tells you. Health-check it yourself.

A webhook returned “not found” for an unknown span while several jobs and a smoke test pointed at it — none alerted, because each caller only checks its own success. Treat “job succeeded but no one heard” as its own failure class, and periodically ping every endpoint directly.

Never git push || true
Suppressing a push failure shows a green pipeline while the output never lands anywhere.

A self-push used a token that silently lacked write access; the || true hid the 403 for weeks. Let consequential steps fail loudly; if a push is genuinely best-effort, log the failure visibly — and verify the token scope on any self-push.

What happened: discovered only because a downstream consumer couldn’t find the day’s output.
Model IDs deprecate without warning
A model string can be silently retired — the call shape stays valid but returns “not found,” and generic error handling masks it.

A daily pipeline lost its output when the provider deprecated a pinned model; the exception logged as a generic LLM failure. When expected output goes missing, check the model constants first; prefer “-latest” aliases over dated strings.

What happened: a morning pipeline silently lost a day’s output; fixed with a same-family bump, verified with a live call before declaring it fixed.
SystemExit escapes your safety net
sys.exit() raises SystemExit, a BaseException — so a plain except Exception guard does NOT catch it.

A “never crashes” wrapper let a helper’s sys.exit(1) on a missing dependency kill an entire multi-worker run, while a separate error-swallowing pattern hid it behind a green status for days. Catch (Exception, SystemExit) together; don’t let library code call sys.exit at all.

What happened: a silent sys.exit took down a multi-agent daily run for three days while status reported success.
Every LLM call needs its own fallback
A shared provider fallback chain isn’t enough — every call site needs its own try/except, or one bare call is a single point of failure.

A summarization step called the LLM helper bare; when every provider was exhausted at once, that one unguarded call crashed the whole downstream pipeline. Wrap every call site and degrade gracefully — proceed with fewer inputs rather than let the exception propagate.

A job nobody schedules never fails
A job with no scheduler entry cannot fail, so it never alerts: it just never runs.

A complete weekly job sat in no scheduler, no crontab and no workflow. The audit built to catch dead jobs only inspected workflows that already had a schedule block, so it could not see this one, and a log that said a job was “built” was only an assertion. Audit from the other side: for each script, find the line that actually invokes it, and check that the hit is a real invocation and not a comment that mentions the name.

What happened: a record of news items was 58 days behind and a log of published videos was missing 176 entries. It was found only because someone asked how current the records were.
A duplicate job key runs nothing
A workflow file the CI service cannot parse creates no run, so nothing goes red.

A scripted edit spliced text at an anchor that appeared in two jobs, which duplicated an entire job. The local YAML parser accepted it, because it allows duplicate keys and keeps the last; the CI service refused it with an HTTP 422. Edit by step name and bound the block by indentation, and run a checker that enforces the service’s duplicate-key rule before every commit that touches a workflow file.

What happened: it surfaced only because someone tried a manual run; otherwise the next scheduled run would not have happened and nothing would have said so.
Check where it lands
Check the artifact where it has to land, not where the work started.

A backup job showed green while the destination received nothing, because a pipe into tee made the step report tee’s exit code and the script printed a failure and then returned normally. Read the destination (latest commit date, file count and bytes) before calling a backup healthy. The same holds for a rename: grep config and string literals, not just identifiers.

What happened: the backup was green for nine consecutive weeks, and a 5.1 GB local copy was recommended for deletion on the strength of the checkmark; checking the destination before deleting is what saved it. A rename commit claimed to be complete while the old name remained on the tray menu, the tooltip, the installer metadata and a network user agent.
Running real systems
Fix the generator, not the output
When a generated page or report has a bug, fix the generator — patching the output file means the fix vanishes on the next run.

Hand-patched a live generated page; the fix disappeared on the next scheduled regeneration because the template was never touched. Cap and validate at the point of generation; treat bulk “fixer” scripts as a safety net, not the primary defense.

Fallback order is a budget decision
The order of providers in a fallback chain is capacity planning — which quota you’re willing to spend first.

A morning automation burned one provider’s entire daily quota partway through its run because it was listed first, starving the capacity needed for interactive daytime use. Order by which quota to burn versus protect, not by preference.

Renaming an agent touches everything
Renaming an AI persona is a cross-system refactor, not a find-and-replace.

Every place the old name lives — data schema, pipeline code, bot config, public pages, docs — has to move together or the live product goes inconsistent. Treat it as a feature branch with a dependency map, and migrate additively (add the new name, migrate, then drop the old).

What happened: a single persona rename touched 26+ files across 6 systems before the product was consistent again.
A chat timeout is not a document timeout
A time limit tuned for chat replies will cut off structured documents that take longer to generate, so give each kind of call its own limit.

A shared model-call limit suited chat, where failing fast is the point. Calls that write a full report generate about 3KB of JSON and take longer, so they now pass their own limit per call while chat keeps the short one.

What happened: the chat limit was 15 seconds and report generation measured 12 to 20; the document calls now carry a 35 second limit set per call.
A fast path that deletes
A deploy that replaces the whole site is a full snapshot, so a quick build that skips steps deletes whatever those steps produced.

A quick build mode skipped the steps that generate the taxonomy pages. Those outputs were not committed, so a clean CI checkout had none of them, and the deploy replaced the whole site with what was built. Keep the quick mode manual only, and gate every build: block it if the sitemap lost a section or shrank by more than 5%.

What happened: a change that built quick on every push shipped 828 HTML files against 43,287 in a build two days earlier. About 42,000 pages returned 404 in production until the change was reverted the next day.
The guard that was removed on purpose
Prefer protection that cannot fail open, and remember that a pattern-matching guard stops accidents, not intent.

A pattern-matching guard was installed and verified, and it failed open: if a dependency or its patterns file was missing, it silently allowed everything. So it needed a chain of watchers just to notice it had stopped working. Protection built into the agent tool itself has no dependencies and cannot fail open. A guard of this kind protects against accidents and is not a security boundary.

What happened: the watcher chain reached nine moving parts. The guard and its watchers were removed the same day they were installed, a deliberate step down to the built-in protection.
Measure before you automate
Ask “where’s the verifier?”
Before wrapping any task in an autonomous loop, ask for the crisp pass/fail check — not “should we automate this?”

“Agentic loop” framing gets pitched for taste-driven work (design, copy, angles) where “done” is subjective. Only loop mechanical work with real exit codes; for judgment work, write an actual verifier or admit it needs a human.

Loop-worthy: schema audits, data backfills, render pipelines. Not: scripts, design, copy.
The optimism cascade
An edge that only survives the most optimistic fill assumption is a spreadsheet, not an edge — model execution reality first.

A market-maker built state machines and kill switches before the one honest test: a queue-aware fill simulation. Build the cheapest test of the load-bearing assumption first, before the machinery around it.

What happened: the same strategy produced three numbers as optimism peeled away — +$814 (every quote fills) → +$149 (real taker volume only) → −$405 (queue drainage + one-sided fills + fees).
A gate that blocks profit
A filter that stops 100% of losses but also 90% of profit isn’t a good gate — track what it rejects, not just what it passes.

A confidence floor built to prevent losses was shadow-tracked against the bets it filtered out — it was killing the most profitable bet type. Position-aware thresholds beat one universal floor when win rates are asymmetric.

What happened: a single 85% floor gave a 97% hit rate but 2.3% ROI; loosening one segment to a 60–74% band gave a 55% hit rate but 7.6% ROI.
Data velocity beats domain expertise
For a prediction system, pick the domain with the most repeating, fast-resolving, genuinely-uncertain events — not the one that feels on-brand.

The instinct was the on-brand domain; the data showed another had far more markets near real uncertainty resolving fast. Optimize for volume of training examples and speed of feedback — one-off events teach a model nothing repeatable.

What happened: one domain had 98 markets, 7 near 50% confidence; another had 465 markets, 253 near 50%, 382 resolving within the week. The pivot followed the data.
Shelve by choice, not defeat
Walking away from a sunk cost on pre-registered criteria is a discipline win — don’t confuse “we could grind a few more dollars” with “worth our attention.”

After four months and two strategies, the honest framing was “we can make a few dollars, but not at the cost of focus.” Pre-register shelve criteria and dates before you start; when “this is the real shot” fires three times in a row, the problem is structural, not parametric.

What happened: shelved with zero real dollars ever at risk (paper-only throughout), gates pre-registered weeks ahead, and a public autopsy published with no revisionism.
Measure the claim on your own transcripts
Before adopting a tool that promises to cut context waste, measure how much of that waste your own sessions contain.

Fourteen days of a coding agent’s own session transcripts were measured before anything was installed. The measurement confirmed the problem was real and also named the first move, which needed no new tool: pipe shell output through head, grep or jq, read files with an offset and a limit, delegate broad sweeps to a search subagent, and measure again in a month.

What happened: across 58 transcript files, text tool results totalled 32.6M characters, about 8.1M tokens: shell output was 51%, file reads 26% and web search 6%, roughly 4M tokens of shell output alone.
Ship honestly
Label what’s canned vs live
When a demo mixes live inference with scripted responses, mark which is which — don’t let a hardcoded reply pass as a live agent.

A multi-agent chat had several personas answering from canned scripts (no model call at all) alongside one genuinely live backend. Architect and disclose the boundary between “live” and “performed” explicitly, rather than letting the UI imply everything is equally live.

Own the pre-work, don’t fake it
Pre-staged research in a live demo is fine — but never claim work happened live when it didn’t.

A live-build demo pre-loaded reference files the agent read in seconds and acted on as if researching from scratch. If asked “did this happen live?”, point honestly to the pre-work stage — legitimate staging is the trick, not deception. Being upfront is more credible than false spontaneity.

No model supplies the number
When a report shows a score, compute it from the reader’s own inputs and print the arithmetic, so the number is checkable.

On a guided assessment, placement and score are computed in the browser from the person’s own answers, and the arithmetic is printed on the report. As a second guard, the backend strips any score, level, rating or stage field from every model response. The point is that the number can be checked.

What happened: the scoring was built in three parts worth 35, 35 and 30 points, and one of the 35-point parts can only be earned with a verifier. Without it the ceiling is 65, so the top band, 75 and above, could not be reached; that fell out of the arithmetic, with no special case coded.