Anthropic Just Dropped a Masterclass on Building Agent Harnesses (for Large Codebases)
Cole Medin ·2026-05-21 ·2 min read
Summary written by us from the video's transcript. The video, and everything in it, is Cole Medin's work.
Learn how to structure and use Claude (or similar) coding agents for large codebases by building an effective AI harness with global rules, hooks, skills, LSP/MCP tools, and plugins.
Takeaways
- Lean root claw.md plus subdirectory rule files keep context focused and avoid LLM overload.
- Start hooks supply live Git or documentation context; stop hooks auto‑suggest updates to rules after each session.
- Scope skills and LSP/MCP tools to specific paths so Claude only loads relevant workflows and searches.
- Running Claude from the target directory limits its edit scope while still inheriting global conventions.
Why a Harness Matters More Than the Model
Claude Code can handle multi‑million line mono‑repos, but its performance hinges on the surrounding AI layer – the set of context, rules, and tools you provide. The model alone isn’t enough; a well‑designed harness guides the agent to the right files and conventions.
Design Lean, Layered Global Rules
Keep the root claw.md short: include only core info such as project purpose, tech stack, and common commands. Add subdirectory claw.md files that load automatically when you work in those folders, giving context just where it’s needed. This progressive disclosure prevents overwhelming the LLM with irrelevant rules.
Scope Your Work with Directory Context
If the folder layout isn’t self‑explanatory, add a brief map of subdirectories to the global rules so Claude can suggest which slice of the repo to focus on. You can also start a session directly in a target directory (e.g., cd api && claw) so the agent’s working directory limits its edits to that subtree while still inheriting root rules.
Use Hooks for Continuous Improvement
Start hooks inject dynamic context – recent Git commits, unstaged changes, or team documentation from Confluence – giving Claude a snapshot of current work. Stop hooks run after each session, launching a headless Claude review that proposes updates to claw.md files, ensuring rules evolve alongside the codebase.
Define Scoped Skills for Reusable Workflows
Skills are reusable prompt templates (skill.md) that encode specific workflows such as “add an API route.” By scoping a skill to a path (e.g., only in services/api), Claude loads it only when editing relevant files, keeping the session lean while providing necessary domain knowledge.
Add Language Server Protocol via MCP Servers
Integrate an LSP‑backed MCP server to give Claude symbol‑level search (definitions, references) beyond simple grep. Invoke it with /mcp commands like “find every place monthlyTotalSense is referenced,” and the server returns precise locations, which scales much better for six‑digit line counts.
Plug‑in Everything Together
A custom Claude plugin bundles the above strategies – global rules layering, hooks, scoped skills, and MCP/LSP tools – into two simple commands that inject the full harness into any repository. This lets you replicate the demo setup quickly on your own projects.