---
title: "Context Engineering: How to Turn AI Coding Agents into Production-Ready Tools"
url: "https://zuey.me/articles/context-engineering-cach-bien-ai-coding-agents-thanh-cong-cu-production-ready?lang=en"
locale: en
access: members
full_text: false
published_at: "2025-12-04T07:01:42.000Z"
tags: ["Context Engineering", "Claude Code", "AI Agents", "Programming"]
translations:
  vi: "https://zuey.me/articles/context-engineering-cach-bien-ai-coding-agents-thanh-cong-cu-production-ready.md?lang=vi"
  zh: "https://zuey.me/articles/context-engineering-cach-bien-ai-coding-agents-thanh-cong-cu-production-ready.md?lang=zh"
  ko: "https://zuey.me/articles/context-engineering-cach-bien-ai-coding-agents-thanh-cong-cu-production-ready.md?lang=ko"
  ja: "https://zuey.me/articles/context-engineering-cach-bien-ai-coding-agents-thanh-cong-cu-production-ready.md?lang=ja"
---
# Context Engineering: How to Turn AI Coding Agents into Production-Ready Tools

> AI coding giving you nothing but slop? The problem isn't the model, it's the context. Notes from Dex Horthy's talk on the 40% "dumb zone", sub-agents, and the Research-Plan-Implement workflow I use every day with ClaudeKit 😁

Hey folks, remember me? 😁

Two weeks without a post, huh? Blame "Black Friday" haha... I've been buried in customer support and technical support for ClaudeKit after a wild BF season, so even though I had tons I wanted to write about, I just couldn't find a free minute 🥲 Got a little breathing room this morning, so here we go.

So last Saturday I did a livestream with the NextLevelBuilder folks, and someone asked me: *"How do I get more out of Claude Code / ClaudeKit?"*

Besides walking through the workflow I usually use, my very first answer was: **"LEARN"**.

Seriously. If you want to squeeze the most out of any tool or AI, you need to understand how it works under the hood, and only then can you use it the right way. No toolkit is magical enough to cover all of that for you.

And one of the most important things I think you need to learn is **context engineering**.

> **TIP:** **TL;DR:** LLMs are basically stateless, so good or bad output depends entirely on context. Keep context under ~40%, use sub-agents to control context, follow the Research → Plan → Implement workflow, and review the plan instead of reading raw code.

### When AI is still just a "slop machine"

I watched a video of Dex Horthy - CEO of HumanLayer - at **AI Engineer Summit 2025**, where he gave a pretty shocking talk about the state of AI coding agents. Not about potential or a bright future, but facing a bitter truth head-on:

**Most of the time when you use AI to code, you're creating a lot of rework and code churn, and it doesn't work well for complex tasks or brownfield codebases.**

Research from Eigor covering 100,000 developers shows a brutal reality: you're shipping more code, but most of it is just reworking the slop you shipped last week. If you're building a simple greenfield project like a NextJS dashboard, AI works great. But if you jump into a 10-year-old Java codebase? Good luck.

---

### Context Engineering: the soul of AI development

#### Why does context matter so much?

**LLMs are basically stateless functions. The quality of the output depends entirely on the quality of the input.**

Every time Claude Code or any coding agent picks its next step, there are hundreds of right steps and hundreds of wrong ones. The only thing that influences the output is **what's in the conversation up to that point**.

Context engineering is about optimizing the context window for correctness, completeness, size, and trajectory.

The trajectory part is especially interesting - if you keep yelling at the AI for getting things wrong, the LLM picks up the pattern: "OK, I mess up → human yells → I mess up again → human yells". The most likely next token in this conversation is... to keep messing up so it gets yelled at! 😂

#### The "Dumb Zone": the 40% no-go zone

This is the key concept Dex introduced: **Once you use more than 40% of the context window, performance starts dropping hard**. With Claude Code's ~168,000 tokens, around 40% is the line where you'll clearly see diminishing returns.

> The more of the context window you use, the worse the results.
>
> — Dex Horthy

> **WARN:** If you have too many MCPs (Model Context Protocol servers) in your coding agent, you're doing all your work in the "dumb zone" and you'll never get good results.

#### Why 40%?

Research shows transformer models have a trait: the larger the context window gets, the more the model's "recall" and "reasoning" degrade. It's not a bug, it's a fundamental property of the architecture.

A bigger context window doesn't remove the need for disciplined context management. Instead, it makes it easier to degrade output quality if you don't curate properly.

I wrote about this a few months ago, you can read it here:

[VB-07: Claude Code common mistakes](https://open.substack.com/pub/goonnguyen/p/vb-07-claude-code-common-mistakes)

> goonnguyen.substack.com

---

### Research-Plan-Implement: the anti-"slop" workflow

HumanLayer developed a workflow they call **RPI (Research-Plan-Implement)**.

It's also **the workflow I use every day with Claude Code/ClaudeKit**, and it's the backbone behind ClaudeKit's clear edge in effectiveness over other AI coding tools.

It's not just a set of prompts or a rigid process, but a philosophy of designing the entire development process around context management.

```mermaid
flowchart LR
  R["Research: compress truth"] --> H1["Human review"]
  H1 --> P["Plan: compress intent"]
  P --> H2["Human review"]
  H2 --> I["Implement with fresh context"]
  I --> T["Test and compact"]
  T --> N["Next phase"]
```

*The RPI workflow: human review at the highest-leverage points*

#### Phase 1: Research - compressing "truth" from the codebase

The research phase focuses on objectively understanding how the system works, finding the right files, and staying objective. The goal isn't writing code, it's producing a markdown file with exactly the information you need: file names, line numbers, data flows.

---

*Phần còn lại dành cho thành viên có quyền đọc toàn bài (Knowledges, Kết hợp, Cộng đồng) — see plans at https://zuey.me/pricing*
