Vibeleaderboard
← All Intel
Intel / article

Context engineering with Dex Horthy

Source
newsletter.pragmaticengineer.com
Author
Gergely Orosz
Date

Context

A coding agent can carry useful findings into a fresh session without carrying the entire conversation. Gergely Orosz's episode summary describes HumanLayer cofounder Dex Horthy's approach: one session investigates the code and writes a research document, another develops a design, and a subsequent session uses those documents to plan implementation. Horthy calls the deliberate compression of accumulated intentional . Human review concentrates on the design and architecture before the agent proceeds. The useful idea is a documented handoff between stages, with a person checking consequential decisions while they are still easy to change.

Key takeaways · AI-distilled
  • Dex Horthy blames codebase rot on the benchmark: -style training rewards reproducing a known fix, and no unit test can score architecture, so models are optimized on a signal that ignores program design entirely.
  • Intentional compaction: let one session read code while still sharp, have it emit a research doc, start a fresh session that turns tickets into a design doc, then a third that plans from both. Humans review the design, where models are weakest.
  • When a model says 'you're completely right,' start a new session. Models are autoregressive, so a mistake-then-scolding pattern makes another mistake the most probable next turn. Horthy calls this trajectory poisoning.
  • Only four properties of a context window matter: size, information quality (anything in there is treated as fact forever, so errors compound), missing information (the agent fills gaps with guesses), and trajectory.
  • Don't optimize model spend early. Engineering time is the bottleneck, so build with the smartest model and only swap something like GPT-OSS-120B (about 1/1,000th the cost of Opus) into simple steps once scale makes the bill hurt.
Terms in this piece · Glossary
  • context window — The maximum amount of text a model can consider at once — its working memory for the current conversation or task.
  • context compaction — Summarizing an agent's earlier conversation to free room in the context window so a long session can keep going.
  • context engineering — Deciding what an agent sees at each step — the discipline that replaced prompt engineering once context windows got large enough to fill badly.
  • SWE-bench — The standard benchmark for AI coding agents: real GitHub issues from real repositories, scored by whether the agent's patch passes the project's own tests.
Key quotes

“Shipping unread code spells disaster within months.”

Read the source newsletter.pragmaticengineer.com
More from Gergely Orosz
Recommended reads
Comments

Checking sign-in…

Loading comments…