Speaker Notes

No Vibes Allowed: Solving Hard Problems in Complex Codebases – Dex Horthy, HumanLayer

To successfully use coding agents on complex brownfield codebases without producing slop, developers must master advanced context engineering through intentional compaction, subagents, and a rigorous research-plan-implement workflow.

AI Engineer · 20:31 · YouTube ↗

Talk · solo speaker  Advanced · concepts and workflow strategy

Highlights

3 clips · 3 min of 21 min
    • Model performance drops significantly as context usage exceeds 40%.
    • Too many MCPs and tools push agents into the dumb zone quickly.
    • Unconstrained context leads to repetitive errors and poor code generation.
    • Split agent tasks into distinct research, planning, and implementation phases.
    • Research finds exact files and system behavior before coding starts.
    • Planning outlines concrete steps and code snippets, preventing model confusion.
    • AI cannot replace human thinking and architectural reasoning.
    • Reviewing and validating the generated plan prevents compounding errors in code.
    • Detailed plans with actual code snippets provide necessary engineering leverage.

Questions this video answers

8 · every answer cites the moment it was said
01 Why do coding agents often produce slop on complex codebases? 2 sources · 0:57

Developers face high rework and codebase churn on brownfield projects because naive prompting fills the context window with noise. As context gets crowded, models enter the dumb zone and performance severely degrades.

02 How does intentional compaction help manage the context window? 2 sources · 3:53

Intentional compaction involves asking the agent to compress its current context down into a markdown file. This allows a new agent to start straight to work with exact file references instead of searching from scratch.

03 When should I use subagents instead of a monolithic agent loop? 2 sources · 6:43

Subagents should be used for controlling context rather than anthropomorphizing roles like front-end or backend. A subagent forks a separate context window to search code, returning only a succinct message to the parent agent.

04 What is the Research-Plan-Implement workflow and why use it? 2 sources · 7:44

RPI is a structured workflow that keeps context small by breaking tasks into distinct objective phases. Research finds correct files, planning outlines exact code snippets and tests, and implementation executes cleanly while staying in the smart zone.

05 Why is maintaining mental alignment critical when using coding agents? 2 sources · 15:03

Code and plan reviews ensure the team remains on the same page about how and why the codebase is changing. Technical leaders can read the detailed plans instead of wading through walls of generated code, catching problems early.

06 How detailed should the plans be to ensure reliable execution? 2 sources · 16:17

As plans get longer, reliability goes up while readability goes down. To achieve high leverage and reliable execution, teams should iterate so that plans include actual code snippets of what is going to change.

07 How do I onboard agents to large codebases without blowing up context? 2 sources · 12:22

Global repo onboarding docs can quickly consume the token limit and leave no room for tool calling. Instead, use on-demand compressed context and progressive disclosure to pull in only the specific subcontext needed.

08 How do I know how much context engineering to apply to a task? 2 sources · 17:46

The required level of context engineering scales with the complexity of the problem you are solving. Simple tasks need no complex workflow, while massive multi-repo features require rigorous research and compaction.

Section-by-section summary

4 parts

Managing context windows with intentional compaction

LLMs are stateless and their next output depends entirely on current conversation history, leading to degradation as context grows. Instead of endlessly correcting a single long thread or restarting blindly, developers should use intentional compaction to summarize context into markdown files. This gives fresh agent sessions direct access to precise file locations and problem definitions without noise.

Controlling context with subagents and RPI

Subagents should not be used to anthropomorphize roles like front-end or backend, but rather to isolate context-heavy searching tasks. By forking a subagent to explore the codebase and return only the target file, the parent agent stays clean. Combining this with the research-plan-implement workflow keeps context windows small and deterministic.

Ensuring mental alignment and avoiding outsourced thinking

Detailed plans serve as a compression of intent that allows technical leads to maintain mental alignment on codebase changes without reading raw code. However, developers must not outsource critical thinking to AI. A flawed research step or a bad plan will result in dozens of bad lines of code, making human validation indispensable.

Adapting team workflows for AI-generated code

As coding agents become commoditized, the real bottleneck shifts to team workflow and SDLC adaptation. A cultural rift often forms where junior engineers rely heavily on AI while seniors spend time cleaning up resultant slop. Technical leaders must intentionally adopt tools and establish processes to handle codebases where the vast majority of lines are AI-generated.

0:00 / 20:31
k play/pause · f fullscreen · m mute
n next · p previous clip · t highlights/full
< > slower/faster · / search what was said
  • Context engineering6× · first 0:39

    Managing context windows and token inputs to optimize LLM performance and coding agent output.

  • Brownfield codebases3× · first 1:05

    Existing, complex codebases with legacy code and tech debt where AI agents often struggle.

  • Intentional compaction7× · first 3:47

    Compressing an existing agent context window down into a markdown file to preserve clean state.

  • Dumb zone3× · first 5:56

    The region of a token context window where diminishing returns and noise lead to poor agent performance.

  • Subagents2× · first 6:35

    Forked agent context windows used to read code and search files independently before returning results to a parent agent.

  • Research-plan-implement4× · first 2:25

    A structured three-phase workflow designed to keep context small and manage complex coding tasks.

  • Mental alignment3× · first 2:42

    Ensuring team members remain on the same page regarding how and why a codebase is evolving.

  • Harness engineering1× · first 18:58

    Integrating custom coding agent workflows and context handling with IDE extension points.