大規模コードベースにおける Claude Code の活用:ベストプラクティスと導入の始め方
Claude Code は、大規模なコードベースやレガシーシステムにおいて、RAG ベースのインデックス依存を排し、ローカルで生きたコードを直接探索する「エージェント型検索」アプローチを採用することで実用性を高めている。
キーポイント
RAG ベース手法とのアーキテクチャの違い
従来の AI コーディングツールがコードベース全体を埋め込みインデックス化する方式に対し、Claude Code はファイルシステムを直接走査し、grep を活用して生きたコードから情報を取得する。
大規模環境におけるリアルタイム性の確保
分散型アーキテクチャや多数のコミットがある環境でも、インデックス更新の遅延による古くなった参照を返す失敗モードを回避し、常に最新のコード状態を反映できる。
コンテキスト設定の重要性
エージェント型検索には初期文脈の質が不可欠であり、CLAUDE.md やスキル定義による適切なセットアップが、大規模コードベースでの探索精度と効率を決定する。
影響分析・編集コメントを表示
影響分析
この記事は、AI コーディングツールの市場において「インデックス依存型」から「生コード探索型(エージェント型)」へのパラダイムシフトを示唆しており、特に大規模・複雑なエンタープライズ環境での実用性を裏付ける重要な指針となります。開発チームがツール導入を検討する際、単なるモデル性能だけでなく、プロジェクトの文脈設計やツールの動作原理を理解することの重要性を浮き彫りにしています。
編集コメント
大規模コードベースにおける AI ツールの導入障壁を下げた技術的アプローチとして、インデックスの遅延問題を解決する「生コード探索」の実装は極めて重要です。ただし、その効果は開発チーム側の文脈設定(CLAUDE.md など)に依存するため、ツールの導入だけでなく運用プロセスの見直しも必要となるでしょう。
Claude Code は、数百万行規模のモノレポや数十年にわたるレガシーシステム、数十のリポジトリにまたがる分散アーキテクチャ、そして数千名の開発者を擁する組織において、本番環境で稼働しています。これらの環境は、サブディレクトリごとにビルドコマンドが異なる場合や、共通のルートを持たずにフォルダ全体に散在するレガシーコードが存在する場合など、より小規模で単純なコードベースにはない課題を提示します。
この記事では、大規模なスケーリングにおいて Claude Code の成功した導入につながったと我々が観察したパターンについて解説します。ここでは「大規模コードベース」という用語を用いて、数百万行のモノレポ、数十年かけて構築されたレガシーシステム、別々のリポジトリにまたがる数十のマイクロサービス、あるいはそれらの組み合わせを指しています。これには、チームが AI コーディングツールと必ずしも関連づけていない言語(C、C++、C#、Java、PHP など)で実行されているコードベースも含まれます。(Claude Code はこれらのケースにおいて、多くのチームが予想するよりも優れたパフォーマンスを発揮します。特に直近のモデルリリース以降はその傾向が強まっています。)大規模コードベースの導入はそれぞれ固有のバージョン管理システム、チーム構造、蓄積された慣習によって形作られますが、ここで紹介するパターンはそれら全体に一般化可能であり、Claude Code の導入を検討しているチームにとって良い出発点となります。
クロードコードが大規模コードベースをどのようにナビゲートするか
クロードコードは、ソフトウェアエンジニアが行うようにしてコードベースをナビゲートします。ファイルシステムを走査し、ファイルを読み込み、必要なものを正確に見つけるために grep を使用し、コードベース全体で参照を追跡します。これは開発者のマシン上でローカルに動作し、コードベースのインデックスを構築・維持したりサーバーにアップロードしたりする必要はありません。
AI コーディングツールは、コードベース全体を埋め込み(embedding)、クエリ時に関連するチャンクを検索する RAG ベースの検索に依存していました。大規模なスケールでは、これらのシステムは失敗することがあります。なぜなら、埋め込みパイプラインが活発なエンジニアリングチームのペースに追いつけないからです。開発者がインデックスを照会した時点では、それは数日、数週間、あるいは数時間前に存在していたコードベースの状態を反映しているだけです。その結果、検索機能は 2 週間前に名前が変更された関数を返したり、直近のスプリントで削除されたモジュールへの参照を行ったりしますが、いずれも古くなっているという兆候はありません。
エージェント型検索はこれらの失敗モードを回避します。数千人のエンジニアが新しいコードをコミットしても、維持する必要がある埋め込みパイプラインや集中管理されたインデックスは存在しません。各開発者のインスタンスは、生きた(ライブな)コードベースから動作します。
しかし、このアプローチにはトレードオフがあります。Claude がどこを探すべきかを知るために十分な初期コンテキストを持っている場合にのみ最も効果的に機能します。つまり、Claude のナビゲーションの質は、コードベースがどのように設定されているか、CLAUDE.md ファイルやスキルでコンテキストを層状に重ねているかに依存します。数十億行にも及ぶコードベース全体で曖昧なパターンを検索するよう依頼すると、作業が始まる前にコンテキストウィンドウの制限に直面することになります。コードベースの設定に投資したチームは、より良い結果を得ています。
ハーネスもモデル同様に重要
Claude Code に関する最も一般的な誤解の一つは、その機能が使用するモデルによってのみ定義されているという考え方です。チームはモデルのベンチマークやテストタスクでのパフォーマンスに焦点を当てがちですが、実際にはモデルを取り巻くエコシステム——ハーネス——こそが、モデル単体よりも Claude Code のパフォーマンスを決定づけます。
ハーネスは 5 つの拡張ポイントから構成されています。CLAUDE.md ファイル、フック(hooks)、スキル、プラグイン、MCP サーバーです。それぞれが異なる機能を果たします。チームがこれらを構築する順序も重要で、各層はそれ以前のものを基盤として積み上げられていきます。さらに、LSP 統合とサブエージェントという 2 つの追加機能があり、セットアップを完成させます。以下に、これらの各コンポーネントと機能が何を行うのかを説明します。
CLAUDE.md ファイルが最優先されます。これらは、Claude がセッション開始時に自動的に読み込むコンテキストファイルであり、全体像を示すルートファイルと、ローカルな規約を示すサブディレクトリファイルから構成されます。これらにより、Claude はあらゆるタスクを適切に遂行するために必要なコードベースの知識を得ることができます。タスクに関わらずすべてのセッションでロードされるため、広く適用可能な内容に焦点を絞ることで、パフォーマンスへの負荷となるのを防ぎます。
Hooks(フック)は、セットアップを自己改善型にします。多くのチームは、フックを Claude が誤った動作をするのを防ぐスクリプトとして捉えていますが、そのより価値ある用途は継続的な改善です。停止フック(stop hook)はセッション中に何が起こったかを振り返り、コンテキストが新鮮なうちに CLAUDE.md の更新案を提案できます。開始フック(start hook)は、チーム固有のコンテキストを動的に読み込むことで、各開発者が手動設定なしで自分のモジュールに適したセットアップを受け取れるようになります。リンティングやフォーマットといった自動チェックにおいては、フックがルールを決定論的に適用し、Claude に指示を記憶させることに依存するよりも、より一貫性のある結果を生み出します。
Skills は、必要な専門知識をオンデマンドで利用可能に保ちつつ、すべてのセッションが肥大化するのを防ぎます。数十種類のタスクタイプが存在する大規模なコードベースでは、すべての専門知識を各セッションに含める必要はありません。Skills は 段階的開示 を通じてこれを解決し、本来ならコンテキスト領域を競合する可能性のある特殊なワークフローやドメイン知識をオフロードし、タスクが必要になった際にのみ読み込みます。例えば、セキュリティレビューのスキルは、Claude がコードの脆弱性を評価しているときに読み込まれ、文書処理のスキルはコード変更が行われ、ドキュメントの更新が必要な場合に読み込まれます。
Skills は特定のパスにスコープを限定することもでき、関連するコードベースの一部でのみアクティブ化されます。支払いサービスを担当するチームは、デプロイメントのスキルをそのディレクトリにバインドすることで、モノレポ内の他の場所で作業している際に自動的に読み込まれることを防ぐことができます。
Pluginsは、機能の共有を可能にします。大規模なコードベースにおける課題の一つは、優れた設定が特定のチームや部署内に閉じこもってしまうことです。プラグインは、スキル、フック、MCP 構成を単一のインストール可能なパッケージに統合したものであり、新しいエンジニアが初日にそのプラグインをインストールすれば、すでに Claude を使用しているメンバーと同じコンテキストと機能能力を即座に得ることができます。プラグインの更新は、管理されたマーケットプレイスを通じて組織全体に配布できます。
例えば、私たちが協力している大規模小売企業では、Claude を社内分析プラットフォームに接続するスキルを開発し、ビジネスアナリストがワークフローから離れることなくパフォーマンスデータを取得できるようにしました。この機能は、全社展開前にプラグインとして配布されました。
言語サーバープロトコル(LSP)の統合により、Claude は開発者が IDE で利用するのと同じナビゲーション機能を備えます。 大規模コードベースを扱う多くの IDE ではすでに LSP が稼働しており、「定義へ移動」や「すべての参照の検索」などの機能を支えています。これを Claude に提供することで、シンボルレベルの精度が実現され、関数呼び出しからその定義へと追跡したり、ファイル間をまたいで参照を追ったり、異なる言語で同名の関数を区別したりすることが可能になります。これがない場合、Claude はテキストのパターンマッチングに頼ることになり、誤ったシンボルを選択してしまうリスクがあります。私たちが協力したあるエンタープライズソフトウェア企業では、Claude Code の展開前に組織全体で LSP 統合を導入し、大規模な C および C++ コードベースにおけるナビゲーションの信頼性を確保しました。マルチ言語コードベースにおいては、これは最も価値の高い投資の一つです。
MCP サーバーは機能を拡張します。 MCP サーバーは、Claude が通常アクセスできない内部ツール、データソース、API に接続するための手段です。最も洗練されたチームは、構造化検索を Claude が直接呼び出せるツールとして公開する MCP サーバーを構築しました。また、他のチームは Claude を内部ドキュメント、チケット管理システム、または分析プラットフォームに接続しています。
Subagents は、探索と編集を分離します。サブエージェントは、独自のコンテキストウィンドウを持つ孤立した Claude インスタンスであり、タスクを受け取って作業を行い、最終結果のみを親エージェントに返します。ハーンセットが整った後、一部のチームは読み取り専用のサブエージェントを起動してサブシステムのマッピングを行い、その発見事項をファイルに書き込んだ上で、メインのエージェントが全体像を持って編集を行うというアプローチを取ります。

*Claude Code の拡張レイヤーをひと目で見る。*以下の表は、各コンポーネントの役割、ロードされるタイミング、および各コンポーネントで見られる最も一般的なミスを要約したものです:
コンポーネント
概要
ロードされるタイミング
最適な用途
よくある誤解
CLAUDE.md
Claude が自動的に読み込むコンテキストファイル
すべてのセッションで
プロジェクト固有の規約、コードベースに関する知識
スキルに属する再利用可能な専門知識のために使用すること
Hooks(フック)
重要なタイミングで実行されるスクリプト
イベントによってトリガーされる
一貫した動作の自動化、セッションからの学習の記録
自動的に実行すべき事項に対してプロンプトを使用すること
スキル
特定のタスクタイプにパッケージ化された指示
関連する際にオンデマンドで提供
セッションやプロジェクト間で再利用可能な専門知識
CLAUDE.md にすべてを読み込む代わりに
プラグイン
バンドルされたスキル、フック、MCP 設定
設定済みであれば常に利用可能
組織全体で動作するセットアップを配布
優れたセットアップが属人的に留まることを許容
言語サーバープロトコル (LSP)*
言語固有のサーバーによるリアルタイムコードインテリジェンス
設定済みであれば常に利用可能
型付き言語における記号レベルのナビゲーションと自動エラー検出
それが自動的に機能すると仮定する
MCP サーバー
外部ツールやデータへの接続
設定済みであれば常に利用可能
Claude が通常アクセスできない内部ツールへのアクセス権を付与
基本的な機能が動作する前に MCP 接続を構築する
サブエージェント*
特定のタスク用の別個の Claude インスタンス
呼び出された際に使用
探索と編集の分離、並列作業の実行
探索と編集を同じセッション内で実行する
*LSP はプラグイン層を通じてアクセスされます。サブエージェントは設定拡張ポイントではなく委譲機能です。
成功した導入事例から学ぶ3つの構成パターン
大規模コードベースに対して Claude Code をどのように設定するかは、そのコードベースの構造に大きく依存します。それでも、私たちが観察した導入事例全体で、一貫して現れた3つのパターンがあります。
スケールにおけるコードベースのナビゲーション可能性の確保
大規模コードベースにおいて Claude が支援できる範囲は、適切な文脈を見つけられる能力によって制約されます。すべてのセッションに過度な文脈を読み込むとパフォーマンスが低下しますが、逆に文脈が少なすぎると、Claude は盲目でナビゲーションを余儀なくされてしまいます。最も効果的な導入事例では、Claude にとってコードベースを読みやすくするために、事前に投資を行っています。いくつかのパターンが一貫して見られます:
- CLAUDE.md ファイルは軽量かつ階層化された状態に保つ。Claude はコードベース内を移動する際に、これらのファイルを順次読み込んでいきます:全体像を示すルートファイルと、ローカルな規約を示すサブディレクトリごとのファイルです。ルートファイルには指針と重要な注意点のみを含め、それ以外の情報はノイズとして流れていくようにします。
- リポジトリのルートではなく、サブディレクトリ内で初期化を行う。Claude はタスクに関連するコードベースの一部にスコープを限定した状態で最もよく機能します。モノレポではこれは直感に反するように感じるかもしれませんが、ツールは通常ルートへのアクセスを前提としているためです。しかし Claude は自動的にディレクトリツリーを上向きに探索し、その過程で見つけたすべての CLAUDE.md ファイルを読み込むため、ルートレベルのコンテキストが失われることはありません。
- サブディレクトリごとにテストおよびリンティングコマンドのスコープを設定する。Claude が 1 つのサービスを変更した際にフルスイートを実行するとタイムアウトが発生し、無関係な出力にコンテキストを浪費してしまいます。サブディレクトリレベルの CLAUDE.md ファイルには、そのコードベースの一部に適用されるコマンドを指定すべきです。これは各ディレクトリが独自のテストおよびビルドコマンドを持つサービス指向のコードベースではうまく機能します。深いクロスディレクトリ依存関係を持つコンパイル言語のモノレポでは、サブディレクトリごとのスコープ設定は達成が難しく、プロジェクト固有のビルド構成が必要になる場合があります。
- .ignore ファイルを使用して、生成されたファイル、ビルド成果物、サードパーティ製コードを除外する。.claude/settings.json に permissions.deny ルールをコミットすることで、これらの除外ルールがバージョン管理され、チーム内のすべての開発者が自分で設定しなくても同じノイズ削減効果を得られます。一部のコードベースでは、生成されたファイル自体が開発の対象となることもあります。コードジェネレーターを担当する開発者は、ローカル設定でプロジェクトレベルの除外を上書きできますが、これは他のチームメンバーには影響しません。
- ディレクトリ構造が役割を果たさない場合は、コードベースマップを構築する。コードが従来のディレクトリ構造に統合されていない組織では、リポジトリルートに軽量な markdown ファイルを配置し、各トップレベルフォルダとその中身に関する 1 行の説明を記載することで、Claude がファイルを開く前に参照できる目次を提供できます。数百のトップレベルフォルダを持つコードベースの場合、これは階層アプローチとして最も効果的です:ルートファイルは最高レベルの構造のみを記述し、サブディレクトリの CLAUDE.md ファイルが次の詳細レベルを提供します。これらは Claude がツリー内を移動する際にオンデマンドで読み込まれます。より単純なケースでは、Claude が参照すべき特定のファイルやディレクトリを@メンションすることで同じ役割を果たすことができます。
- LSP サーバーを実行して、文字列検索ではなくシンボル検索を行うようにする。大規模なコードベースで一般的な関数名を検索すると数千件の一致が返され、Claude はどのファイルが重要かを判断するためにファイルをオープンしようとしてコンテキストを消費してしまいます。LSP は同じシンボルを指す参照のみを返すため、フィルタリングは Claude が何らかのファイルを読む前に発生します。この設定には、使用する言語用のコードインテリジェンスプラグインと対応する言語サーバーバイナリのインストールが必要です。Claude Code のドキュメントでは、利用可能なプラグインとトラブルシューティングについて解説しています。
一つの注意: 階層化された CLAUDE.md アプローチでさえも機能しなくなるエッジケースが存在します。例えば、数十万のフォルダと数百万のファイルを持つコードベースや、非 Git バージョン管理システム上のレガシーシステムなどが該当します。これらの課題については、本シリーズの今後の回で取り上げます。
モデルの知能進化に伴う CLAUDE.md ファイルの積極的な維持
モデルが進化するにつれ、現在のモデル向けに記述された指示が、将来のモデルに対して逆効果になる可能性があります。かつて Claude が苦手としていたパターンをガイドしていた CLAUDE.md ファイルは、次のモデルが登場した際に不要になったり、逆に制約要因となったりする場合があります。例えば、リファクタリングをすべて単一ファイルの変更に分けるように Claude に指示する CLAUDE.md ルールは、以前のモデルが軌道から外れないようにするのに役立ったかもしれませんが、新しいモデルが行うのに優れた協調的な跨ファイル編集(cross-file edits)を妨げてしまうことになります。
モデルの推論能力における特定の制限や、Claude Code 自体のツール機能における制限を補うために構築されたスキルやフックは、それらの制限がもはや存在しなくなると、単なるオーバーヘッドとなります。例えば、Perforce コードベースで p4 edit を強制するためにファイル書き込みをインターセプトするフックは、Claude Code にネイティブの Perforce モード(native Perforce mode)が追加された時点で不要となりました。
チームは、3 か月から 6 ヶ月に一度、意味のある設定レビューを行うことを想定すべきですが、主要なモデルリリース後にパフォーマンスが頭打ちになったと感じた際にも、その都度実施する価値があります。
Claude Code の管理と導入における所有権の割り当て
技術的な設定だけでは、採用を推進することはできません。成功した組織は、組織層への投資も同時に行いました。
最も急速に普及したロールアウトは、広範なアクセス権付与前に専用のインフラ投資が行われたものです。小規模なチーム、場合によっては単独のエンジニアがツールを構築し、Claude が開発者が初めて触れた時点で既に開発ワークフローに適合するようにしました。ある企業では数人のエンジニアが、初日から利用可能なプラグインと MCP のスイートを構築しました。別の企業では、AI コーディングツールの管理に専念するチーム全体が、ロールアウト開始前にインフラを整備していました。どちらの場合も、開発者の最初の体験はフラストレーションではなく生産的なものであり、そこから普及が広がりました。

現在この作業を行っているチームは、通常、新規エンジニアのオンボーディングや開発者向けツールの構築を担当する「デベロッパーエクスペリエンス(Developer Experience)」または「デベロッパープロダクティビティ(Developer Productivity)」の下に位置しています。いくつかの組織で台頭している役割として、Claude Code エコシステムの管理に専念するハイブリッドな PM/エンジニア機能である「エージェントマネージャー」が挙げられます。専用チームを持たない組織の場合、最低限の実行可能なバージョンは DRI(Directly Responsible Individual:直接責任者)です。これは、Claude Code の設定、設定・権限ポリシー、プラグインマーケットプレイス、CLAUDE.md 規約に関する決定権を持ち、それらを最新の状態に保つ責任を負う一人の人物を指します。
ボトムアップ型の導入は熱意を生みますが、誰かが成功した要素を集約・統括しなければ分断されてしまいます。適切な Claude Code の規約(標準化された CLAUDE.md の階層構造や、厳選されたスキルとプラグインのセットなど)を集め、普及させる個人またはチームが必要です。この作業を行わない限り、知識は特定のグループ内に閉じこもったままとなり、導入は頭打ちになります。
大規模組織、特に規制産業に属する組織では、ガバナンスに関する質問が早期に浮上します。例えば、「どのスキルやプラグインを誰が管理するのか」「数千名のエンジニアがそれぞれ独自に同じものを再構築することをどう防ぐのか」「AI 生成コードが人間によるコードと同じレビュープロセスを経ることをどう保証するのか」といった問いです。これらに早期に対処するため、承認済みのスキルの定義されたセット、必須のコードレビュープロセス、限定的な初期アクセス権から始め、信頼が高まるにつれて範囲を広げていくことを提案します。
私たちは、エンジニアリング部門、情報セキュリティ担当、ガバナンス代表者を招集して要件を共同で定義し、展開ロードマップを構築するクロスファンクショナルな作業グループを早期に設立した組織において、最も円滑な導入事例を観察しています。
これらのパターンを組織に適用する
Claude Code は、エンジニアが主要なコードベースの貢献者であり、リポジトリが Git を使用し、コードが標準的なディレクトリ構造に従うという、従来のソフトウェアエンジニアリング環境を中心に設計されています。多くの大規模コードベースはこの枠組みに当てはまりますが、大規模なバイナリアセットを扱うゲームエンジンや、非伝統的なバージョン管理システムを持つ環境、あるいはエンジニア以外の人物がコードベースに貢献する場合など、非伝統的な設定では追加の構成作業が必要です。当社のガイダンスは従来の設定を前提としており、私たちが説明したパターンは多くの顧客で機能しています。残る複雑さについては、コードベース、ツール、組織固有の判断が必要となります。まさにここが、Anthropic の Applied AI チームがエンジニアリングチームと直接協力し、これらのパターンを各組織の特定の要件に翻訳する場所です。

*Claude Code for Enterprise で始めましょう。
*謝辞:* Claude Code の大規模展開における経験の共有に感謝いたします。Anthropic の Applied AI チームより、Alon Krifcher 氏、Charmaine Lee 氏、Chris Concannon 氏、Harsh Patel 氏、Henrique Savelli 氏、Jason Schwartz 氏、Jonah Dueck 氏、Kirby Kohlmorgen 氏に、また本記事へのフィードバックを提供いただいた Zoox の Amit Navindgi 氏にも特別なお礼を申し上げます。
原文を表示
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 only the final result to the parent. Once the harness is in place, some teams spin up a read-only subagent to map a subsystem and write findings to a file, then have the main agent edit with the full picture.

The table below summarizes what each component does, when it loads, and the most common mistakes we see with each:
Three configuration patterns from successful deployments
How you configure Claude Code for a large codebase depends heavily on how that codebase is structured. Still, three patterns appeared consistently across the deployments we observed.
Making the codebase navigable at scale
Claude’s ability to help in a large codebase is bounded by its ability to find the right context. Too much context loaded into every session degrades performance, while too little context leaves Claude to navigate blind. The most effective deployments invest upfront in making the codebase legible to Claude. A few patterns appear consistently:
- Keeping CLAUDE.md files lean and layered. Claude loads them additively as it moves through the codebase: root file for the big picture, subdirectory files for local conventions. The root file should be pointers and critical gotchas only; everything else drifts into noise.
- Initializing in subdirectories, not at the repo root. Claude works best when it's scoped to the part of the codebase that's actually relevant to the task. In monorepos, this can feel counterintuitive because tooling often assumes root access, but Claude automatically walks up the directory tree and loads every CLAUDE.md file it finds along the way, so root-level context is never lost.
- Scoping test and lint commands per subdirectory. Running the full suite when Claude changed one service causes timeouts and wastes context on irrelevant output. CLAUDE.md files at the subdirectory level should specify the commands that apply to that part of the codebase. This works well for service-oriented codebases where each directory has its own test and build commands. In compiled-language monorepos with deep cross-directory dependencies, per-subdirectory scoping is harder to achieve and may require project-specific build configurations.
- Using .ignore files to exclude generated files, build artifacts, and third-party code. Committing permissions.deny rules in .claude/settings.json means the exclusions are version-controlled, so every developer on the team gets the same noise reduction without configuring it themselves. In some codebases, generated files are themselves the subject of development work. Developers who work on code generators can override project-level exclusions in their local settings without affecting the rest of the team.
- Building codebase maps when the directory structure doesn’t do the work. For organizations where code isn’t consolidated in a conventional directory structure, a lightweight markdown file at the repo root listing each top-level folder with a one-line description of what lives there gives Claude a table of contents it can scan before opening files. For codebases with hundreds of top-level folders, this works best as a layered approach: the root file describes only the highest-level structure, and subdirectory CLAUDE.md files provide the next level of detail, loading on demand as Claude moves through the tree. For simpler cases, @-mentioning the specific files or directories Claude should reference can do the same job.
- Running LSP servers so Claude searches by symbol, not by string. Grep for a common function name in a large codebase returns thousands of matches and Claude burns context opening files to figure out which matters. LSP returns only the references that point to the same symbol, so the filtering happens before Claude reads anything. Setting this up requires installing a code intelligence plugin for your language and the corresponding language server binary; the Claude Code documentation covers the available plugins and troubleshooting.
One caveat: there are edge cases where even the hierarchical CLAUDE.md approach breaks down, for example codebases with hundreds of thousands of folders and millions of files, or legacy systems on non-git version control. We will address their challenges in future installments of this series.
Actively maintaining CLAUDE.md files as model intelligence evolves
As models evolve, instructions written for your current model can work against a future one. CLAUDE.md files that guided Claude through patterns it used to struggle with may either become unnecessary or actively constraining when the next model ships. For example, a CLAUDE.md rule that tells Claude to break every refactor into single-file changes may have helped an earlier model stay on track but would prevent a newer one from making coordinated cross-file edits it handles well.
Skills and hooks built to compensate for specific model limitations, whether in the model’s reasoning or in Claude Code’s own tooling, become overhead once those limitations no longer exist. A hook that intercepted file writes to enforce p4 edit in a Perforce codebase, for example, became redundant once Claude Code added native Perforce mode.
Teams should expect to do a meaningful configuration review every three to six months, but it's also worth doing one whenever performance feels like it's plateaued after major model releases.
Assigning ownership for Claude Code management and adoption
Technical configuration alone doesn't drive adoption. The organizations that got it right invested in the organizational layer, too.
The rollouts that spread fastest had a dedicated infrastructure investment before broad access. A small team, sometimes even just one person, wired up the tooling so Claude already fit developer workflows when they first touched it. At one company, a couple of engineers built a suite of plugins and MCPs that were available on day one. At another, an entire team focused on managing AI coding tools had the infrastructure in place before the rollout began. In both cases, developers' first experience was productive rather than frustrating, and adoption spread from there.

The teams doing this work today tend to sit under developer experience or developer productivity, which is typically the function responsible for onboarding new engineers and building developer tooling. An emerging role in several organizations is an agent manager: a hybrid PM/engineer function dedicated to managing the Claude Code ecosystem. For organizations without a dedicated team, the minimum viable version is a DRI: one person with ownership over the Claude Code configuration, the authority to make calls on settings, permissions policy, the plugin marketplace, and CLAUDE.md conventions, and the responsibility to keep them current.
Bottoms-up adoption generates enthusiasm but can fragment without someone to centralize what works. You need to have an individual or a team assemble and evangelize the right Claude Code conventions (such as a standardized CLAUDE.md hierarchy or a curated set of skills and plugins). Without that work, knowledge will stay tribal and adoption will plateau.
In large organizations, especially those in regulated industries, governance questions come up early, such as: who controls which skills and plugins are available, how do you prevent thousands of engineers from independently rebuilding the same thing, how do you make sure AI-generated code goes through the same review process as human-generated code? To address these early on, we suggest starting with a defined set of approved skills, required code review processes, and limited initial access, and expand as confidence builds.
We’ve observed the smoothest deployments at organizations that establish cross-functional working groups early by bringing together engineering, information security, and governance representatives to define requirements together and build a rollout roadmap.
Applying these patterns to your organization
Claude Code is designed around conventional software engineering environments where engineers are the primary codebase contributors, the repo uses Git, and code follows standard directory structures. Most large codebases fit this mold, but non-traditional setups such as game engines with large binary assets, environments with unconventional version control, or non-engineers contributing to the codebase require additional configuration work. Our guidance assumes a conventional setup and the patterns we’ve described have worked across many of our customers. Any remaining complexity requires judgment specific to your codebase, tooling, and organization. That's where Anthropic's Applied AI team works directly with engineering teams to translate these patterns into your organization’s specific requirements.

*Get started with *Claude Code for Enterprise*.*
*Acknowledgements:** Special thanks to Alon Krifcher, Charmaine Lee, Chris Concannon, Harsh Patel, Henrique Savelli, Jason Schwartz, Jonah Dueck and Kirby Kohlmorgen from Anthropic’s Applied AI team for sharing their experience deploying Claude Code at scale, and to Amit Navindgi at Zoox for providing feedback on this article.*
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み