# Anthropic Just Dropped a Masterclass on Building Agent Harnesses (for Large Codebases) <!-- ref: @content/youtube/cole-medin/anthropic-just-dropped-a-masterclass-on-building-agent-harnesses-for-large-codebases tags: [large codebases, AI layer, CLAUDE.md, hooks, skills, LSP, MCP, sub-agents, code navigation, team adoption] version: 2 updated_at: 2026-11-24T06:05:39.409Z --> **[Watch on YouTube](https://www.youtube.com/watch?v=efRIrLXoOVA)** # Anthropic Just Dropped a Masterclass on Building Agent Harnesses (for Large Codebases) *Synthesized from Cole Medin, 2026-05-21.* Cole Medin presents this solo episode, a walkthrough of Anthropic's guidance on using Claude Code in large code bases, with a demo repository that shows each strategy in action. ## Core Thesis Cole argues, following Anthropic's article, that the harness around a model matters as much as the model itself. He calls that surrounding set of context and tools the AI layer, and says it should be built and owned as shared infrastructure for a code base rather than left to each engineer. ## Key Insights - **Navigation without an index.** Claude Code does not use semantic search or a code index. It navigates with grep, folder structure and command-line tools, so it works best when the starting context points it to the right area. - **Lean, layered rules.** Keep the root CLAUDE.md short, covering the stack, architecture, conventions, gotchas, and the test and dev-server commands. Long rule files can hurt performance. Subdirectory CLAUDE.md files load automatically when work starts in that part of the tree. - **Scoping by starting directory.** Starting a session inside one service narrows what the agent edits, while the root CLAUDE.md still loads. - **Code base map.** When the directory structure does not explain the layout, a short map of directories with one-line descriptions in the global rules helps the agent pick the right slice. - **Self-improving hooks.** A stop hook runs a headless Claude session at the end of each turn to review the changes and write proposed CLAUDE.md updates to a markdown review file. A start hook loads git status and recent commits, and could pull team documentation from Confluence. - **Skills and progressive disclosure.** A skill's name and description load first, and the full file is read only when it applies. A path parameter limits a skill to a subdirectory, such as API routes. - **Symbol-level search through MCP.** A local MCP server wraps language-server features (find definition, find references), so the agent can search by symbol rather than string. Cole says this matters for code bases in the six-digit line range, where grep is slow and token-heavy. - **Sub-agents for exploration.** Sub-agents split research from editing. Each runs in its own context and returns only a summary, so the main session stays clean for editing. - **Team ownership.** A small team should build and maintain the shared AI layer first, then roll it out, so people do not each build their own conflicting setup. - **Plugin install.** The demo repository is packaged as a Claude Code plugin that bundles the stop hook, an explorer sub-agent and the code-base search MCP server. ## Actionable Takeaways 1. Keep the root CLAUDE.md short: project purpose, stack, architecture, conventions, gotchas, and the test and dev-server commands. 2. Add a CLAUDE.md to each slice of the code base so its rules load only when work happens there. 3. For a ticket scoped to one service, start Claude Code from that service's directory. 4. Add a stop hook that proposes CLAUDE.md updates while the session context is still fresh. 5. Add a start hook that injects git status and recent commits as session context. 6. In large code bases, give the agent a symbol-aware search tool (definitions and references) and keep grep for plain text. 7. Send exploration work to sub-agents so that only the summary returns to the main session. 8. Have a small team build and maintain the shared AI layer before rolling it out to everyone. ## Notable Quotes > "The harness matters as much as the model." — Cole Medin > "keep your global rules lean and layered." — Cole Medin > "usually all we need is that summary back" — Cole Medin --- *Related: `@content/web/github/2026-11-25-claude-code-v2-1-332` · `@content/web/github/2026-11-24-builtin-ship-shadows-user-skill` · `@content/web/github/2026-11-17-open-artifact` · `@content/youtube/yifan-bth/we-are-missing-the-point-of-mcp-its-not-just-about-tools` · `@content/youtube/yifan-bth/i-reverse-engineered-claude-code-learn-these-agent-tricks`* --- *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).*