메뉴
HN
Hacker News 16일 전

대규모 코드베이스에서 클로드 코드 활용법

IMP
8/10
핵심 요약

클로드 코드(Claude Code)가 수백만 줄의 모노레포, 레거시 시스템 등 대규모 환경에서 어떻게 작동하는지 설명하는 글입니다. 기존 RAG 기반 인덱싱의 한계를 넘어 로컬 환경에서 직접 파일을 탐색하는 에이전트 검색 방식을 소개하며, 성공적인 도입을 위한 컨텍스트 설정과 확장 하네스 구축의 중요성을 강조합니다.

번역된 본문

대규모 코드베이스에서 클로드 코드(Claude Code)가 작동하는 방식: 모범 사례 및 시작점

가장 성공적인 클로드 코드 도입 사례들은 설정, 툴링, 조직 구조에 걸쳐 공통된 패턴을 공유하고 있습니다. 이 글은 기업 규모에서 클로드 코드로 빌드하는 엔지니어링 조직을 위한 모범 사례를 다루는 새로운 시리즈인 '규모에 맞춘 클로드 코드(Claude Code at scale)'의 일부입니다.

카테고리: 엔터프라이즈 AI 제품: 클로드 코드(Claude Code) 날짜: 2026년 5월 14일 읽기 시간: 5분

클로드 코드는 수백만 줄의 모노레포, 수십 년된 레거시 시스템, 수십 개의 저장소에 걸친 분산 아키텍처, 그리고 수천 명의 개발자가 있는 조직에서 프로덕션으로 실행되고 있습니다. 이러한 환경은 각 하위 디렉토리마다 빌드 명령이 다르거나 공유 루트 없이 폴더에 퍼져 있는 레거시 코드 등 작고 단순한 코드베이스에서는 볼 수 없는 도전 과제를 제시합니다. 이 글은 대규모로 클로드 코드를 성공적으로 채택하게 이끈 관찰된 패턴들을 다룹니다.

우리는 "대규모 코드베이스"라는 용어를 다양한 배포 환경을 지칭하는 데 사용합니다: 수백만 줄의 모노레포, 수십 년에 걸쳐 구축된 레거시 시스템, 개별 저장소에 분산된 수십 개의 마이크로서비스, 또는 이들의 조합 등입니다. 여기에는 팀이 보통 AI 코딩 도구와 연관 짓지 않는 언어로 실행되는 코드베이스(예: C, C++, C#, Java, PHP)도 포함됩니다. (클로드 코드는 이러한 경우에도 대부분의 팀이 기대하는 것보다 더 나은 성능을 발휘하며, 특히 최근 모델 릴리스에서 그렇습니다.) 모든 대규모 코드베이스 배포는 특정 버전 관리, 팀 구조, 축적된 관례에 따라 결정되지만, 여기서 다루는 패턴은 이에 걸쳐 일반화될 수 있으며 클로드 코드 도입을 고려하는 팀에게 좋은 출발점이 됩니다.

클로드 코드가 대규모 코드베이스를 탐색하는 방식 클로드 코드는 소프트웨어 엔지니어가 하는 방식과 동일하게 코드베이스를 탐색합니다: 파일 시스템을 순회하고, 파일을 읽고, grep을 사용해 필요한 것을 정확히 찾으며, 코드베이스 전체의 참조를 따릅니다. 이는 개발자의 로컬 기기에서 작동하며, 코드베이스 인덱스를 구축, 유지 관리 또는 서버에 업로드할 필요가 없습니다.

과거의 AI 코딩 도구들은 전체 코드베이스를 임베딩하고 쿼리 시간에 관련 청크를 검색하는 RAG 기반 검색에 의존했습니다. 대규모에서 이러한 시스템은 임베딩 파이프라인이 활발한 엔지니어링 팀의 속도를 따라가지 못하기 때문에 실패할 수 있습니다. 개발자가 인덱스를 쿼리할 즈음이면, 그것은 며칠, 몇 주, 심지어 몇 시간 전에 존재했던 코드베이스를 반영하고 있습니다. 그러면 검색은 팀이 2주 전에 이름을 바꾼 함수를 반환하거나, 지난 스프린트에 삭제된 모듈을 참조하며, 둘 중 어느 것도 만료되었다는 표시가 없습니다.

에이전트 검색(Agentic search)은 이러한 실패 모드를 피합니다. 수천 명의 엔지니어가 새 코드를 커밋함에 따라 유지해야 할 임베딩 파이프라인이나 중앙 집중식 인덱스가 없습니다. 각 개발자의 인스턴스는 라이브 코드베이스를 기반으로 작동합니다. 하지만 이 접근 방식에는 트레이드오프가 있습니다: 클로드가 어디를 찾아야 할지 알 수 있는 충분한 초기 컨텍스트가 제공될 때 가장 잘 작동합니다. 즉, 클로드의 탐색 품질은 코드베이스가 얼마나 잘 설정되어 있는지, CLAUDE.md 파일과 스킬(skills)로 컨텍스트를 계층화하는지에 따라 결정됩니다. 10억 줄짜리 코드베이스에서 모호한 패턴의 모든 인스턴스를 찾으라고 요청하면, 작업이 시작되기도 전에 컨텍스트 윈도우 제한에 도달할 것입니다.

코드베이스 설정에 투자하는 팀이 더 나은 결과를 봅니다.

하네스(Harness)가 모델만큼 중요한 이유 클로드 코드에 대한 가장 일반적인 오해 중 하나는 그 기능이 사용된 모델에 의해서만 결정된다는 것입니다. 팀들은 모델의 벤치마크와 테스트 작업에서의 성능에 집중합니다. 실제로는 모델을 중심으로 구축된 생태계, 즉 하네스(harness)가 모델 자체보다 클로드 코드의 성능을 더 많이 결정합니다.

하네스는 5가지 확장 포인트(CLAUDE.md 파일, 훅(hooks), 스킬(skills), 플러그인, MCP 서버)로 구축되며, 각각 다른 기능을 수행합니다. 팀이 이를 구축하는 순서가 중요한데, 각 레이어가 이전 것 위에 구축되기 때문입니다. 두 가지 추가 기능, L...

원문 보기
원문 보기 (영어)
How Claude Code works in large codebases: Best practices and where to start The most successful Claude Code deployments share a set of recognizable patterns across configurations, tooling, and org structure. This article is part of Claude Code at scale , a new series covering best practices for engineering organizations building with Claude Code at enterprise scale. Category Enterprise AI Product Claude Code Date May 14, 2026 Reading time 5 min Share Copy link https://claude.com/blog/how-claude-code-works-in-large-codebases-best-practices-and-where-to-start Claude Code is running in production across multi-million-line monorepos, decades-old legacy systems, distributed architectures spanning dozens of repositories, and at organizations with thousands of developers. These environments present challenges that smaller, simpler codebases don’t, whether that’s build commands that differ across every subdirectory or legacy code spread across folders with no shared root. This article covers the patterns we've observed that have led to successful adoption of Claude Code at scale. We use “large codebase” to refer to a wide range of deployments: monorepos with millions of lines, legacy systems built over decades, dozens of microservices across separate repositories, or any combination of the above. That also includes codebases running on languages that teams don't always associate with AI coding tools, such as C, C++, C#, Java, PHP. (Claude Code performs better than most teams expect it to in those cases, particularly as of recent model releases.) While every large codebase deployment is shaped by its specific version control, team structure, and accumulated conventions, the patterns here generalize across them and are a good starting point for teams considering adopting Claude Code. How Claude Code navigates large codebases Claude Code navigates a codebase the way a software engineer would: it traverses the file system, reads files, uses grep to find exactly what it needs, and follows references across the codebase. It operates locally on the developer’s machine and doesn’t require a codebase index to be built, maintained, or uploaded to a server. The AI coding tools relied on RAG-based retrieval by embedding the entire codebase and retrieving relevant chunks at query time. At large scale, those systems can fail because embedding pipelines can’t keep up with active engineering teams. By the time a developer queries the index, it reflects the codebase as it existed days, weeks, or even hours ago. Retrieval then returns a function the team renamed two weeks ago, or references a module that was deleted in the last sprint, with no indication that either is out of date. Agentic search avoids those failure modes. There's no embedding pipeline or centralized index to maintain as thousands of engineers commit new code. Each developer's instance works from the live codebase. But the approach has a tradeoff: it works best when Claude has enough starting context to know where to look. This means the quality of Claude's navigation is shaped by how well the codebase is set up, layering context with CLAUDE.md files and skills. If you ask it to find all instances of a vague pattern across a billion-line codebase, you’ll hit context-window limits before the work begins. Teams that invest in codebase setup see better results. The harness matters as much as the model One of the most common misconceptions about Claude Code is that its capabilities are solely defined by the model used. Teams focus on a model’s benchmarks and how it performs on test tasks. In practice, the ecosystem built around the model—the harness—determines how Claude Code performs more than the model alone. The harness is built from five extension points—CLAUDE.md files, hooks, skills, plugins, and MCP servers—each serving a different function. The order in which teams build them matters, as each layer builds on what came before. Two additional capabilities, LSP integrations and subagents, round out the setup. Below, we explain what each of these components and capabilities do: CLAUDE.md files come first . These are context files that Claude reads automatically at the start of every session: root file for the big picture, subdirectory files for local conventions. They give Claude the codebase knowledge it needs to do anything well. Because they load in every session regardless of the task, keeping them focused on what applies broadly will prevent them from becoming a drag on performance. Hooks make the setup self-improving . Most teams think of hooks as scripts that prevent Claude from doing something wrong, but their more valuable use is continuous improvement. A stop hook can reflect on what happened during a session and propose CLAUDE.md updates while the context is fresh. A start hook can load team-specific context dynamically so every developer gets the right setup for their module without manual configuration. For automated checks like linting and formatting, hooks enforce the rules deterministically and produce more consistent results than relying on Claude to remember an instruction. Skills keep the right expertise available on-demand without bloating every session. In a large codebase with dozens of task types, not all expertise needs to be present in every session. Skills solve this through progressive disclosure , offloading specialized workflows and domain knowledge that would otherwise compete for context space and loading them only when the task calls for it. For example, a security review skill loads when Claude is assessing code for vulnerabilities, while a document processing skill loads when a code change is made and documentation needs to be updated. Skills can also be scoped to specific paths so they only activate in the relevant part of the codebase. A team that owns a payments service can bind their deployment skill to that directory, so it never auto-loads when someone is working elsewhere in the monorepo. Plugins distribute what works. One challenge with large codebases is that good setups can stay tribal. A plugin bundles skills, hooks, and MCP configurations into a single installable package, so when a new engineer installs that plugin on day one, they will immediately have the same context and capabilities as those who have been using Claude already. Plugin updates can be distributed across the organization through managed marketplaces . For example, a large retail organization we work with built a skill connecting Claude to their internal analytics platform so that business analysts could pull performance data without leaving their workflow. They distributed it as a plugin before the broad rollout to the business. Language server protocol (LSP) integrations give Claude the same navigation a developer has in their IDE. Most large-codebase IDEs already have an LSP running, powering "go to definition" and "find all references." Surfacing this to Claude gives it symbol-level precision: it can follow a function call to its definition, trace references across files, and distinguish between identically named functions in different languages. Without it, Claude pattern-matches on text and can land on the wrong symbol. One enterprise software company we worked with deployed LSP integrations org-wide before their Claude Code rollout, specifically to make C and C++ navigation reliable at scale. For multi-language codebases, this is one of the highest-value investments. MCP servers extend everything. MCP servers are how Claude connects to internal tools, data sources, and APIs that it can't otherwise reach. The most sophisticated teams built MCP servers exposing structured search as a tool Claude can call directly. Others connect Claude to internal documentation, ticketing systems, or analytics platforms. Subagents split exploration from editing. A subagent is an isolated Claude instance with its own context window that takes a task, does the work, and returns