# Ex-NASA dev reveals his Agentic Engineering Workflow
<!--
ref: @content/youtube/david-ondrej/2026-08-07-dex-horthy-agentic-engineering-program-design
version: 3
updated_at: 2026-10-31T18:16:25.803Z
-->
Dex Horthy (David Ondrej, 2026-08-07): Horthy's position is that the fully hands-off software factory — the one where nobody reads the code — does not work, and he has the scar tissue to say so.
*Synthesized from David Ondrej on David Ondrej, 2026-08-07.*
David Ondrej interviews Dex Horthy of HumanLayer, who coined the term context engineering in the 12-Factor Agents paper and has run agent factories long enough to have watched one fail badly.
## Core Thesis
Horthy's position is that the fully hands-off software factory — the one where nobody reads the code — does not work, and he has the scar tissue to say so. Models are excellent at solving problems and are not trained to write maintainable code, because reinforcement learning has no fast oracle for maintainability. The fix is to spend human intuition early and cheaply, in four design passes before the agent writes anything, rather than late and expensively in review.
## Key Insights
- **The software factory, and what agents actually replaced.** Horthy's frame: the pre-AI loop was issue tracker → human builds → pull request → CI/CD → human review → prod → user complaints → back around, with monitoring bolted on to wake engineers at 3 a.m. The first substitution is agent-builds-the-thing. Building drops from hours or days to minutes or hours; review stays at hours or days. That asymmetry is the whole problem.
- **The old meeting culture was already a leverage play.** Engineers sat in design meetings specifically to spend an hour up front so the PR matched what everyone expected and review took minutes instead of six hours. Agentic engineering does not remove that need — it makes it more valuable, because the build side got fast and the review side did not.
- **Route incidents and support into the factory.** Instead of waking to an alert, wake to a pull request. Triage part of the support queue directly to agents. Horthy's arithmetic: even automating 30% of incidents is enormous, and automating 50% of your work means shipping twice as much. Ondrej describes his own version — GLM 5.2 reviewing every uptime incident and returning a diagnosis ("this is the provider, nothing to do" versus "missing migration, do this"), stitched together with Vercel cron jobs, GitHub Actions, and an agent loop on render.com.
- **The "light software factory" failed for them in July 2025.** They reviewed plans and tickets but stopped reading code. Then they hit a bug in a desktop app they were shipping. The smartest models in council kept diagnosing the wrong cause and shipping fixes that didn't fix it, and the team had to descend into three months of unread, sloppy code for weeks while users were furious. Horthy's thesis: the odds of this happening if you stop reading code are higher than the odds that models get good enough before it does.
- **Ondrej's amendment: it may be logic rather than code.** What you need to hold is the product's actual behavior — what the first five minutes of onboarding does, what happens when someone cancels, what fires on a given endpoint — not necessarily the syntax. Horthy accepts the reframe as "know what the product is." They also prototyped a feature that quizzes you while the agent works, with multiple-choice questions and mermaid diagrams testing whether you still understand the current codebase and what the new implementation changes.
- **Stage 1, product.** What user problem are you solving and how will you measure it. Horthy uses the Amazon move of writing the announcement before the feature exists, plus plain HTML mockups of every relevant view. Explicitly no tech, no architecture, no schemas at this stage. His counter to "the models are good enough now": 20 minutes of back-and-forth here materially reduces the hand-polish and UI rework you file afterwards.
- **Measurable outputs are the highest-leverage thing you can hand an agent.** If you can point at conversion — a number tied to revenue — the agent can run three variants, check the data daily, and pick a winner. Ondrej links this to `/goal`-style loops and to auto-research: make the CUDA kernel faster until you hit a 20% resource reduction.
- **Stage 2, system architecture.** How the services fit together, the flow, new endpoints, new tables, outlines of the queries. Horthy notes most competent teams have already reached this level. He is explicit about when to skip all of it: a pre-product-market-fit startup throwing things at customers to find what they'll pay for should just vibe code. From roughly five engineers up, with paying customers and a six-month maintenance horizon, this is step one — and his clients include publicly traded and Series B+ fintech companies where a broken thing can mean a seven-figure fine.
- **Stage 3, program design — the step nearly everyone skips.** Go one level below architecture: what the call stack will look like, where the files go, the types and method signatures — deliberately not the implementation. He cites Dylan Mulroy at Cloudflare ending plans with the tests and the call stack. The reason to do it now is context economics: these design sessions are token-light (his in-progress example was making real decisions at 43,000 tokens), so you get maximum model intelligence, and once thousands of lines exist the model is both deep in its window and anchored on its own earlier choices. Ondrej connects it to Victor Tali's trick of asking a model which choices it made that it isn't confident about — program design is that question asked before the code exists.
- **Stage 4, vertical slices.** Models build horizontally by default — database, then services, then API, then front end — which leaves nothing testable until thousands of lines are done. Horthy has never seen a model choose vertical slices unprompted. The alternative, which he and Matt Pocock call tracer bullets: mock the endpoint, stub the front end, wire it through, then add migrations, business logic, and error handling. You get something to check at every step, and re-steering is cheap while the code is still small.
- **Why benchmarks don't move him.** SWE-bench-style problems have golden patches of maybe 100–200 lines and grade on whether the human's tests pass. There is no penalty anywhere for bad design. That's why models emit patterns like catching a JSON parse error only to log and rethrow it, or scattering type casts purely to make tests pass. A 99% score tells him the model is better at problem-solving and nothing about whether he can stop reading code.
- **Maintainability has no fast oracle.** RL needs something that can verify correctness in seconds so you can run millions of loops. Tests qualify; architecture doesn't — the cost of a bad structural decision shows up in weeks or months, far too late to backpropagate. His second complaint: every benchmark hands the model the whole problem up front, while real software is discovering the problem as you go. He'd trust a benchmark that feeds a 20-feature roadmap one feature at a time, unknown in advance.
- **Cognition's newer benchmark is directionally better.** Three moves he calls out: an LLM judging whether the model's solution is functionally equivalent to the human's rather than failing it for a different shape; a quality judge scoring the patch against explicit per-language rules; and — the clever one — stripping the model's patch and running the model's own new tests against the pre-patch code, because tests that pass there prove the model wrote tests that test nothing.
- **The suspicion underneath all of it.** If the model could tell good code from bad, it would write good code the first time. Stacking a second frontier model as reviewer raises the floor and catches small things, but everyone is using the same models.
- **Put non-code context into the repo.** Ondrej's practice: `/docs/adr` for explicit architecture decision records (we priced it this way; we never break the API schema, we ship `/v2`), and `/docs/external` for everything outside the code — which environment variables exist (names, not values), how the payment processor is set up, which emails are used for testing, where customers reach support. Horthy's product works the same way: files on disk, with hooks syncing to the cloud, notifying the team, and pulling comments back in.
- **Fetch context deterministically, not with inference.** A session-start hook that pulls the last 10 issues from your error tracker is free — CPU cycles, no tokens, no attention spent on instructions about how to go get context. Save inference for reasoning through the hard problem.
- **Context engineering has aged well because it's physics.** Horthy's central 12-Factor Agents principle is own your context window: everything — RAG, history, memory, prompts — reduces to tokens in, tokens out, and the goal is not more tokens but the right tokens. No wrong information, no missing information, then as small as possible. Down to format choice: XML is more token-efficient than JSON for the same content. Until post-transformer or linear-attention architectures arrive, tighter windows produce better results.
- **The dumb zone, and the midwit curve.** Horthy coined "dumb zone" while training engineers on Opus 4.1/4.5, where quality visibly fell around 100,000–120,000 tokens, roughly half the window; the move was to compact everything into a document and start a fresh session from it. He now regularly runs to 200–300k because the floor keeps rising and compaction improved. The peak of the midwit curve is rigid token discipline; both ends — the beginner who pastes "fix this" with no screenshot and the expert who says "it's in that file, read it and fix it" — beat the person spending 30 minutes crafting the perfect prompt.
- **Context anxiety is real model behavior.** Calvin French-Owen's metaphor: a student who paces themselves through the first half of an exam, then realizes five minutes remain and starts cutting corners. Horthy saw exactly this in Opus 4.5 and Sonnet 4.5 — scrambling, then giving up, as the window filled.
- **Newer models test themselves unprompted.** Ondrej's observation with Fable and the 5.6 family: on medium or large changes they now benchmark cost, speed, and quality across providers using LLM-as-judge without being asked, which the previous generation did not do.
- **There are inefficiencies that are not bottlenecks.** Horthy anchors this on Eli Goldratt's *The Goal*: 1960s–70s factories hired MBAs to maximize each station's utilization, which just piled expensive work-in-progress in front of whatever the real bottleneck was. If code review is your bottleneck, adding coding agents does not help. He applies the same to token-maxing — exhausting your subscription every five hours optimizes a station, not the end-to-end delivery of value. His office joke, aimed at himself after fifteen years of wanting to fix CI instead of shipping tickets: stop playing with your coding agents and get back to work.
- **On competing with the labs.** Horthy's reframe: you are not competing against Anthropic, you are competing against one product manager at Anthropic inside an org with rules and red tape. He cites Browser Use as a recent case of a small team beating an incumbent at something the incumbent was already building.
## Actionable Takeaways
1. Before any prompting, write the product pass: the user problem, how you'll measure success, an announcement written as if the feature shipped, and plain HTML mockups of the affected views. No architecture, no schemas.
2. Then do architecture — services, flow, endpoints, tables, query outlines — then program design: call stack, file placement, types and method signatures, using code blocks a human can scan and approve or reject in seconds.
3. Do all of that in short, token-light sessions. Decisions made at 40k tokens are made by a sharper model than decisions made at 200k, and they are far cheaper to reverse than decisions embedded in written code.
4. Instruct the agent to build in vertical slices — mock endpoint, stubbed front end, wired end to end — before it fills in business logic and error handling, so you have something to test at every step.
5. Give the agent a real number to optimize wherever one exists (conversion, latency, cost per call) instead of a description of done.
6. Keep reading the code, or at minimum keep hold of the product logic — onboarding, cancellation, what each endpoint does. Consider having the agent quiz you on the current state of the codebase.
7. Route production incidents and part of your support queue into the factory so you wake up to a pull request instead of an alert.
8. Commit `/docs/adr` for decisions and `/docs/external` for out-of-band context — env var names, payment setup, test accounts, support channels — so agents find it by grepping rather than by MCP round-trips.
9. Replace context-fetching instructions with deterministic session-start hooks. Pulling recent errors in code costs no tokens and no model attention.
10. Prefer XML over JSON in constructed context windows for token efficiency, and audit windows for wrong information first, missing information second, size third.
11. When results degrade, compact the session into a document and start fresh from it rather than pushing through — and treat that as intuition to develop, not a hard token threshold.
12. Before adding agents or spend, ask whether the thing you're optimizing is the actual bottleneck. If review is the constraint, more coding agents make it worse.
## Notable Quotes
> "They can solve problems really, really well, but they're not going to be able to write maintainable code without you in the loop helping." — Dex Horthy
> "If you can tell it a measurable output, the agent will move mountains for you." — David Ondrej
> "The cost function of bad architecture is measured in weeks and months." — Dex Horthy
> "If the model knew what good code looked like, then it would be able to write it in the first place." — Dex Horthy
> "There are inefficiencies that are not bottlenecks." — Dex Horthy
> "Stop playing with your coding agents and get back to work." — Dex Horthy
---
*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*
*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*