Back

Anthropic Just Dropped a Masterclass on Building Agent Harnesses (for Large Codebases)

Channel Cole Medin
Date May 21, 2026
Duration 28 min
Watch YouTube ↗
TL;DR

Cole Medin walks through Anthropic's article on using Claude Code in large codebases, arguing that the "harness" — what he calls the AI layer — matters as much as the model. He maps seven harness components (global rules, hooks, skills, LSP, MCP servers, subagents, plugins) to concrete strategies, each demoed in a purpose-built repo, so agents can navigate multi-hundred-thousand-line codebases without RAG or indexing. The through-line is a self-improving harness loop: curate context up front, scope it to where work happens, and let stop hooks reflect on each session to keep your rules from going stale.

Key Takeaways

Summary

The Problem: Agents in Large Codebases

Medin opens by noting that AI coding tutorials are everywhere, but almost none cover how to work in large codebases — the tens- or hundreds-of-thousands-of-lines repos most people already have or will grow into. The strategies that work on a simple codebase "fall flat on their face" as it evolves. His source material is a recent Anthropic article, "how to use Claude code to work in large code bases," whose ideas apply to any coding agent. To make the high-level advice concrete, he built a demo repo implementing every strategy, plus a Claude plugin that installs the key pieces into any codebase in two commands.

Anthropic's framing point: if you think your codebase is too complex for Claude Code — pointing to multi-million-line monorepos, decades-old legacy systems, and architectures spanning dozens of repos — you're wrong.

Agentic Search, Not Indexing

Out of the box, Claude Code navigates with what Medin calls "genetic" (agentic) search — not traditional RAG or semantic search, and no codebase indexing. It explores like an engineer would: command-line tools like grep, reading the folder structure, finding the places that matter. The upside is there's no index to keep in sync; the trade-off is that the agent works best when it has enough starting context to know where to look. Everything that follows is about curating that context up front.

The AI Layer: Harness Over Model

This is the article's central claim, and Medin's headline: the harness matters as much as the model. People fixate on benchmarks, but what matters more is the ecosystem around the model — the harness, which he prefers to call the AI layer: "the set of context and tools that you give your coding agent to work on a code base." Traditionally a codebase had two parts, code and tests; the AI layer is a third. It comprises seven things — global rules, hooks, skills, LSP, MCP servers, subagents, and plugins — and each maps to one of Anthropic's strategies, with a concrete example in the demo repo.

Global Rules: Lean and Layered

Global rules are the foundation, used throughout an entire session rather than sporadically like hooks or skills, so they deserve the most context-curation effort. The first tip is to keep them lean — thousand-line rule files are counterproductive, and studies show over-stuffing context hurts agent performance. Give core information only: what the codebase is about, a bit of tech stack and architecture, general conventions and gotchas, and commands for testing and running the dev server.

"Layered" means subdirectory CLAUDE.md files. A root CLAUDE.md always loads; when the agent starts editing in a subdirectory (say, the API service), that folder's CLAUDE.md loads too — progressive disclosure, the same idea behind skills. If you already know where you'll work, you can initialize Claude Code directly in that subdirectory; it becomes the working directory and the agent stays focused there, while still walking up the tree to load parent CLAUDE.md files so root context isn't lost. When directory structure alone isn't enough, a codebase map in the global rules — subdirectories with brief descriptions — lets the agent help you discover which slice to focus on.

Hooks: A Self-Improving Harness

Most teams use hooks defensively — a tool-use hook to stop Claude editing certain directories or deleting files. Medin argues the more valuable use is continuous improvement. A start hook loads context dynamically (his basic demo surfaces git status and recent commits; a richer version could pull Confluence docs based on the developer or the area of the codebase). A stop hook runs when Claude finishes a turn: it launches a separate headless Claude session to look at the changes and the global rules, then writes a markdown review proposing any CLAUDE.md tweaks while context is fresh.

In his demo, a small change produced "no changes needed" (the edit followed an existing convention) — which he frames as a feature, since lean rules rarely need changing. A larger change to the billing service did trigger a recommendation to update a bullet in that subdirectory's CLAUDE.md. The point is a background self-reflection process that keeps rules from going stale, surfacing suggestions you can action when ready.

Skills, LSP, MCP, and Subagents

Skills are reusable prompts/workflows — a set of steps for a task type (like adding an API route). They use progressive disclosure: the description is offered up front, and the full SKILL.md is read only if the agent decides it's relevant. The parameter most people miss is path scoping, which activates a skill only in relevant directories. Medin's distinction: global rules are conventions (the rules you must follow), skills are workflows — but the real goal is scoping both to where they matter so you don't overwhelm the agent.

For search, an LSP gives Claude the same navigation a developer has in an IDE — go-to-definition, find-references, symbol awareness. Medin built a local MCP server exposing an LSP (knocking out both the LSP and MCP strategies at once), giving three tools that complement grep. In his demo, prompting the agent to find every reference to a symbol "using a symbol-level approach" (and telling it not to use grep) made it call the custom where is and find references tools, returning one definition and two references. For six-digit line counts, this directed search is far more token-efficient than grep.

Subagents split exploration from editing: send a task (web research, codebase exploration), it runs in its own context window and returns just a summary to the primary session. Since exploration can balloon to hundreds of thousands of tokens, offloading it keeps the primary context clean for the edits. Medin uses the built-in explorer subagent liberally — e.g., spinning up three at the start of a conversation for database, backend, and frontend.

The Plugin and Assigning Ownership

Rather than cover plugins abstractly, Medin ships one. Via /plugin marketplace add (pointing at a locally cloned repo path plus the tooling folder) and /plugin install, it installs the self-improving stop hook, an explorer subagent, the codebase-search MCP server with LSP, and an example path-scoped skill — a starting point you can drop onto any codebase, even one with an existing AI layer. Alternatively, just clone the demo repo, point Claude Code at it, and ask it to explain and adapt the strategies.

He closes on Anthropic's organizational advice: assign ownership of Claude Code management and adoption. A small team should champion a "quiet investment period" building out the rules, skills, LSP, and MCP servers, then roll a standard AI layer out over time — so people get consistent results and aren't disappointed on first use, and you avoid everyone evolving separate, divergent harnesses.

Notable Quotes

"The harness matters as much as the model."

"if you think your code base is too complex for Claude code, you are wrong."

"So we have rules and we have workflows."

"We want to use subagents to split exploration from editing."

Chapters

Approx. TimeTopic
0:00Why large codebases break naive agent strategies
2:00Agentic search vs. RAG — no indexing in Claude Code
3:00The harness matters as much as the model — the AI layer
4:30Global rules: keep them lean
6:00Layered subdirectory CLAUDE.md files and initializing in a subdir
8:30Building a codebase map for discovery
10:00Sponsor break
11:30Hooks: start and stop hooks for a self-improving harness
17:00Skills: progressive disclosure and path scoping
20:00LSP + MCP server for symbol-level search
23:30Subagents: split exploration from editing
25:30The plugin and getting started
27:00Assigning ownership of the AI layer

References & Resources

Mentioned in Video