Dex Horthy keeps coding agents' context small by compacting work into reviewed plans
Dex Horthy (HumanLayer) describes a coding-agent workflow built around context size: research, plan and implement, each starting from a short Markdown file a human has read. His evidence is his team's experience and a few open-source attempts, one of which failed.
Watch from 3:51Recording by AI Engineer.
The idea
The speaker’s argument, in our words.Horthy treats the context window as the main thing an engineer controls when working with a coding agent. File searches, tool output and repeated corrections all pile up, and in his experience results get worse well before the window is full. His answer is what he calls intentional compaction: ask the agent to write what matters (the task, the files, the exact lines) into a Markdown file, check it, and start a fresh agent from that file. Sub-agents serve the same purpose: they do the reading in a separate context and hand back a short answer.
He organises the work in three compacted steps. Research describes how the existing code actually works, built from the code rather than from documentation that may be out of date. The plan turns that research and the request into explicit steps, with file names, code snippets and how each change will be tested. Implementation follows the plan. The human effort goes into reading the research and the plan, because in his words a wrong line of research can send the whole implementation the wrong way. His team still reviews all the code; reading plans is how he keeps up with the system as it changes. He says the three step names matter less than keeping each context small, and that simple changes need none of it.
What they found
From the talk. Figures are self-reported unless stated.Ask the agent to compress the current conversation into a Markdown file, review it, and start a new agent from it; a good compaction lists the exact files and line numbers that matter.
Practice from the speaker's team; no comparison with other approaches is shown.
Technical recommendation
3:51Results start to degrade at around 40% of the context window, which he calls the 'dumb zone', using Claude Code as the example.
A rule of thumb, not a measurement. He says it varies by model and task complexity.
Speaker opinion
6:05Use sub-agents to control context, not to play roles: a sub-agent does the searching and reading in its own window and returns a short answer, such as where the relevant file is.
Recommendation with reasoning; no measurement.
Technical recommendation
6:35The workflow produced a fix to BAML's 300,000-line Rust codebase that the company's CTO said would go into the next release, and a seven-hour session that shipped about 35,000 lines, one PR of which was merged a week later; an attempt to remove Hadoop dependencies from Parquet Java failed and the pair went back to the whiteboard.
Anecdotes from the speaker's podcast sessions. He notes part of the 35,000 lines was generated code and updated golden files; the 'one to two weeks of work' estimate is his collaborator's.
Case study
8:53
Why it matters
Our reading. Not said in the talk.Most advice about context is about what to load. Horthy's point is that the hand-off files between steps are also the cheapest place for a person to review agent work, before it turns into a large diff. Other teams in the library reached different answers on compaction under different conditions: Towards AI's tutor recalled more and cost less keeping full history, with short sessions and cached tokens, and Arize found automatic summaries unreliable. Horthy's compaction is not an automatic summary: a person checks the file before the next agent starts from it.
What one could try
- When an agent session goes off track, ask it to write a short file with the task, the relevant files and line numbers, check it, and restart from that file.
- For changes in unfamiliar code, have the agent write a research note built from the current code before planning, and read it before any code is written.
- Use sub-agents for searches whose only output should be a location or a short answer.
Limitations
- Evidence is the speaker's own experience and a handful of public sessions; there is no controlled comparison.
- The 40% threshold and the two to three times throughput figure for his team are self-reported and unmeasured in the talk.
- The speaker's company built and promoted the research, plan and implement prompts.
Original sources
AI Engineer Code 2025 · Dec 2, 2025
No Vibes Allowed: Solving Hard Problems in Complex Codebases
Dex Horthy · HumanLayer · 21 min
This is our synthesis of the talk, checked against the transcript at the linked moments.


