6 6
7> Claude Code を使用してコードベースの探索、バグ修正、リファクタリング、テスト、その他の日常的なタスクを実行するためのステップバイステップガイド。7> Claude Code を使用してコードベースの探索、バグ修正、リファクタリング、テスト、その他の日常的なタスクを実行するためのステップバイステップガイド。
8 8
9このページでは、日常的な開発のための短いレシピを集めています。プロンプティングとコンテキスト管理に関する高度なガイダンスについては、[ベストプラクティス](/ja/best-practices)を参照してください。9このページでは、日常的な開発のための短いレシピを集めています。プロンプティングとコンテキスト管理に関する高度なガイダンスについては、[ベストプラクティス](/docs/ja/best-practices)を参照してください。
10 10
11このページでは以下をカバーしています:11このページでは以下をカバーしています:
12 12
27 新しいコードベースを理解する27 新しいコードベースを理解する
28</h3>28</h3>
29 29
30モノレポまたは大規模なコードベースで Claude Code を設定する場合は、[モノレポと大規模リポジトリ](/ja/large-codebases)を参照してください。30モノレポまたは大規模なコードベースで Claude Code を設定する場合は、[モノレポと大規模リポジトリ](/docs/ja/large-codebases)を参照してください。
31 31
32<h4 id="get-a-quick-codebase-overview">32<h4 id="get-a-quick-codebase-overview">
33 コードベースの概要を素早く把握する33 コードベースの概要を素早く把握する
40 ```bash theme={null}40 ```bash theme={null}
41 cd /path/to/project 41 cd /path/to/project
42 ```42 ```
43
44 `/path/to/project` をプロジェクトへのパスに置き換えてください。
43 </Step>45 </Step>
44 46
45 <Step title="Claude Code を起動する">47 <Step title="Claude Code を起動する">
49 </Step>51 </Step>
50 52
51 <Step title="高レベルの概要をリクエストする">53 <Step title="高レベルの概要をリクエストする">
52 ```text theme={null}54 ```text wrap theme={null}
53 give me an overview of this codebase55 give me an overview of this codebase
54 ```56 ```
55 </Step>57 </Step>
56 58
57 <Step title="特定のコンポーネントについてさらに詳しく調べる">59 <Step title="特定のコンポーネントについてさらに詳しく調べる">
58 ```text theme={null}60 ```text wrap theme={null}
59 explain the main architecture patterns used here61 explain the main architecture patterns used here
60 ```62 ```
61 63
62 ```text theme={null}64 ```text wrap theme={null}
63 what are the key data models?65 what are the key data models?
64 ```66 ```
65 67
66 ```text theme={null}68 ```text wrap theme={null}
67 how is authentication handled?69 how is authentication handled?
68 ```70 ```
69 </Step>71 </Step>
85 87
86<Steps>88<Steps>
87 <Step title="Claude に関連ファイルを見つけるよう依頼する">89 <Step title="Claude に関連ファイルを見つけるよう依頼する">
88 ```text theme={null}90 ```text wrap theme={null}
89 find the files that handle user authentication91 find the files that handle user authentication
90 ```92 ```
91 </Step>93 </Step>
92 94
93 <Step title="コンポーネントがどのように相互作用するかについてのコンテキストを取得する">95 <Step title="コンポーネントがどのように相互作用するかについてのコンテキストを取得する">
94 ```text theme={null}96 ```text wrap theme={null}
95 how do these authentication files work together?97 how do these authentication files work together?
96 ```98 ```
97 </Step>99 </Step>
98 100
99 <Step title="実行フローを理解する">101 <Step title="実行フローを理解する">
100 ```text theme={null}102 ```text wrap theme={null}
101 trace the login process from front-end to database103 trace the login process from front-end to database
102 ```104 ```
103 </Step>105 </Step>
108 110
109 * 探しているものについて具体的に説明する111 * 探しているものについて具体的に説明する
110 * プロジェクトのドメイン言語を使用する112 * プロジェクトのドメイン言語を使用する
111 * 言語の[コード インテリジェンス プラグイン](/ja/discover-plugins#code-intelligence)をインストールして、Claude に正確な'定義に移動'と'参照を検索'のナビゲーションを提供する113 * 言語の[コード インテリジェンス プラグイン](/docs/ja/discover-plugins#code-intelligence)をインストールして、Claude に正確な'定義に移動'と'参照を検索'のナビゲーションを提供する
112</Tip>114</Tip>
113 115
114***116***
121 123
122<Steps>124<Steps>
123 <Step title="Claude とエラーを共有する">125 <Step title="Claude とエラーを共有する">
124 ```text theme={null}126 ```text wrap theme={null}
125 I'm seeing an error when I run npm test127 I'm seeing an error when I run npm test
126 ```128 ```
127 </Step>129 </Step>
128 130
129 <Step title="修正の推奨事項をリクエストする">131 <Step title="修正の推奨事項をリクエストする">
130 ```text theme={null}132 ```text wrap theme={null}
131 suggest a few ways to fix the @ts-ignore in user.ts133 suggest a few ways to fix the @ts-ignore in user.ts
132 ```134 ```
133 </Step>135 </Step>
134 136
135 <Step title="修正を適用する">137 <Step title="修正を適用する">
136 ```text theme={null}138 ```text wrap theme={null}
137 update user.ts to add the null check you suggested139 update user.ts to add the null check you suggested
138 ```140 ```
139 </Step>141 </Step>
155 157
156古いコードを最新のパターンとプラクティスを使用するように更新する必要があるとします。158古いコードを最新のパターンとプラクティスを使用するように更新する必要があるとします。
157 159
160コードベース全体を新しい言語に移植する場合は、ブログの[Anthropic が Claude Code で大規模なコード移行を実行する方法](https://claude.com/blog/ai-code-migration)を参照してください。
161
158<Steps>162<Steps>
159 <Step title="リファクタリング対象のレガシーコードを特定する">163 <Step title="リファクタリング対象のレガシーコードを特定する">
160 ```text theme={null}164 ```text wrap theme={null}
161 find deprecated API usage in our codebase165 find deprecated API usage in our codebase
162 ```166 ```
163 </Step>167 </Step>
164 168
165 <Step title="リファクタリングの推奨事項を取得する">169 <Step title="リファクタリングの推奨事項を取得する">
166 ```text theme={null}170 ```text wrap theme={null}
167 suggest how to refactor utils.js to use modern JavaScript features171 suggest how to refactor utils.js to use modern JavaScript features
168 ```172 ```
169 </Step>173 </Step>
170 174
171 <Step title="変更を安全に適用する">175 <Step title="変更を安全に適用する">
172 ```text theme={null}176 ```text wrap theme={null}
173 refactor utils.js to use ES2024 features while maintaining the same behavior177 refactor utils.js to use ES2024 features while maintaining the same behavior
174 ```178 ```
175 </Step>179 </Step>
176 180
177 <Step title="リファクタリングを検証する">181 <Step title="リファクタリングを検証する">
178 ```text theme={null}182 ```text wrap theme={null}
179 run tests for the refactored code183 run tests for the refactored code
180 ```184 ```
181 </Step>185 </Step>
199 203
200<Steps>204<Steps>
201 <Step title="テストされていないコードを特定する">205 <Step title="テストされていないコードを特定する">
202 ```text theme={null}206 ```text wrap theme={null}
203 find functions in NotificationsService.swift that are not covered by tests207 find functions in NotificationsService.swift that are not covered by tests
204 ```208 ```
205 </Step>209 </Step>
206 210
207 <Step title="テストスキャフォルディングを生成する">211 <Step title="テストスキャフォルディングを生成する">
208 ```text theme={null}212 ```text wrap theme={null}
209 add tests for the notification service213 add tests for the notification service
210 ```214 ```
211 </Step>215 </Step>
212 216
213 <Step title="意味のあるテストケースを追加する">217 <Step title="意味のあるテストケースを追加する">
214 ```text theme={null}218 ```text wrap theme={null}
215 add test cases for edge conditions in the notification service219 add test cases for edge conditions in the notification service
216 ```220 ```
217 </Step>221 </Step>
218 222
219 <Step title="テストを実行して検証する">223 <Step title="テストを実行して検証する">
220 ```text theme={null}224 ```text wrap theme={null}
221 run the new tests and fix any failures225 run the new tests and fix any failures
222 ```226 ```
223 </Step>227 </Step>
237 241
238<Steps>242<Steps>
239 <Step title="変更内容を要約する">243 <Step title="変更内容を要約する">
240 ```text theme={null}244 ```text wrap theme={null}
241 summarize the changes I've made to the authentication module245 summarize the changes I've made to the authentication module
242 ```246 ```
243 </Step>247 </Step>
244 248
245 <Step title="プルリクエストを生成する">249 <Step title="プルリクエストを生成する">
246 ```text theme={null}250 ```text wrap theme={null}
247 create a pr251 create a pr
248 ```252 ```
249 </Step>253 </Step>
250 254
251 <Step title="レビューと改善">255 <Step title="レビューと改善">
252 ```text theme={null}256 ```text wrap theme={null}
253 enhance the PR description with more context about the security improvements257 enhance the PR description with more context about the security improvements
254 ```258 ```
255 </Step>259 </Step>
256</Steps>260</Steps>
257 261
258`gh pr create` を使用して PR を作成すると、セッションはその PR に自動的にリンクされます。後で `claude --from-pr 123` で再開するか(123 を PR 番号に置き換えます)、[`/resume` ピッカー](/ja/sessions#use-the-session-picker)の検索に PR URL を貼り付けることで再開できます。262後でセッションを見つけるには、`claude --from-pr 1234` を実行してください。1234 を PR 番号に置き換えてください。これにより、その PR にリンクされたセッションにフィルタリングされたセッションピッカーが開きます。または、[`/resume` ピッカー](/docs/ja/sessions#use-the-session-picker)の検索に PR URL を貼り付けてください。Claude が `gh pr create` または `glab mr create` でプルリクエストを作成するとき、および Claude が[既存の PR で作業する](/docs/ja/agent-view#pull-request-status)ときに、Claude Code はセッションを PR にリンクします。
259 263
260<Tip>264<Tip>
261 Claude が生成した PR を送信する前にレビューし、Claude に潜在的なリスクや考慮事項を強調するよう依頼してください。265 Claude が生成した PR を送信する前にレビューし、Claude に潜在的なリスクや考慮事項を強調するよう依頼してください。
269 273
270<Steps>274<Steps>
271 <Step title="ドキュメント化されていないコードを特定する">275 <Step title="ドキュメント化されていないコードを特定する">
272 ```text theme={null}276 ```text wrap theme={null}
273 find functions without proper JSDoc comments in the auth module277 find functions without proper JSDoc comments in the auth module
274 ```278 ```
275 </Step>279 </Step>
276 280
277 <Step title="ドキュメントを生成する">281 <Step title="ドキュメントを生成する">
278 ```text theme={null}282 ```text wrap theme={null}
279 add JSDoc comments to the undocumented functions in auth.js283 add JSDoc comments to the undocumented functions in auth.js
280 ```284 ```
281 </Step>285 </Step>
282 286
283 <Step title="レビューと改善">287 <Step title="レビューと改善">
284 ```text theme={null}288 ```text wrap theme={null}
285 improve the generated documentation with more context and examples289 improve the generated documentation with more context and examples
286 ```290 ```
287 </Step>291 </Step>
288 292
289 <Step title="ドキュメントを検証する">293 <Step title="ドキュメントを検証する">
290 ```text theme={null}294 ```text wrap theme={null}
291 check if the documentation follows our project standards295 check if the documentation follows our project standards
292 ```296 ```
293 </Step>297 </Step>
324 次のいずれかの方法を使用できます:328 次のいずれかの方法を使用できます:
325 329
326 1. Claude Code ウィンドウに画像をドラッグアンドドロップする330 1. Claude Code ウィンドウに画像をドラッグアンドドロップする
327 2. 画像をコピーして、CLI に Ctrl+V で貼り付ける。macOS では、iTerm2 でも Cmd+V が機能します。331 2. 画像をコピーして、CLI に `Ctrl+V` で貼り付ける。または [`Alt+V` を Windows と WSL で](/docs/ja/interactive-mode#general-controls)使用する
328 3. Claude に画像パスを提供する。例:「Analyze this image: /path/to/your/image.png」332 3. Claude に画像パスを提供する。例:「Analyze this image: /path/to/your/image.png」
329 </Step>333 </Step>
330 334
331 <Step title="Claude に画像を分析するよう依頼する">335 <Step title="Claude に画像を分析するよう依頼する">
332 ```text theme={null}336 ```text wrap theme={null}
333 What does this image show?337 What does this image show?
334 ```338 ```
335 339
336 ```text theme={null}340 ```text wrap theme={null}
337 Describe the UI elements in this screenshot341 Describe the UI elements in this screenshot
338 ```342 ```
339 343
340 ```text theme={null}344 ```text wrap theme={null}
341 Are there any problematic elements in this diagram?345 Are there any problematic elements in this diagram?
342 ```346 ```
343 </Step>347 </Step>
344 348
345 <Step title="コンテキストに画像を使用する">349 <Step title="コンテキストに画像を使用する">
346 ```text theme={null}350 ```text wrap theme={null}
347 Here's a screenshot of the error. What's causing it?351 Here's a screenshot of the error. What's causing it?
348 ```352 ```
349 353
350 ```text theme={null}354 ```text wrap theme={null}
351 This is our current database schema. How should we modify it for the new feature?355 This is our current database schema. How should we modify it for the new feature?
352 ```356 ```
353 </Step>357 </Step>
354 358
355 <Step title="ビジュアルコンテンツからコード提案を取得する">359 <Step title="ビジュアルコンテンツからコード提案を取得する">
356 ```text theme={null}360 ```text wrap theme={null}
357 Generate CSS to match this design mockup361 Generate CSS to match this design mockup
358 ```362 ```
359 363
360 ```text theme={null}364 ```text wrap theme={null}
361 What HTML structure would recreate this component?365 What HTML structure would recreate this component?
362 ```366 ```
363 </Step>367 </Step>
383 387
384<Steps>388<Steps>
385 <Step title="単一ファイルを参照する">389 <Step title="単一ファイルを参照する">
386 ```text theme={null}390 ```text wrap theme={null}
387 Explain the logic in @src/utils/auth.js391 Explain the logic in @src/utils/auth.js
388 ```392 ```
389 393
391 </Step>395 </Step>
392 396
393 <Step title="ディレクトリを参照する">397 <Step title="ディレクトリを参照する">
394 ```text theme={null}398 ```text wrap theme={null}
395 What's the structure of @src/components?399 What's the structure of @src/components?
396 ```400 ```
397
398 これにより、ファイル情報を含むディレクトリリストが提供されます。
399 </Step>401 </Step>
400 402
401 <Step title="MCP リソースを参照する">403 <Step title="MCP リソースを参照する">
402 ```text theme={null}404 ```text wrap theme={null}
403 Show me the data from @github:repos/owner/repo/issues405 Show me the data from @github:repos/owner/repo/issues
404 ```406 ```
405 407
406 これにより、@server:resource 形式を使用して接続された MCP サーバーからデータを取得します。詳細については、[MCP リソース](/ja/mcp#use-mcp-resources)を参照してください。408 これにより、@server:resource 形式を使用して接続された MCP サーバーからデータを取得します。詳細については、[MCP リソース](/docs/ja/mcp#use-mcp-resources)を参照してください。
407 </Step>409 </Step>
408</Steps>410</Steps>
409 411
411 ヒント:413 ヒント:
412 414
413 * ファイルパスは相対パスまたは絶対パスにできます415 * ファイルパスは相対パスまたは絶対パスにできます
416 * @ を入力してパス提案メニューを開き、Enter または Tab キーを押してハイライトされたパスを受け入れ、もう一度 Enter キーを押してメッセージを送信します
414 * @ ファイル参照は、ファイルのディレクトリと親ディレクトリに `CLAUDE.md` を追加してコンテキストに含めます417 * @ ファイル参照は、ファイルのディレクトリと親ディレクトリに `CLAUDE.md` を追加してコンテキストに含めます
415 * ディレクトリ参照はコンテンツではなくファイルリストを表示します418 * ディレクトリ参照はコンテンツではなくファイルリストを表示します
416 * 単一のメッセージで複数のファイルを参照できます(例:「@file1.js and @file2.js」)419 * 単一のメッセージで複数のファイルを参照できます(例:「@file1.js and @file2.js」)
427実行場所に基づいてスケジューリングオプションを選択します:430実行場所に基づいてスケジューリングオプションを選択します:
428 431
429| オプション | 実行場所 | 最適な用途 |432| オプション | 実行場所 | 最適な用途 |
430| :----------------------------------------------- | :--------------------- | :------------------------------------------------------------------------------------------------------------------------------------------- |433| :----------------------------------------------- | :----------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------- |
431| [ルーチン](/ja/routines) | Anthropic 管理インフラストラクチャ | コンピュータがオフの場合でも実行する必要があるタスク。[claude.ai/code/routines](https://claude.ai/code/routines)で設定します。API 呼び出しまたは GitHub イベントに加えてスケジュールでトリガーすることもできます。 |434| [ルーチン](/docs/ja/routines) | クラウド、Anthropic 管理(デフォルト) | コンピュータがオフの場合でも実行する必要があるタスク。[claude.ai/code/routines](https://claude.ai/code/routines)で設定します。スケジュールに加えて API 呼び出しまたは GitHub イベントでトリガーすることもできます。 |
432| [デスクトップスケジュール済みタスク](/ja/desktop-scheduled-tasks) | デスクトップアプリ経由のマシン | ローカルファイル、ツール、またはコミットされていない変更への直接アクセスが必要なタスク。 |435| [デスクトップスケジュール済みタスク](/docs/ja/desktop-scheduled-tasks) | デスクトップアプリ経由のマシン | ローカルファイル、ツール、またはコミットされていない変更への直接アクセスが必要なタスク。 |
433| [GitHub Actions](/ja/github-actions) | CI パイプライン | オープン PR などのリポジトリイベント、またはワークフロー設定と一緒に存在する必要がある cron スケジュールに関連するタスク。 |436| [GitHub Actions](/docs/ja/github-actions) | CI パイプライン | オープン PR などのリポジトリイベント、またはワークフロー設定と一緒に存在する必要がある cron スケジュールに関連するタスク。 |
434| [`/loop`](/ja/scheduled-tasks) | 現在の CLI セッション | セッションが開いている間のクイックポーリング。タスクは新しい会話を開始すると停止します。`--resume` と `--continue` は期限切れでないものを復元します。 |437| [`/loop`](/docs/ja/scheduled-tasks) | 現在の CLI セッション | セッションが開いている間のクイックポーリング。タスクは新しい会話を開始すると停止します。`--resume` と `--continue` は期限切れでないものを復元します。 |
435 438
436<Tip>439<Tip>
437 スケジュール済みタスク用のプロンプトを作成するときは、成功がどのように見えるか、および結果をどうするかについて明示的に説明してください。タスクは自律的に実行されるため、質問を明確にすることはできません。例えば:「`needs-review` ラベルが付いたオープン PR をレビューし、問題に関するインラインコメントを残し、`#eng-reviews` Slack チャネルに要約を投稿します。」440 スケジュール済みタスク用のプロンプトを作成するときは、成功がどのように見えるか、および結果をどうするかについて明示的に説明してください。タスクは自律的に実行されるため、質問を明確にすることはできません。例えば:「`needs-review` ラベルが付いたオープン PR をレビューし、問題に関するインラインコメントを残し、`#eng-reviews` Slack チャネルに要約を投稿します。」
449 質問例452 質問例
450</h4>453</h4>
451 454
452```text theme={null}455```text wrap theme={null}
453can Claude Code create pull requests?456can Claude Code create pull requests?
454```457```
455 458
456```text theme={null}459```text wrap theme={null}
457how does Claude Code handle permissions?460how does Claude Code handle permissions?
458```461```
459 462
460```text theme={null}463```text wrap theme={null}
461what skills are available?464what skills are available?
462```465```
463 466
464```text theme={null}467```text wrap theme={null}
465how do I use MCP with Claude Code?468how do I use MCP with Claude Code?
466```469```
467 470
468```text theme={null}471```text wrap theme={null}
469how do I configure Claude Code for Amazon Bedrock?472how do I configure Claude Code for Amazon Bedrock?
470```473```
471 474
472```text theme={null}475```text wrap theme={null}
473what are the limitations of Claude Code?476what are the limitations of Claude Code?
474```477```
475 478
497claude --continue500claude --continue
498```501```
499 502
500これにより、現在のディレクトリで最新のセッションが再開されます。まだセッションがない場合は、`No conversation found to continue` と出力して終了します。`claude --resume` を使用してリストから選択するか、実行中のセッション内から `/resume` を使用してください。[セッションを管理する](/ja/sessions)を参照して、名前付け、ブランチ、および完全なピッカーリファレンスを確認してください。503これにより、現在のディレクトリで最新のセッションが再開されます。まだセッションがない場合は、`No conversation found to continue` と出力して終了します。`claude --resume` を使用してリストから選択するか、実行中のセッション内から `/resume` を使用してください。[セッションを管理する](/docs/ja/sessions)を参照して、名前付け、ブランチ、および完全なピッカーリファレンスを確認してください。
501 504
502<h2 id="run-parallel-sessions-with-worktrees">505<h2 id="run-parallel-sessions-with-worktrees">
503 worktree を使用して並列セッションを実行する506 worktree を使用して並列セッションを実行する
504</h2>507</h2>
505 508
5061 つのターミナルで機能に取り組みながら、別のターミナルで Claude がバグを修正するようにします。編集が衝突しないようにしてください。各 worktree は独自のブランチ上の個別のチェックアウトです。5091 つのターミナルで機能に取り組みながら、別のターミナルで Claude がバグを修正するようにします。編集が衝突しないようにしてください。各 [git worktree](https://git-scm.com/docs/git-worktree) は既存のコミットから作成された独自のブランチ上の個別のチェックアウトです。そのため、リポジトリには最初に少なくとも 1 つのコミットが必要です。
507 510
508```bash theme={null}511```bash theme={null}
509claude --worktree feature-auth512claude --worktree feature-auth
510```513```
511 514
512別の名前で 2 番目のターミナルで同じコマンドを実行して、分離された並列セッションを開始します。[Worktrees](/ja/worktrees)を参照して、クリーンアップ、`.worktreeinclude`、および非 git VCS サポートを確認してください。1 つの画面から並列セッションを監視するには、[バックグラウンドエージェント](/ja/agent-view)を参照してください。515別の名前で 2 番目のターミナルで同じコマンドを実行して、分離された並列セッションを開始します。コミットがないリポジトリでは、コマンドは `Failed to resolve base branch "HEAD": git rev-parse failed` というエラーで失敗します。クリーンアップ、`.worktreeinclude`、および非 git VCS サポートについては、[Worktrees](/docs/ja/worktrees) を参照してください。1 つの画面から並列セッションを監視するには、別のターミナルではなく、[バックグラウンドエージェント](/docs/ja/agent-view) を参照してください。
513 516
514<h2 id="plan-before-editing">517<h2 id="plan-before-editing">
515 編集前に計画する518 編集前に計画する
516</h2>519</h2>
517 520
518ディスクに変更を加える前に確認したい変更については、計画モードに切り替えてください。Claude はファイルを読み込んで計画を提案しますが、承認されるまで編集は行いません。521ディスクに変更を加える前に確認したい変更については、計画モードに切り替えてください。Claude はファイルを読み込んで計画を提案しますが、承認されるまで編集は行いません。ステータスバーは計画モードがアクティブな間、`⏸ plan mode on` と表示されます。
519 522
520```bash theme={null}523```bash theme={null}
521claude --permission-mode plan524claude --permission-mode plan
522```525```
523 526
524セッション中に `Shift+Tab` を押して計画モードに切り替えることもできます。[計画モード](/ja/permission-modes#analyze-before-you-edit-with-plan-mode)を参照して、承認フローとテキストエディタで計画を編集することを確認してください。527セッション中に `Shift+Tab` を押してステータスバーが `⏸ plan mode on` と表示されるまで切り替えることもできます。承認フローとテキストエディタで計画を編集する方法については、[計画モード](/docs/ja/permission-modes#analyze-before-you-edit-with-plan-mode)を参照してください。
525 528
526<h2 id="delegate-research-to-subagents">529<h2 id="delegate-research-to-subagents">
527 研究を subagent に委譲する530 研究を subagent に委譲する
529 532
530大規模なコードベースの探索はコンテキストをファイル読み込みで満たします。探索を委譲して、結果のみが戻るようにしてください。533大規模なコードベースの探索はコンテキストをファイル読み込みで満たします。探索を委譲して、結果のみが戻るようにしてください。
531 534
532```text theme={null}535```text wrap theme={null}
533use a subagent to investigate how our auth system handles token refresh536use a subagent to investigate how our auth system handles token refresh
534```537```
535 538
536subagent は独自のコンテキストウィンドウでファイルを読み込み、要約を報告します。[Subagents](/ja/sub-agents)を参照して、独自のツールとプロンプトを持つカスタムエージェントを定義することを確認してください。539subagent は独自のコンテキストウィンドウでファイルを読み込み、要約を報告します。[Subagents](/docs/ja/sub-agents)を参照して、独自のツールとプロンプトを持つカスタムエージェントを定義することを確認してください。
537 540
538<h2 id="pipe-claude-into-scripts">541<h2 id="pipe-claude-into-scripts">
539 Claude をスクリプトにパイプする542 Claude をスクリプトにパイプする
545git log --oneline -20 | claude -p "summarize these recent commits"548git log --oneline -20 | claude -p "summarize these recent commits"
546```549```
547 550
548[非対話モード](/ja/headless)を参照して、出力形式、許可フラグ、およびファンアウトパターンを確認してください。551[非対話モード](/docs/ja/headless)を参照して、出力形式、許可フラグ、およびファンアウトパターンを確認してください。
549 552
550<h2 id="next-steps">553<h2 id="next-steps">
551 次のステップ554 次のステップ
552</h2>555</h2>
553 556
554<CardGroup cols={2}>557<CardGroup cols={2}>
555 <Card title="ベストプラクティス" icon="lightbulb" href="/ja/best-practices">558 <Card title="ベストプラクティス" icon="lightbulb" href="/docs/ja/best-practices">
556 Claude Code から最大限の価値を得るためのパターン559 Claude Code から最大限の価値を得るためのパターン
557 </Card>560 </Card>
558 561
559 <Card title="セッションを管理する" icon="rotate-left" href="/ja/sessions">562 <Card title="セッションを管理する" icon="rotate-left" href="/docs/ja/sessions">
560 会話を再開、名前付け、ブランチする563 会話を再開、名前付け、ブランチする
561 </Card>564 </Card>
562 565
563 <Card title="Worktrees" icon="code-branch" href="/ja/worktrees">566 <Card title="Worktrees" icon="code-branch" href="/docs/ja/worktrees">
564 分離された並列セッションを実行する567 分離された並列セッションを実行する
565 </Card>568 </Card>
566 569
567 <Card title="Claude Code を拡張する" icon="puzzle-piece" href="/ja/features-overview">570 <Card title="Claude Code を拡張する" icon="puzzle-piece" href="/docs/ja/features-overview">
568 skill、フック、MCP、subagent、プラグインを追加する571 skill、フック、MCP、subagent、プラグインを追加する
569 </Card>572 </Card>
570</CardGroup>573</CardGroup>