How Claude Code works in large codebases
TL;DR Highlight
Layering CLAUDE.md, LSP, and hooks makes Claude Code work well on large codebases.
Who Should Read
A backend developer or DevEx owner rolling out Claude Code on a multi-million-line monorepo or legacy system.
Core Mechanics
- Claude Code searches with grep, not an index
- It traverses the file system, reads files, and follows references with grep.
- It builds no embedding index and uploads nothing to a server.
- The article says RAG indexes go stale and can return a function already renamed.
- The harness matters as much as the model
- The harness is the setup ecosystem around the model.
- Five extension points: CLAUDE.md, hooks, skills, plugins, MCP servers.
- Build them in that order; LSP and subagents round it out.
- Keep CLAUDE.md lean and layered
- The root file holds only pointers and critical gotchas.
- Subdirectory files hold local conventions and load additively.
- Starting in a subdirectory still loads every CLAUDE.md up the tree.
- Use LSP to search by symbol, not string
- Grepping a common function name returns thousands of matches and burns context.
- LSP returns only references to the same symbol.
- One company deployed LSP org-wide before rollout to make C/C++ navigation reliable.
- Hooks and skills have distinct jobs
- Hooks enforce lint and formatting more consistently than prompt instructions, per the article.
- A stop hook can propose CLAUDE.md updates at session end.
- Skills load on demand and can be scoped to specific paths.
- Re-review config when models change
- Rules written for an older model can constrain a newer one.
- A Perforce file-write hook became redundant once native Perforce mode shipped.
- Do a major config review every three to six months.
- Assign an owner before broad rollout
- A dedicated team, or at minimum one DRI, owns settings, permissions, and the plugin marketplace.
- Rollouts with plugins and MCPs ready on day one spread fastest.
- Start with approved skills, required code review, and limited access.
Community Reactions
- Commenters challenged the no-index claim
- One argued engineers use LSP and autocomplete, which are indexes, so the framing seems inconsistent.
- Another said indexing works well in JetBrains IDEs.
- Many reported ignored instructions
- One said Claude ignores important instructions about 90% of the time on a growing codebase, and built 4 separate registries despite a rule to use one of about 10.
- Another said it ignores a skill to save test output to a file and reruns the same test repeatedly.
- Another said it doesn't use LSP symbol rename and edits files one by one.
- Commenters raised token limits and cost
- One said the first prompt consumed 35% of the 5-hour limit, and a cache timeout after 5 minutes cost another 12-15%.
- Another said advice assuming unlimited tokens doesn't fit subscription plans.
- One shared a docs-folder workflow that worked
- They keep backend and frontend documentation folders up to date and have Claude read them before each task, and complex work succeeded.
- Some called the article shallow
- Commenters said it offers little new for people who already know CLAUDE.md and lacks concrete examples.
How to Apply
- Create one subdirectory CLAUDE.md
- In the service folder you use most, write build, test, and lint commands plus gotchas in about 10 lines.
- Specify that service's test command, not the full suite.
- Run Claude Code there and compare results.
- Exclude generated and third-party files via permissions.deny
- Add deny rules for build artifacts, generated code, and vendor paths in .claude/settings.json and commit it.
- Everyone on the team gets the same noise reduction.
- Install an LSP plugin for a typed-language repo
- Install the code intelligence plugin and language server binary for your language.
- Ask for references to a common function name and check that context use is lower than with grep.
- Name a DRI and set a review cadence
- Pick one person to own CLAUDE.md conventions, permissions, and the plugin marketplace.
- Calendar a config cleanup every 3-6 months and after major model updates.
Try It
# Paste into Claude Code, run from the target service directory (the article's method turned into a prompt)
Read this directory ({{service directory}}) and draft a CLAUDE.md.
Rules:
- Keep it within 10-20 lines, pointers and essential gotchas only
- Include build, test, and lint commands that apply only to this directory (never the full suite)
- Do not include general descriptions that can be learned from the code
- List reusable procedures separately as skill candidates, not in CLAUDE.md
- List generated files, build artifacts, and third-party paths separately as exclusion candidatesTerminology
Related Papers
Frostbite: A new CPU architecture discovered, designed and verified by AI
AI agents designed a CPU from scratch, claiming 4.59x perf/W over a traditional core
Restricting AI agents in mobile operating systems platforms from capturing data
Signal now blocks OS-level AI agents from reading its screen on iOS 27 and Android
Actions Speak Louder than Words: Stateful Privacy Sniffing of LLM Agents via Behavioral Covert Channels in Web Interactions
Agents' link choices alone let attackers rebuild user queries at F1 0.89; SOR cuts it to 0.39.
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Passing claims with source, evidence and history kept equivalence at 5 agent stages at 96% versus 31%.
LLM assisted reverse engineering
Pointing an agent at binaries with skills and MD notes made years-long hacks feasible
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Injecting per-turn complexity reports into coding agents cut code erosion without changing correctness
Why is Gemini 4 Carbon taking so long?
Carbon took nearly an hour on bug fixes that Astra and Opus finished in minutes, mostly from extra unrequested work.
Weight-Space Programming builds neural networks like a 1990s researcher
LLM hand-wrote MNIST weights to 91.3%, using 1990s-style techniques