How Claude Code works in large codebases: Best practices and where to start
Claude ยท article ยท 2026-05-14 source โ Reader ๐ฅ๏ธ
Agent Governance (Internal)Agent HarnessAgent SkillsAgent Context Files (CLAUDE.md / AGENTS.md)Developer Experience & FlowMCP (Model Context Protocol)Progressive DisclosureTeam Harness / Team-Layer Coding-Agent Platforms
At scale โ multi-million-line monorepos, decades-old legacy systems, and organizations with thousands of developers โ Claude Code's effectiveness is determined less by the underlying model than by a deliberately built harness (CLAUDE.md, hooks, skills, plugins, MCP servers, plus LSP integrations and subagents) and, just as importantly, by a durable organizational ownership structure (a dedicated owner or team, cross-functional governance, scheduled re-review as models evolve) that keeps good setups from staying tribal and adoption from plateauing.
practical ยท expository with illustrative narrative vignettes โ An Anthropic blog post (credited to the Applied AI team via named acknowledgements) distilling patterns observed across enterprise Claude Code deployments in large codebases. Purely prescriptive/expository in structure, grounded in customer vignettes rather than controlled studies.
Structure
| Part | Role |
|---|---|
| Framing: Claude Code in production at large-codebase scale | context |
| How Claude Code navigates large codebases: agentic search vs. RAG indexing | evidence / argument |
| 'The harness matters as much as the model': five extension points plus LSP and subagents | taxonomy |
| Three patterns for making the codebase navigable at scale (CLAUDE.md layering, subdirectory initialization, scoped test/lint commands, ignore files, codebase maps, LSP) | practical guidance |
| Actively maintaining CLAUDE.md as model intelligence evolves | argument |
| Assigning ownership for Claude Code management and adoption | argument |
| Applying these patterns to your organization (scope caveats) | conclusion / caveat |
Key terms
- Agentic search
Claude Code's approach to codebase navigation: traversing the live file system, using grep, and following references the way a human engineer would, with no embedding pipeline or centralized index to build or maintain. - Harness Agent Harness
The ecosystem built around the model โ specifically five extension points (CLAUDE.md, hooks, skills, plugins, MCP servers) plus two additional capabilities (LSP integrations, subagents) โ that the article argues determines Claude Code's large-codebase performance more than the model itself. - Agent manager
An emerging, named organizational role: a hybrid PM/engineer function dedicated to managing an organization's Claude Code ecosystem โ settings, permissions, plugin marketplace, CLAUDE.md conventions โ as opposed to a single engineer's informal, part-time stewardship. - DRI (directly responsible individual)
The minimum-viable ownership structure for organizations without a dedicated agent-management team: one person with explicit authority over settings, permissions policy, the plugin marketplace, and CLAUDE.md conventions, and responsibility for keeping them current. - Progressive disclosure (for skills) Progressive Disclosure
Loading specialized expertise (a skill) only when the task at hand calls for it, rather than keeping all possible domain knowledge present in every session โ the mechanism skills use to avoid context bloat in a codebase with many distinct task types.
Propositions
- explicitClaude Code navigates large codebases the way a human engineer would โ traversing the file system, using grep, following references on the live codebase โ rather than via a pre-built embedding index, which avoids the staleness failure mode of RAG-based retrieval tools (returning a renamed function or a deleted module with no indication either is out of date) but trades that for a dependency on the codebase being well set up with layered context.conf: highextendsAlex Wang's Post ยท p1 โ Both agree CLAUDE.md should hold stable project context rather than procedure; this article adds the large-scale elaboration (root-vs-subdirectory layering, lean root file) of the same principle.
- explicitThe harness built around the model โ not the model's raw benchmark capability โ determines how Claude Code performs in a large codebase more than the model alone; teams who evaluate only model benchmarks are focused on the wrong lever.conf: high
- explicitThe harness has an intentional build order across five extension points โ CLAUDE.md, hooks, skills, plugins, MCP servers โ each layer building on what came before, plus two further capabilities (LSP integrations, subagents) that round out the setup.conf: highsupportsAgent Harness Engineering ยท p4 โ Both converge on keeping CLAUDE.md lean and purposeful (every line earning its place) as a load-bearing principle of harness design, here generalized into guidance for layering root vs. subdirectory files.
- explicitcorroboratedHooks' most valuable use is not preventing mistakes but making the setup self-improving โ e.g. a stop hook that reflects on a session and proposes CLAUDE.md updates while context is fresh, or a start hook that dynamically loads the right team-specific context per module without manual configuration.conf: highsupports โA harness for every task: dynamic workflows in Claude Code ยท p7 โ Both describe the same self-improving loop โ mining sessions/corrections to update CLAUDE.md โ via different mechanisms (a stop hook there, an explicit mining workflow here); convergent evidence for 'self-updating context files' as an emerging pattern.
- explicitdevelopedSkills exist to solve a scaling problem specific to large codebases: with dozens of distinct task types, loading all specialized expertise into every session would bloat context, so skills load on demand (progressive disclosure) and can be scoped to specific paths so they activate only for the team that owns that part of the codebase.conf: highsupportsAlex Wang's Post ยท p2 โ Both agree repeatable procedures belong in skills, not CLAUDE.md, with this article adding the organizational rationale (context bloat across dozens of task types at scale) for why that separation matters more as codebases grow.extends โA harness for every task: dynamic workflows in Claude Code ยท p3 โ Large-codebases piece frames skills as solving the scaling problem of loading only task-relevant specialized expertise; this article generalizes the same bounded-context principle into a full runtime-composed multi-agent harness, not just selective skill loading.extends โAgent Skills ยท p7 โ That extraction notes skills can be path-scoped so they activate only for the team that owns that part of the codebase; this whitepaper generalizes the same idea into an explicit organizational principle (domain teams author and own domain skills, hours-to-days cycle) with a concrete comparison against centralized model-swap cycles (days-to-weeks).
- explicitPlugins exist to solve an organizational, not technical, problem โ that 'good setups can stay tribal' โ by bundling skills, hooks, and MCP configurations into a single installable package so a new engineer gets the same context and capabilities on day one that existing users built up incrementally.conf: highsupportsAudit your Agent files ยท p2 โ Plugins and centralized ownership are presented here as the organization-scale fix for the same tribal-knowledge/bloat dynamic that the other article's bloat-formation cycle describes at the scale of one developer's personal setup.
- explicitLSP integration gives Claude symbol-level precision (distinguishing identically-named functions, following exact references) instead of text pattern-matching, and is one of the highest-value investments specifically for multi-language codebases โ one enterprise software company deployed it org-wide before their Claude Code rollout specifically to make C and C++ navigation reliable at scale.conf: high
- explicitAs models evolve, CLAUDE.md instructions and compensatory skills/hooks written for a weaker model's limitations can become unnecessary or actively counterproductive for a newer model โ e.g. a rule forcing single-file refactors that blocks a newer model's legitimate coordinated cross-file edits โ so teams should expect a meaningful configuration review every three to six months, and especially after major model releases.conf: high
- explicitTechnical configuration alone does not drive large-scale adoption; the rollouts that spread fastest had a dedicated infrastructure investment (sometimes just one or two engineers, sometimes a whole team) wired up before broad access, so a developer's first experience with Claude Code was productive rather than frustrating.conf: high
- explicitA new, hybrid PM/engineer role โ 'agent manager' โ is emerging in several organizations specifically to own the Claude Code ecosystem; organizations without a dedicated team should at minimum designate a DRI with explicit authority over settings, permissions policy, the plugin marketplace, and CLAUDE.md conventions.conf: high
- explicitBottoms-up adoption generates enthusiasm but fragments without centralization โ without someone actively assembling and evangelizing shared conventions, knowledge stays tribal and adoption plateaus, which the article frames as a specific organizational failure mode distinct from any technical limitation.conf: high
- explicitIn large or regulated organizations, governance questions (who controls which skills/plugins are available, how to prevent thousands of engineers independently rebuilding the same thing, how AI-generated code goes through the same review process as human-generated code) come up early, and the smoothest deployments establish cross-functional working groups (engineering, information security, governance) before rollout rather than retrofitting governance afterward.conf: high
- implicitThe article's whole harness-and-ownership prescription presupposes that engineering leadership is willing to fund a dedicated owner or team purely for agent-ecosystem management before usage data exists to justify the headcount โ a resourcing commitment the article recommends but never quantifies in cost or ROI terms.conf: medium
Arguments
Organizations adopting Claude Code at scale should invest in a dedicated infrastructure/ownership function before broad rollout, not retrofit one after problems appear. strength: medium
Explicit premises:
- Rollouts that spread fastest had dedicated infrastructure investment in place before broad access.
- Bottoms-up adoption fragments without centralization, and knowledge stays tribal without someone assembling and evangelizing conventions.
- In regulated organizations, governance questions come up early and are best addressed via cross-functional working groups established before rollout.
Implicit premises:
- The cost of standing up a dedicated owner/team before usage data justifies it is lower than the cost of a fragmented, slow-adopting rollout โ an assumption about relative costs the article doesn't quantify on either side.
Inferences:
- An organization currently running a bottoms-up, ungoverned Claude Code rollout should expect to plateau, and should backfill a DRI or agent-manager role rather than waiting for the plateau to resolve itself.
Test, lint, and context configuration should be scoped per-subdirectory rather than applied uniformly at the repo root, especially in large monorepos. strength: high
Explicit premises:
- Running the full test suite for a one-service change causes timeouts and wastes context on irrelevant output.
- CLAUDE.md files at the subdirectory level can specify the commands that actually apply to that part of the codebase.
Implicit premises:
- The codebase's directory structure already maps reasonably well onto independently testable/buildable units โ a premise the article itself partially contradicts by noting that 'in compiled-language monorepos with deep cross-directory dependencies, per-subdirectory scoping is harder to achieve.'
Inferences:
- Monorepos with clean service/directory boundaries will see easier Claude Code adoption than monorepos with deep structural coupling across directories โ coupling, not raw codebase size, is the harder variable.
Narratives
- An enterprise software company deployed LSP integrations org-wide before their Claude Code rollout, specifically to make C and C++ navigation reliable at scale.
โ Concretizes proposition 7 and the broader 'infrastructure before rollout' argument with a specific, sequenced example rather than an abstract recommendation. - A large retail organization built an MCP-based skill connecting Claude to their internal analytics platform so business analysts could pull performance data without leaving their workflow, and distributed it as a plugin before the broader rollout to the business.
โ Supports proposition 6 (plugins solve the tribal-knowledge problem) and extends it beyond engineers to non-engineer users, broadening what 'adoption' includes at organizational scale. - A hook that intercepted file writes to enforce the 'p4 edit' convention in a Perforce codebase became redundant once Claude Code added native Perforce mode.
โ Concretizes proposition 8 (compensatory tooling becomes technical debt once the underlying model/tool limitation is fixed) with a specific, checkable example of harness maintenance.
Questions addressed
- โ
Does a bigger or better model matter more than the surrounding tooling for large-codebase performance?
No โ the harness (the ecosystem built around the model) determines performance more than the model alone, per the article's framing, though no comparative data isolating the two variables is given. - โ
How should a large organization avoid 'good setups staying tribal' as more engineers adopt Claude Code?
Plugins (bundling skills/hooks/MCP configs into installable packages) distributed through managed marketplaces, combined with a dedicated owner (an agent manager or DRI) who assembles and evangelizes conventions. - โ
Does a CLAUDE.md configuration stay valid indefinitely once written?
No โ instructions calibrated to a weaker model's limitations can actively constrain a newer model, so scheduled review (every three to six months, or after major model releases) is recommended. - โ
Who should be accountable for an organization's shared agent configuration, and does one engineer's personal setup practices transfer to team/org scale?
A DRI at minimum, an 'agent manager' role or dedicated team at larger scale, typically sitting under developer experience/developer productivity functions, with cross-functional working groups for governance-heavy (regulated) contexts.
Gaps
- uninformedEvery claim is drawn from Anthropic's own enterprise engagements (named customer vignettes, Applied AI team experience) with no comparative or quantitative evidence โ no measured adoption-speed difference between organizations with vs. without a dedicated owner, no data on how much LSP integration improves navigation accuracy, no basis given for 'every three to six months' as the right review cadence versus some other interval. This is the same evidentiary gap previously flagged in Anthropic's own earlier Claude Code best-practices article.
Read next: Look for an independent, non-vendor study of large-codebase Claude Code (or comparable coding-agent) rollouts with adoption-speed or defect-rate metrics tied to specific organizational structures. - incompleteThe article names an 'agent manager' as an emerging role but doesn't address its reporting line, seniority, or success metrics, nor whether it's intended as a permanent org-chart fixture or a transitional role expected to dissolve once practices mature (the way some organizations treated an early 'DevOps team' as transitional) โ a distinction that matters directly for how a reader should design the role.
Read next: Track how this role is described in future Anthropic materials or independent org-design writing on AI-tooling ownership roles. - incompleteThe governance section names the problem ('how do you prevent thousands of engineers from independently rebuilding the same thing') but describes only up-front controls (a defined set of approved skills, required review, limited initial access) without describing any mechanism for detecting duplication after the fact, or for sunsetting redundant skills/plugins once an organization is already past the 'limited initial access' stage.
Read next: Look for platform-engineering or internal-developer-portal practices on deprecating/consolidating redundant tooling once adoption has scaled past initial rollout. - incompleteThe 'actively maintaining CLAUDE.md' section recommends scheduled review and pruning but doesn't address the risk that removing an old compensatory rule or hook could regress behavior in an edge case the newer model still doesn't fully handle โ the article's framing of review-and-prune reads more confidently certain than the underlying risk (removing a safeguard without being sure it's actually obsolete) would warrant.
Read next: Look for guidance or tooling on testing/validating that a removed CLAUDE.md rule or hook is genuinely redundant before deleting it, rather than relying on developer judgment alone.
Closes gaps elsewhere
- Audit your Agent files ยท g2 โ Directly addresses the team/org scale that article's single-developer audit workflow didn't cover: shared CLAUDE.md and skills governed by a DRI or agent-manager role, plugins distributing a working setup org-wide, and cross-functional working groups for shared ownership of what multiple developers depend on.
- Why AI agents need a Context Lake ยท g2 โ Names who is accountable (a DRI or dedicated 'agent manager' role, typically sitting under developer experience/productivity) and on what cadence (configuration review every three to six months, or after major model releases) โ directly answering the accountability-and-maintenance-incentive question that gap raised.
- The Intent Debt ยท g7 โ Supplies the multi-team-scale mechanism Osmani's repo-local prescriptions (AGENTS.md per repo, ADRs per service) lacked: plugins bundle and distribute shared conventions across repos/services, and an agent-manager/DRI role plus cross-functional governance working groups are the organizational structure that lets shared context and intent span services rather than staying local to one repo.
Related documents
- Audit your Agent files
- Harness engineering: leveraging Codex in an agent-first world
- Agent Skills
- Alex Wang's Post
- Building AI Agents For The Enterprise
- Claude Code: Best practices for agentic coding
- GitHub Copilot CLI Gets Tabs and No-Config-File Tool Setup in Redesigned Terminal UI
- Agent Skills
- JobRunr Introduces ClawRunr, an Open-Source Java AI Agent
- Zero to Agent in 30 Minutes: Build a Supply Chain for Agent Context with Maxim Salnikov