# How to Build Effective Claude Code Agents in 2026 <!-- ref: @content/youtube/nate-herk/2026-06-18-how-to-build-effective-claude-code-agents-in-2026 version: 3 updated_at: 2026-10-31T19:00:03.581Z --> Cole Medin (Nate Herk | AI Automation, 2026-06-18): Cole Medin's argument is that the difference between vibe coding and reliable results is a sandwich: you plan heavily up front, delegate the build, and verify at the end — with a fourth step, system evolution, that turns every failure into a permanent rule. *Synthesized from Nate Herk and Cole Medin on Nate Herk | AI Automation, 2026-06-18.* Nate Herk hosts Cole Medin — a career software engineer turned AI educator who now runs enterprise training sessions helping teams replace vibe coding with a repeatable system — for a conversation on directing Claude Code rather than prompting it. ## Core Thesis Cole Medin's argument is that the difference between vibe coding and reliable results is a sandwich: you plan heavily up front, delegate the build, and verify at the end — with a fourth step, system evolution, that turns every failure into a permanent rule. Because attention is scarce and models degrade well before their advertised context limit, the real 2026 skill is harness engineering: orchestrating multiple short-lived coding-agent sessions with explicit handoff documents instead of throwing a large task at one session. ## Key Insights - **The dumb zone is the operating constraint.** Medin's measured feel: Opus degrades around 250,000 tokens, Opus 4.7 around 200,000, Sonnet 4.6 closer to 100,000–125,000 — well short of the million-token window. Herk independently landed on the same 250k number. Both call the 1M figure a false sense of security; Medin notes the analogy people reach for (five Harry Potter books) is accurate about the size and useless about the usable range. The lost-in-the-middle effect is not separate from this — it simply amplifies as you push deeper into the dumb zone. - **Front-loading context is the most common self-inflicted wound.** Medin's example: 20 MCP servers connected at once, each injecting roughly 20,000 tokens of tool definitions before the first prompt, then the user blames the model for acting dumb on the latest Opus. Skills work the opposite way — they give the agent procedures it pulls in when it decides it needs them. - **Plan more than you build.** Medin writes a single markdown spec covering the goal, what success looks like, the validation strategy, and the integration points (which files actually get touched). He deliberately avoids Claude Code's plan mode, preferring his own planning skill that dictates the question-asking behavior and the section structure, because plan mode changes the agent's behavior in ways he would rather control. - **Interrogate before you build.** Both point to Matt Pocock's grill-me skill: the failure mode is the agent silently assuming what you want, and sycophancy means it will approve your plan if you ask whether the plan is good. - **Verification means "prove it works," not "say it's done."** Herk's numbers: without verification checks a first pass lands around 65–70; with them, roughly 92. Medin's non-code example — a Claude-generated Excalidraw diagram where his skill renders it to PNG and Claude reads its own image back to catch padding, spacing, and overlap problems, iterating several times unprompted. He does not care how bad the first attempt is, only that the loop closes before it hands back. - **Build the harness the verification needs.** For web work it is easy (Playwright, Vercel's agent browser — start the site, click through as a user, screenshot). For his hobby game projects Medin has to engineer frame-rate slowdown so an agent that needs thinking time can play something running at 60fps. The general question is always: how would this agent exercise the thing the way a user would? - **Harness, defined.** Medin's framing: the LLM is the reasoning core; the harness is the wrapper that gives it a system prompt and tools (Claude Code itself is a harness); the AI layer is the part you build — CLAUDE.md, skills, hooks, MCP connections to your CRM or task manager. - **Chain sessions, don't stretch one.** Medin's orchestrator hands a plan document from a planning agent to an implementation agent, which writes an execution report that goes to a third agent for validation and code review. The Ralph loop is the well-known primitive: one session reads the big spec, defines phases, and each subsequent agent takes one phase and writes a handoff for the next — necessary precisely because a single agent would hit the dumb zone mid-phase-two. - **Sub-agents are not a substitute for handoffs.** Medin loves them for parallel research and for extracting grounding from separate parts of a codebase, but says getting them to communicate meaningfully is hard. Anthropic's agent teams sit a level above and can genuinely talk to each other, but he calls the implementation unrefined and very token-heavy. His open-source project Archon targets exactly this: making the workflow deterministic and choosing when the model runs, rather than letting Claude Code orchestrate everything. - **The knowledge-work case is identical to the coding case.** Medin's B2B example — a print or construction firm generating quotes: one agent researches inventory, one compares vendor prices, one drafts the PDF, one polishes it, with a final validation checking the job carries the intended margin. Herk names quote generation as his agency's biggest build failure, from underscoping how many factors an accurate quote requires. - **Security: assume any reachable surface will be touched.** Herk's team had an agent misread its task list, act proactively, and email their entire list a discount code that was never meant to go out — they changed the code, updated the page, sent an apology, and the person responsible wrote a case study for the whole team. Medin's three-tier false-security ladder: telling the agent not to delete the database, then blocking DELETE statements, then realizing an agent denied `rm` will simply write a script and run it in two steps. - **Hooks are Medin's security primitive and his memory primitive.** PreToolUse checks inspect the command before every tool call — blocking reads of environment variables, writes to protected folders, destructive commands. The same mechanism drives his second brain: on compaction or session end, a hook writes a conversation summary into a daily log, and a daily process he calls Claude Code dreaming promotes the durable items (decisions made, what he is actively working on) into his primary memory file. Herk admits he underuses hooks — his only one is a completion sound. - **System evolution is the whole game.** Every incident becomes a CLAUDE.md rule, a planning document, or a skill update, so the same bug cannot recur. Medin says he gets uneasy when nothing is going wrong, because there is nothing to harden. - **Pre-empting edge cases:** asking Claude "how could this go wrong?" is in Medin's code-review skill, followed by actually engineering the breaking input — invoking the automation with the bad webhook payload — then fixing and, critically, retesting, since the fix may not have addressed the cause. - **Where the model is trustworthy vs. not.** Medin's line on sycophancy: asking for its opinion is a slippery slope, but asking it to explain how something works has no room for flattery — explaining *is* the way it pleases you. Same for edge cases with empirical answers: the test passes or it doesn't. - **Herk's agent-teams use case:** a debate panel or war room of up to seven personas (CEO, beginner, college student), each researching independently, then debating until consensus, so he can read the reasoning rather than take one opinion. Cost on the $200/month plan: roughly 4–10% of the limit, with the caveat that "don't stop until everyone agrees" can run away. Medin's parallel technique is adversarial development — a separate session prompted to be mean to the first one and surface what it papered over. - **Favorite features.** Medin: skills first, hooks second, sub-agents third. Herk: skills, status line, routines (he moved a trading bot from an open-source agent to routines and reports it performing worse there, likely on memory). Medin's force multiplier is skill plus CLI over MCP — a CLI gives access to GitHub or a CRM more token-efficiently, and the skill encodes how you want that CLI used in your workflow. Archon itself ships as a CLI with an accompanying skill so his second brain can dispatch workflows to it. - **On understanding generated code:** Medin recommends non-engineers at least try to reach the point of reading it — asking Claude to explain what it wrote, using `/by the way` for a sidecar conversation so the explanation does not pollute the main context. If you genuinely won't learn to read it, your validation strategy is the only thing setting your confidence level. ## Actionable Takeaways 1. Sandwich every build: a detailed spec first, delegated implementation in the middle, a verification step you defined in advance at the end. Only say "go rip through this" once the done-condition is written down. 2. Treat ~250k tokens (Opus) as your working ceiling and clear or hand off before it; use ~200k for Opus 4.7 and ~100–125k for Sonnet 4.6. 3. Audit what loads before your first prompt. Disconnect MCP servers you are not using this session and move the procedural knowledge into skills the agent pulls on demand. 4. Write a planning skill of your own rather than relying on plan mode: specify the questions it must ask you and the sections the plan must contain (goal, success criteria, validation strategy, files to touch). 5. Give the agent a way to observe its own output as a user would — render diagrams to PNG and have it read the image, drive the site with Playwright or an agent browser and screenshot, slow the loop down enough for it to act. 6. Split large tasks into phased sessions with an explicit handoff artifact between each (plan → execution report → review), Ralph-loop style, instead of one long session. 7. Use sub-agents for research fan-out and codebase grounding; reserve agent teams for research, debate, and consensus, not for building. 8. Enforce permissions with PreToolUse hooks, not prompt instructions — check the actual command, and remember that a blocked command can be reached by writing and running a script. 9. Scope credentials to what the job needs. Prompts are not a permission layer. 10. Add a hook that summarizes each session into a daily log, plus a daily pass that promotes durable decisions into a primary memory file. 11. After each failure, do not just fix it — write the rule, doc, or skill change that prevents the class of failure, and circulate the incident write-up to the team. 12. Add "what could go wrong here?" to your code-review skill, then have the agent construct and run the breaking case, fix, and retest. 13. Tell Claude *why* you are building something, not only what — Herk notes Anthropic's own 4.8 prompting docs say the same. ## Notable Quotes > "With coding agents, you spend more time planning than you actually do building." — Cole Medin > "Without the verification checks, maybe it's 65 or 70, but now you can get something that is 92 on the first pass." — Nate Herk > "anything that the agent can read or can touch, you have to assume that it will even if you never ask it to" — Nate Herk > "If you tell it never to wipe a database, it's still going to do that." — Cole Medin > "every bug becomes a permanent upgrade" — Cole Medin > "we want to pick when the AI model works in a workflow, instead of having it drive the whole thing" — Cole Medin > "you can think of yourself like the product manager for Claude Code" — Cole Medin --- *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).*