← Academy 日本語で学ぶ(一覧へ戻る)

claude code 101

Anthropic Academy コースの日本語ナレッジ(学習用)/ 全 14 項目

Claude Code 101 | 日本語ナレッジ(全13レッスン)

出典: Anthropic Academy コース「Claude Code 101」(英語)を中嶋直喜さんの学習用に日本語ナレッジ化 / 2026-07-04

コース概要

Claude Code の入門コース。Claude Code とは何かという基礎から、インストール・最初のプロンプト・中核ワークフロー(explore → plan → code → commit)・コンテキスト管理・コードレビューといった日常運用、さらに CLAUDE.md / subagents / MCP / hooks / skills という拡張・カスタマイズの5本柱までを、短いレッスンで一通りカバーする。

一言で言えば:Claude Code は agentic loop(プロンプト → コンテキスト収集 → アクション → 検証 → ループ) で動くターミナル型コーディングエージェント。効果的に使う鍵は コンテキストウィンドウを意識して管理することと、繰り返しや保証したい挙動を仕組み化すること(CLAUDE.md=記憶、hooks=決定論的な強制、skills=オンデマンドの専門知識、subagents=別コンテキストへの委譲)。

各ノートの形式(3層)

  1. 日本語ナレッジ(要点整理) — 箇条書きの要点。設定キー・コマンド・フラグは英語のまま正確に。
  2. 日本語(本文の自然な全訳) — コース本文の省略なしの全訳。コード例は原文のまま。
  3. 英語逐語(動画字幕 or 本文原文) — 動画字幕のテキスト(無い回は本文英語原文)。

目次

# ファイル レッスン 一言
01 01_what_is_claude_code.md Claude Code とは? ファイル・ターミナル・コードベースに直接アクセスする AI エージェント
02 02_how_claude_code_works.md Claude Code の仕組み agentic loop・context・tools・permissions の4要素
03 03_installing_claude_code.md インストール terminal / VS Code / JetBrains / Desktop / web の導入手順
04 04_your_first_prompt.md 最初のプロンプト Shift+Tab で auto-accept / approval / Plan Mode を切替
05 05_explore_plan_code_commit.md explore→plan→code→commit このコース最重要の中核ワークフロー
06 06_context_management.md コンテキスト管理 /compact・/clear・/context と節約の3コツ
07 07_code_review.md コードレビュー サブエージェントレビュー・/commit-push-pr・--from-pr
08 08_claude_md_file.md CLAUDE.md ファイル プロジェクトの永続記憶。project / user の階層。/init
09 09_subagents.md サブエージェント 別コンテキストで委譲。/agents で自作。built-in 3種
10 10_mcp.md MCP 外部ツール接続の標準。claude mcp add・スコープ・context コスト
11 11_hooks.md フック 決定論的にコマンド強制。PreToolUse でブロック、PostToolUse で整形
12 12_skills.md スキル オンデマンドに読み込む専門知識。SKILL.md・description が鍵
13 13_course_quiz.md コースクイズ 修了クイズ(受験は Academy 上で別途)

補足

  • 字幕の自動文字起こしでは「Claude」→「Cloud」、「CLAUDE.md」→「claw.md」、「Model Context Protocol」→「Model contact protocol」などの誤認識が散見される。各ノートで注記済み。読み替えて理解すること。
  • Lesson 07(Code review)の動画は BGM のみ・ナレーション無しのため、英語逐語欄は本文原文を掲載。
  • Lesson 12(Skills)の本文はリンクのみのため、内容は動画字幕を主体に構成。
  • Lesson 09(Subagents)と Lesson 12(Skills)には、それぞれ専用の続編コース(Introduction to subagents / Introduction to agent skills)がある。
↑ 目次へ戻る

Claude Code 101 | Lesson 01「Claude Code とは?(What is Claude Code?)」

出典: Anthropic Academy / YouTube動画ID fl1DSmwQKKY / 2026-07-04

日本語ナレッジ(要点整理)

  • Claude Code はエージェント型(agentic)のコーディングツール。あなたのコードベースを理解し、ファイルを編集し、コマンドを実行し、既存の開発ツールと連携して、作業を速く終わらせる。
  • 利用できる場所:terminal / Visual Studio Code / Claude Desktop アプリ / web / JetBrains IDE
  • Claude.ai との決定的な違い:Claude.ai と違い、Claude Code は あなたのファイル・terminal・コードベース全体に直接アクセスする。コードをコピペで往復させるのではなく、Claude Code 自身が中に入って作業する。
  • 差別化の核心=Claude Code は「AI Agent(AIエージェント)」として動くこと。
  • AI Agent とは:自分の環境とやり取りし、定めたゴールを達成するためにアクション(行動)を起こせるソフトウェア。中核は「大規模言語モデル(LLM)がリアルタイムでループを回す」仕組み。エージェントは tools(ツール)・外部サービス・他の AI Agent などにアクセスしてゴールに近づく。
  • Claude Code が実際にできること
  • コードベースを読んで理解する(機能の説明、コード全体にまたがるバグの追跡)
  • プロジェクト横断でファイルを編集する(関数のリファクタと、それを参照する全ファイルの更新)
  • terminal コマンドを実行する(build スクリプト、テスト実行、パッケージのインストール。その出力を見て次の判断をする)
  • web を検索する(ドキュメントや最新の API リファレンスを自分で調べる)
  • 効果的に使うための3つの前提: 1. The context window(コンテキストウィンドウ)=Claude の作業記憶。大量に保持できるが「全部を一度に」は無理。だからこそ agentic =コードベース全体を読み込まずに、答えを戦略的に探す動きになる。 2. 許可を求める(It asks for permission):デフォルトでは、コマンド実行やコード変更の前に必ず確認してくる。ハンズオンでもハンズオフでも、常に主導権はあなたにある。 3. 間違えることがある(It can make mistakes):意図の取り違え、新しいバグの混入、過剰な作り込み(over-engineer)が起きうる。ループの中に居続ければ早期に気づける。

日本語(本文の自然な全訳)

Claude Code とは?

Claude Code はエージェント型のコーディングツールです。あなたのコードベースを理解し、ファイルを編集し、コマンドを実行し、既存の開発ツールと連携して、より速く物事を片づける手助けをします。terminal、Visual Studio Code、Claude Desktop アプリ、web、そして JetBrains IDE で利用できます。

Claude Code と Claude の違いは?

もし以前 Claude.ai を使ったことがあるなら、この2つは何が違うのだろうと思うかもしれません。Claude.ai と違い、Claude Code はあなたのファイル・terminal・コードベース全体に直接アクセスします。コードを行ったり来たりコピー&ペーストする代わりに、Claude Code 自身が中に入り込んで作業をこなします。

決定的な違いは、Claude Code が AI Agent として機能するという点です。

Agent(エージェント)とは?

AI Agent とは、自分の環境とやり取りし、定義されたゴールを達成するためにアクションを実行できるソフトウェアです。その中核は、大規模言語モデルがリアルタイムでループを回すことによって成り立っています。AI Agent は、ゴールに到達するために、tools・外部サービス・さらには他の AI Agent にアクセスできます。

Claude Code は実際に何ができる?

実際にはこういう形になります。

  • コードベースを読んで理解する。ある機能を説明してもらったり、コード全体にわたるバグを追跡してもらったりできます。
  • プロジェクト全体でファイルを編集する。ある関数をリファクタし、それを参照するすべてのファイルを更新できます。
  • terminal コマンドを実行する。build スクリプトを走らせ、テストを実行し、パッケージをインストールし、その出力を使って次にどうするかを判断できます。
  • web を検索する。ドキュメントや最新の API リファレンスが必要なら、自分で調べてくれます。

Claude Code を効果的に使う

Claude Code を効果的に使うには、次の3つの概念を頭に入れておきましょう。

The context window(コンテキストウィンドウ)。これは Claude の作業記憶だと考えてください。多くを保持できますが、すべてを一度には無理です。ここで「agentic(エージェント的)」な側面が効いてきます——Claude はコードベース全体をコンテキストに読み込むことなく、その中から答えを見つける戦略的な方法を探します。

許可を求める(It asks for permission)。デフォルトでは、Claude Code はコマンドの実行や変更の前にあなたに確認します。ハンズオン(自分で細かく関わる)でもハンズオフ(任せる)でも、主導権は常にあなたにあります。

間違えることがある(It can make mistakes)。どんなツールとも同じで、Claude Code も完璧ではありません。意図を取り違えたり、バグを混入させたり、解決策を過剰に作り込んだりすることがあります。ループの中に居続けることで、こうしたことを早めに捕まえられます。

まとめ

Claude Code はエージェント型のコーディングツールです。コードベースを読み、ファイルを編集し、コマンドを実行し、外部ツールに接続して、あなたがより速く出荷(ship)できるよう手助けします。今日から terminal、VS Code、JetBrains、Claude Desktop アプリで使えます。

英語逐語(動画字幕)

Claude Code is [music] an agentic coding tool that understands your code base, edits your files, run commands, and integrates with your existing developer tools to help you get things done faster. It's available in your terminal, Visual Studio Code, the Claude desktop app, on the web, and JetBrains IDEs.

>> But, we'll be using it in the terminal for this video.

If you've ever used Claude AI, you're probably wondering what the difference is between the two. Unlike Claude AI, Claude Code has direct access to your files in your terminal and your entire code base. So, instead of copying and pasting code back and forth, it can go in and do all the work itself. The easiest differentiator is that Claude Code works as an AI agent.

An AI agent is a software that can interact with its environment and perform actions to complete a defined goal. The most basic way this can be done is by having a large language model in a loop in real time. AI agents have access to things like tools, external services, or other AI agents to help it reach its predefined goals.

So, what does that actually look like? Well, here's a couple of examples. It can read and understand your code base. You can ask Claude Code to explain a feature or trace a bug throughout your code. Claude Code can execute your build script, run your tests, install packages, and use the output to decide what to do next.

Claude Code can search the web. If it needs documentation on the latest API references, for example, it can do that for you.

To use Claude Code effectively, it's important to know these concepts. First is the context window. Think of this as Claude's working memory. It can hold a lot, but not everything at once. This is where the agentic aspect of it comes in. Finding strategic ways to find the answers within your code base without storing your entire code base into context.

Second is that it asks for permission. By default, Claude Code will ask you before running commands or making changes to your code base. You're always in control, whether that's being more hands-on or passive. Third, it can make mistakes. Just like any tool, Claude Code isn't perfect. It might misunderstand your intent, introduce a new bug, or over-engineer a solution.

Quick recap. Claude Code is an agentic coding tool. It reads your code base, edits your files, runs commands, [music] and connects to external tools to help you ship faster. You can download it today in your terminal, VS Code, JetBrains, [music] and the Claude desktop app.
↑ 目次へ戻る

Claude Code 101 | Lesson 02「Claude Code の仕組み(How Claude Code works)」

出典: Anthropic Academy / YouTube動画ID 6bs5b4FltCU / 2026-07-04

日本語ナレッジ(要点整理)

  • Claude Code は普通のチャットアプリとは違う。内部の仕組みを理解すると使いこなしやすくなる
  • The Agentic Loop(エージェントループ) が Claude Code の本質。手順は次の通り: 1. あなたが Claude Code にプロンプトを入力する。 2. Claude が必要なコンテキストを集める。モデルとやり取りし、モデルは テキスト or tool call(ツール呼び出し) を返す。Claude Code はその tool call を実行できる。 3. アクションを取る(例:ファイル編集、コマンド実行)。 4. 結果を検証し、プロンプトの目的を達成できたか判断する。 5. 達成できていれば終了して次のプロンプトを待つ。できていなければループに戻って、結果が完全かつ検証可能になるまで再試行する。
  • ループの最中、あなたは コンテキストを追加・中断(interrupt)・軌道修正(steer) して、ゴールへ導ける。
  • Context(コンテキスト):会話・ファイル内容・コマンド出力などをどれだけ保持・参照できるかを決める枠。上限に達すると Claude Code は会話を compact(圧縮) する=残せるもの/要約できるものを自動判定して、コンテキストウィンドウを使える大きさまで戻す。
  • Tools(ツール)=エージェントの背骨。多くの AI アシスタントは「テキスト入力→テキスト出力」だけ。ツールがあることで、Claude Code はいつコードを実行してタスクに近づくかを判断できる(ファイル読み取り、web 検索など)。Claude Code は意味的理解(semantic understanding)でツールを呼ぶタイミングと使い方を決める。
  • Permissions(許可モード)
  • Default behavior:ファイル編集や shell コマンド実行の前に明示的な許可を求める。
  • Auto-accept:ファイル編集は確認なしで実行するが、コマンドは依然として承認が必要。
  • Plan moderead-only(読み取り専用)ツールで、作業開始前にアクションの計画を組み立てる。
  • すべて settings ファイルで設定可能。許可をスキップする(free rein を与える)ときは要注意——ミスが起きる前に捕まえにくくなる。

日本語(本文の自然な全訳)

Claude Code は一般的なチャットアプリケーションとは異なります。内部でどう動いているかを理解すると、より効果的に使えるようになります。

The Agentic Loop(エージェントループ)

Claude Code は、エージェントループを通して説明するのが一番わかりやすいです。

  1. あなたが Claude Code にプロンプトを入力します。
  2. Claude はモデルとやり取りして、必要なコンテキストを集めます。モデルは、Claude Code が実行できるテキストまたは tool call(ツール呼び出し)を返します。
  3. アクションを取ります——たとえばファイルを編集する、コマンドを実行する、など。
  4. 結果を検証し、そもそもプロンプトが達成しようとしていたことを実現できたかを判断します。
  5. 達成できていれば、Claude は終了して次のプロンプトを待ちます。できていなければ、結果が完全で検証可能になるまで、ループに戻って再び回します。

このループの間ずっと、あなたはコンテキストを追加したり、中断したり、モデルを軌道修正したりして、ゴールへ導くことができます。

Context(コンテキスト)

Claude にはコンテキストウィンドウがあり、会話・ファイル内容・コマンド出力などをどれだけ保持し参照できるかが決まります。その上限に達すると、Claude Code は会話を compact(圧縮)します——何を取り除けるか、何を要約できるかを自動的に判断し、コンテキストウィンドウを使えるサイズまで戻します。

Tools(ツール)

ツールはエージェントの動作の背骨です。ほとんどの AI アシスタントは、単にテキストを入力してテキストを出力するだけです。ツールがあることで、Claude Code はタスクの完了に近づくために、いつコードを実行すべきかを判断できます。これはファイル読み取りツールでも、web 検索ツールでも、その他あらゆる能力でもありえます。Claude Code は意味的理解を用いて、いつツールを呼び、その出力をどう使うかを決めます。

Permissions(許可)

Claude Code にはいくつかの許可モードがあります。

  • Default behavior(デフォルトの挙動):ファイルを編集したり shell コマンドを実行したりする前に、Claude は明示的な許可を求めます。
  • Auto-accept(自動承認):ファイルは確認なしで編集されますが、コマンドは依然として承認が必要です。
  • Plan mode(プランモード):read-only(読み取り専用)ツールを使って、作業を始める前にアクションの計画を組み立てます。

これらはすべて settings ファイルで設定できます。許可をスキップするときは注意してください——Claude Code にコマンド実行の自由を与えるということは、ミスが起きる前に捕まえるのが難しくなるということです。

まとめ

Claude Code は、いくつかのエージェント的な概念を組み合わせています——エージェントループ、管理されたコンテキストウィンドウ、ツール、そして設定可能な許可——それらすべてを terminal の中で実現します。コードベースを読み、アクションを取り、自分の作業を検証できます。それこそが、チャットウィンドウとは根本的に違う点です。

英語逐語(動画字幕)

We know that Claude code is different from usual chat applications, but how does it work? Claude code is best explained through the agentic loop.

You enter a prompt into Claude code. Claude code will then gather contacts required to complete your prompt. It does so by interacting with the model which will return text or a tool call that Claude code can execute. Then it takes action. For example, editing a file or running a command. Finally, it verifies those results and determines if they achieve what your prompt set out to do in the first place. If they do, then Claude finishes and waits for the next prompt. And if they don't, Claude goes back and runs the loop again until the results are complete and verifiable. Throughout this loop, you're able to add contacts, interrupt it, or steer the model to help guide it towards your end goal.

Claude has a context window, which determines how much of your conversation, file contents, command outputs, and more it can store and look back on. Once you reach that limit, Claude code compacts your conversation, which automatically determines what it can take out of the context window and what it can summarize in order to bring the context window back down.

Tools are the backbone of how agents work. Currently, most AI assistants are simply input text and output text. Nothing in between. Tools let Claude code and other agents determine when to execute code to get closer to a task. This could be read file tool or search web tool, for example. Claude code uses semantic searching to determine when to call a tool and get the output of it.

Claude code also has permission modes. Default behavior is that it has to ask explicit permission before editing a file or running a shell command. You can use shift and tab to toggle between different modes. Auto accept edits files without asking, but still ask for commands. Plan mode uses read-only tools to help compile a plan of action before starting. It's worth being cautious when skipping permissions. Giving Claude code free reign to run commands means a mistake could be harder to catch before even happens.

Claude code works by combining different agentic concepts, an agentic loop, a managed context window, tools, and configurable permissions into your terminal. It can read your code base, take action, and verify its own work, and that makes it fundamentally different from a chat window.
↑ 目次へ戻る

Claude Code 101 | Lesson 03「Claude Code のインストール(Installing Claude Code)」

出典: Anthropic Academy / YouTube動画ID 0kILa02vKuI / 2026-07-04

日本語ナレッジ(要点整理)

  • terminal・web・IDE のどこでも簡単に導入できる
  • Terminal(macOS / Linux / WSL)curl コマンドで一発インストール。brew install(Homebrew)でも入るが、Homebrew 経由は auto-update に非対応
  • Terminal(Windows):PowerShell は Invoke-RestMethod、CMD は curlwinget もあるが、Homebrew と同様に auto-update しない
  • インストール後は claude コマンドが使えるはず。ダメなら terminal を再起動。プロジェクトディレクトリへ移動して claude を実行。
  • 初回は カラーテーマ選択 → Claude アカウント(Pro / Max / Enterprise)でサインイン or API key の手順。組織が Claude Enterprise を持っているなら必ず Enterprise を選ぶこと。
  • claude を実行したディレクトリと、その全サブフォルダにアクセス権を持つ
  • Visual Studio Code:Extensions パネルで「Claude Code」を検索 → Anthropic 製・青い認証チェック付きを install → 必要なら VS Code 再起動 → コマンドパレット(Ctrl/Cmd + Shift + P)で「Claude Code: Open in New Tab」。サイドバーの Claude ロゴからでも開ける。settings で UI を使わず terminal 体験に切り替えも可能。
  • JetBrains:JetBrains Marketplace から Claude Code プラグインを install → IDE 再起動 → Claude ロゴをクリックすると terminal 体験のペインが開き、エディタと並行して動く。
  • Desktop:Claude Desktop にサインインすると上部に「Code」トグル。特定フォルダで作業、権限変更、cloud 環境での作業もできる。
  • Webclaude.ai/code、またはチャットアプリのサイドバーの「Code」から。デスクトップ版に近いが、GitHub リポジトリに限定される。
  • どれを使うべき?
  • 最先端を追うなら terminal(新機能が最速で来る)。
  • IDE 統合はエディタと一体化した体験がほしい人向け(terminal とほぼ同等)。
  • Desktop はバックグラウンドで走らせつつ別作業をしたいとき。
  • Web は GitHub リポジトリ経由でリモート作業したいとき、複数セッションの並行実行にも。

日本語(本文の自然な全訳)

Claude Code は、terminal でも web でも IDE でも、簡単にインストールできます。

Terminal

macOS、Linux、WSL では、curl コマンドで一発インストールできます。Homebrew が好みなら brew install でも入れられますが、この方法は auto-update(自動更新)に対応していない点に注意してください。

Windows ではいくつか選択肢があります。PowerShell では Invoke-RestMethod コマンド、CMD では curl コマンドを使います。winget コマンドもありますが、Homebrew と同様に auto-update はしません。

インストール後は claude コマンドが実行できるはずです。できない場合は terminal を再起動してください。プロジェクトのディレクトリに移動して、次を実行します。

claude

カラーテーマを選び、Claude アカウント(Pro、Max、または Enterprise)でサインインする、あるいは API key を使う、といった初期セットアップの手順を進めます。あなたの組織が Claude Enterprise アカウントを持っているなら、必ずそのオプションを選んでください。claude を実行したディレクトリが何であれ、Claude Code はそのディレクトリとすべてのサブフォルダにアクセスできます。

Visual Studio Code

Extensions パネルを開いて「Claude Code」を検索します。青い認証チェックが付いた Anthropic の拡張機能を探して、install を押します。インストール後、VS Code の再起動が必要な場合があります。起動したら、コマンドパレットを Ctrl/Cmd + Shift + P で開き、「Claude Code: Open in New Tab」を検索します。サイドバーに Claude ロゴが見えていれば、それをクリックしても開けます。

VS Code 拡張は、terminal とよく似た体験を提供します。settings で UI を使わず、terminal 体験を直接使うこともできます。

JetBrains

JetBrains Marketplace から Claude Code プラグインをインストールします。インストール後、IDE を再起動します。再度開くと Claude ロゴが表示され、それをクリックすると terminal 体験のペインが開き、エディタと並行して動作します。

Desktop

Claude Desktop をインストールしてサインインすると、上部に「Code」というトグルが表示されます。見た目や操作感はチャット側と似ていますが、特定のフォルダで作業したり、権限を変えたり、cloud 環境で作業したりできます。

Web

web では、claude.ai/code にアクセスするか、チャットアプリのサイドバーで「Code」ラベルをクリックすると Claude Code にアクセスできます。デスクトップアプリと似た動きですが、GitHub リポジトリに限定されます。

どれを使うべき?

最先端を追いたいなら terminal が一番です——新機能はまずそこに来ます。IDE 統合は、Claude Code をコードエディタとより一体化させたいなら、ほぼ同じ体験を提供します。

Desktop は、他のタスクをこなしながら Claude をバックグラウンドで走らせるのに向いています。web 版の Claude Code は、GitHub リポジトリ経由でプロジェクトをリモートで扱いたいときの手堅い選択肢です。

Claude Code をどう使うかは、あなた次第です。

英語逐語(動画字幕)

注:字幕の自動文字起こしでは「Claude」がしばしば「Cloud」と誤認識されています。読み替えてください。

Cloud Code is simple to install whether you want to use it in your terminal, the web, or your IDE.

If you're on macOS, Linux, or WSL, use this curl command to install it in one go. If you prefer to use Homebrew, you can also use brew install to install it, but note that this doesn't have auto-update capabilities. For Windows, there's also a couple ways. In PowerShell, use the Invoke-RestMethod command. If you're on CMD, you can also use this curl command. We also have a winget command as well if you prefer, but just like Homebrew, it won't auto-update.

Now, go to your project directory and run Cloud. You will go through some initial instructions like choosing your color theme and signing in with your Cloud account, which could be the Pro, Max, or Enterprise. Or you can use an API key. If your organization has a Cloud Enterprise account, be sure to select that option. Whatever directory you decide to run Cloud in, it will have access to that directory and all of its subfolders.

In Visual Studio Code, open up your extensions panel and search for Cloud Code. You will see the extension by Anthropic. Make sure it has the blue check and hit install. After installation, you might need to restart VS Code. After that, you can open up the control palette with control or command and shift and P and search Cloud Code. Open a new tab. You can also click on the Cloud logo if you see it when a file is open. You can also opt out of the UI and just use the terminal experience directly in your settings file.

For JetBrains IDEs, you can install the Cloud Code plugin from the JetBrains Marketplace. Once you install, restart your IDE. And when you reopen, you'll see the Cloud logo. This will open up a pane where you can see the terminal experience. And this will work alongside you.

On Cloud Desktop, you can also run Cloud Code. After you install Cloud Desktop and signed in, you will see a toggle at the top that says code. The look and feel is similar to Claude chat side of things, but allows you to work in a specific folder, change permissions, and even work in a cloud environment.

On the web, you can access Claude code by going to claude.ai/code. This works very similar to the desktop app. However, you're restricted to GitHub repositories only.

If you want to constantly keep up to date with everything, the terminal is the best bet. Features ship there the fastest. For the most part, you'll have extremely similar experiences with the IDE integrations if you like Claude code to feel more intertwined with your favorite code editor. Desktop is great for letting Claude run in the background while you run other tasks. Claude code on the web is a great option if you want to remotely work on a project through a GitHub repository or have multiple sessions work in parallel. However, you want to use Claude code, it's up to you.
↑ 目次へ戻る

Claude Code 101 | Lesson 04「最初のプロンプト(Your first prompt)」

出典: Anthropic Academy / YouTube動画ID gbetp6D7J_Q / 2026-07-04

日本語ナレッジ(要点整理)

  • Claude Code には普通の AI アシスタントと同じように話しかける。プロンプトを打つとき、自分を守りつつ作業を楽にするいくつかのコツがある。
  • Auto-Accept vs. Approval(自動承認 vs. 都度承認)Shift + Tab でモードを循環切り替え。
  • Approval mode:ファイル編集やコマンド実行のたびに許可を求める。
  • Auto-accept mode:ファイル編集は自動承認、ただしコマンドは依然として許可が必要
  • 正解/不正解はない。自分が快適なほうでよい
  • Plan Mode(プランモード)Shift + Tab メニューの中にある。プロンプトを受けて read-only ツールでコードベースを分析し、提案した実装をリサーチする。途中で確認質問をしてきて、実行可能な詳細な計画を返す。
  • 複雑な変更の計画や、安全なコードレビューに最適。多くの場合、機能に向けた複数ステップの実装を頼むことになり、まさに Plan Mode が得意とする場面。
  • 例:ダークモードのトグルを追加する——プロジェクトのルートで claude を起動 → Shift + Tab を数回押して Plan Mode に入る → 具体的なプロンプトを書く(下記本文参照)→ 計画を確認 → 良ければ approve → 各ステップで承認を求めさせる → 最後に Claude が何をどうやったかを正確に確認できる。
  • 要点:プロンプトはできる限り具体的に。各ステップで関わり続けたいならそうできる。実装前に Claude に詳細を掘らせたいなら Plan Mode を使う。

日本語(本文の自然な全訳)

Claude Code には、どの AI アシスタントとも同じように話しかけます。プロンプトを入力するとき、自分を守り、同時に作業を楽にするために考えておくとよいことがいくつかあります。

Auto-Accept vs. Approval(自動承認 vs. 承認)

Claude が提案するファイル変更をすべて自動で受け入れるか、それとも毎回明示的な許可を求めさせるかを選べます。Shift + Tab を押すと、モードを循環的に切り替えられます。

  • Approval mode(承認モード):Claude はファイルを編集したりコマンドを実行したりするたびに許可を求めます。
  • Auto-accept mode(自動承認モード):ファイル編集は自動的に承認されますが、コマンドは依然としてあなたの許可が必要です。

正解も不正解もありません——自分が快適に感じるものでかまいません。

Plan Mode(プランモード)

Shift + Tab メニューの中に Plan Mode があります。Plan Mode はあなたのプロンプトを受け取り、read-only(読み取り専用)ツールを使ってコードベースを分析し、提案した実装をリサーチします。途中で、明確化したい点について質問してきます。そして、より詳細に実行できる、詳しい計画を返してくれます。

Plan Mode は、複雑な変更の計画を立てたり、安全なコードレビューをしたりするのに最適です。多くの場合、あなたは Claude に機能に向けた複数ステップの実装を頼むことになります。まさにそこが Plan Mode の得意とするところです。

例:ダークモードのトグルを追加する

例を一つ見てみましょう。ダークモードのトグルが必要なアプリケーションがあるとします。プロジェクトのルートディレクトリを開いて claude を実行します。Shift + Tab を数回押して Plan Mode に入り、次のようなプロンプトを書きます。

My app needs a dark mode implemented across the entire app. Can you create a toggle switch on the header that allows a user to toggle between light mode and dark mode? I need you to find a good contrast color that works based on my existing light theme.

(訳:アプリ全体にダークモードを実装したい。ヘッダーにライトモードとダークモードを切り替えられるトグルスイッチを作ってほしい。既存のライトテーマに合う、良いコントラストの色を見つけてほしい。)

Claude に計画を立てさせます。計画を確認して、良さそうなら approve(承認)し、各ステップで Claude に承認を求めさせます。最後に、Claude が正確に何をして、どうやってその結論に至ったかを確認できます。

まとめ

Claude Code を使うときは、プロンプトをできる限り具体的に書くようにしましょう。すべてのステップで関わり続けたいなら、そうできます。Plan Mode を使えば、コードを実行する前に、達成したいことの詳細まで Claude に深く掘らせることができます。

英語逐語(動画字幕)

You talk to Claude Code like you would talk to any AI assistant. When entering your prompt, here are some things that you can consider that can both protect and make things easier for you.

You can choose whether Claude auto accepts every file change it suggests or require it to ask you for explicit permission each time. With shift plus tab, you can cycle between both modes. In auto accept mode, it will automatically approve an edit or creation of a file, but ask your permission to run commands. There isn't a right or wrong way. It's just whatever you feel the most comfortable with.

Within this shift tab menu is the plan mode. Plan mode takes your prompt and uses read-only tools to analyze your code base and do research on your suggested implementation. It will also ask you questions on items that it wants clarification on. It then returns to you a long detailed plan that it can execute on in more detail. Plan mode works great for planning complex changes or doing a safe code review. A lot of the time you're asking Claude to do multi-step implementations towards a feature and this is exactly what plan mode excels at. So, why don't we give it a try?

I have an application here that desperately needs a dark mode toggle. So, I'm going to use Claude Code to implement this for me. So, I'm in the root directory of my project and I'm going to hit the shift tab a couple times to go into plan mode. Then, let's write out the prompt. My app needs a dark mode implemented across the entire app. Can you create a toggle switch on the header that allows user to toggle between light mode and dark mode? I need you to find a good contrast color that works based on my existing light theme. And let's let Claude plan this out. And after reviewing, I think it looks pretty good. At the end of all this, we can see explicitly what Claude did and how it came to its conclusion. And the dark mode is looking pretty good. Awesome.

>> When using Claude Code, try to be as descriptive as possible with your prompt. If you want to stay in the loop at every step, you can do that. Use plan mode to let Claude get a little bit more in the nitty-gritty with what you want to achieve before executing on that plan.
↑ 目次へ戻る

Claude Code 101 | Lesson 05「explore → plan → code → commit ワークフロー(The explore → plan → code → commit workflow)」

出典: Anthropic Academy / YouTube動画ID xJQuF02NAK8 / 2026-07-04

日本語ナレッジ(要点整理)

  • このコースで一つだけ持ち帰るならこれExplore(探索)→ Plan(計画)→ Code(実装)→ Commit(コミット) のワークフロー。これを飛ばすと、いきなり実装を頼んで後から軌道修正が増える。
  • Explore & Plan:最速の手段は Plan Mode。Plan Mode では Claude はファイルを編集できず、読むだけで実装方針を集める。Shift + Tab で入る。
  • 良いプロンプト例:「画像アップロードのパイプラインに WebP 変換を追加したい。パイプラインのどこでやるべきか、新しい依存が要るか、どう進めるかを調べて」。
  • Claude が関連ファイルを読み、web 検索し、アクションプランを提示。基準に合うか確認し、合わなければ特定箇所の修正を頼む。
  • ここがコード前で最も軌道修正しやすい場所。変更するつもりがなく概要だけ欲しいときは、Plan Mode でなくても explore サブエージェントを呼べる。
  • Code:計画が良ければ approve → Claude がリスト項目を消化。ファイル編集を auto-accept にするか都度確認かは選べる。Claude は「完了」とする前に自力でトラブルシュートするが、時に介入が必要。Plan Mode の利点=実行後もどうやって結果に至ったかのコンテキストが残り、次の判断を助ける。
  • Code フェーズを滑らかにするコツ
  • 成功基準(success criteria)を定義する。何が「正しい」かを計画に明記すると Claude が結果に自信を持てる。
  • ツールを追加する。ゴール達成を助けるツールで往復を減らす(例:web UI 開発なら Claude in Chrome 拡張を入れて、Claude Code がブラウザのタブを操作して UI を直接テスト)。
  • テストスイートを用意する。継続的に検証させる。Claude にテストを書かせることも可能。ただし渡す前に、テストが信頼できる「真実の基準(source of truth)」であることを確認し、偽陽性(false positive)を避ける。
  • クイックTip:同じ問題に何度もぶつかるなら、その解決策を CLAUDE.md に保存させる。
  • Commit:自分でテストして満足したら push。push 前に、サブエージェントのコードレビュアーで自分の作業をレビュー——サブエージェントは新鮮な視点を持ち、セッション中のメインエージェントが持つバイアスを引き継がない。その後、Claude にあなたのスタイルのコミットメッセージを生成させる。これを繰り返す。

日本語(本文の自然な全訳)

このコースから一つだけ持ち帰るなら、このワークフローにしてください——Explore(探索)、Plan(計画)、Code(実装)、Commit(コミット)。これがないと、たいていの人はいきなり Claude にコードを書かせようとします。それは、後からの軌道修正を増やすということです。

Explore と Plan

最初の2ステップを最速でこなす方法が Plan Mode です。Plan Mode では、Claude はファイルを編集できません——実装をどう攻略するかの情報を集めるために、ファイルを読むだけです。Plan Mode に入るには、テキスト入力欄の下に「Plan Mode」が見えるまで Shift + Tab を押します。そして、次のようなプロンプトを書きます。

I need to add WebP conversion to our image upload pipeline. Figure out where in the pipeline it should happen, whether we need new dependencies, and how to approach it.

(訳:画像アップロードのパイプラインに WebP 変換を追加する必要がある。パイプラインのどこで行うべきか、新しい依存関係が必要か、どうアプローチするかを調べて。)

Claude は関連ファイルを読み、いくつか web 検索をして、アクションプランを提示します。それを確認して、自分の基準に合うか判断します。合わなければ、特定の箇所を追加・修正するよう頼めます。

ここが軌道修正に最適の場所です。なぜなら、まだコードが1行も書かれていないからです。変更を加えるつもりはなく、コードベースの概要が欲しいだけなら、Plan Mode に入らずに explore サブエージェントを走らせることもできます。

Code

計画が良さそうなら、approve を選んで計画を受け入れ、Claude にリスト項目を順に処理させます。ファイル編集を Claude に自動承認させるか、毎回確認させるかを選べます。

Claude は計画を「完了」とみなす前に、できる限り自力でトラブルシュートします。ただし、時にはあなたが介入する必要があります。これが Plan Mode で作業する利点です——実行後には、どうやってその結果に至ったかというコンテキストも手元に残り、それが Claude の次の判断を導く助けになります。

Code フェーズを滑らかにするいくつかのコツ:

  • 成功基準を定義する。Claude が自分の結果に自信を持つには、何が「正しい」かを明確にする必要があります。計画を書くとき、これを明示しましょう。
  • ツールを追加する。ゴール達成を助けるツールは、多くの往復をなくします。たとえば web UI を作っているなら、Claude in Chrome 拡張を入れておけば、Claude Code がタブを操作して UI を直接テストできます。
  • テストスイートを含める。Claude が継続的に検証できるテストスイートを与えます。Claude にテストを書かせることもできます。これを渡す前に、そのテストが偽陽性を避けるための信頼できる真実の基準であることを確認してください。

クイックTip:Claude が同じ問題に何度もぶつかるなら、その解決策を CLAUDE.md ファイルに保存するよう頼みましょう。

Commit

自分自身で変更をテストして結果に満足したら、コードを push する時です。コミットする前のコツ——サブエージェントのコードレビュアーを走らせて、自分のコードを見てもらいましょう。サブエージェントは、コードベースに対する新鮮な視点を得ます——セッション中にコードを書いたメインエージェントが持ちがちなバイアスを引き継ぎません。

そして Claude に、あなたのスタイルでコミットメッセージを生成させます。あとはこれを繰り返します。

まとめ

Claude Code を効果的に使うには、Explore、Plan、Code、Commit のワークフローに従いましょう。

  • Explore は、あなたのプロジェクトに必要な関連コンテキストを Claude に与える。
  • Plan は、Claude が成功を測るために使うアクションプランを作る。
  • Code は、最終的な成果に落ち着くまでの、あなたと Claude の往復。
  • Commit は、コードをレビューして push し、次の機能に着手できるようにする。

英語逐語(動画字幕)

If you take one thing away from Claude code, let it be this workflow: explore, plan, code, and commit. Without this, most people jump straight to pasting in Claude to write code, which means more course correcting later on.

The fastest way to handle step one and two is with plan mode. With plan mode, Claude can't edit files. It just reads files to gather research on how to tackle this implementation. To enter plan mode, hit shift and tab until you see the plan mode under the text input. I need to add WebP conversion to our image upload pipeline. Figure out where in the pipeline it should happen, whether we need new dependencies, and how to approach it. And Claude will read relevant files, do some web searches, and give you a plan of action. Make sure you review it and determine if it meets your criteria. Otherwise, I can ask it to add on or revise some areas. Perfect. And this right here is the best place to course correct because it's before any code is written. You can also use explore without being in plan mode by just asking Claude to explore your code base.

Now, once the plan looks good, you can select approve to accept the plan and let Claude toggle all of the list items it provided. You can determine if you want Claude to auto accept the file edits or ask every single time. Claude will do its best to troubleshoot your code base before considering the plan finished. But at times, you'll need to course correct. This is the benefit of working with plan mode because after the plan is finished, we also have the context of how it got to the results to help it guide its next decision.

In order for Claude to be confident in its results, it has to be clear on what it deems correct. When writing your plan, make this explicit. Adding tools that will help Claude complete its goals will remove a lot of back and forth. For example, if you're building web UIs, make sure you have the Claude and Chrome extension so that Claude code can control a tab and test out the UI before deeming it finished. In your project, include a test suite that Claude can continuously validate on. Claude can even write tests for you. Before passing this off to Claude, make sure that the tests are a source of truth for you and your team to avoid any false positives.

Quick tip, if you find Claude keeps running into the same issues, ask Claude to save the solution to his Claude MD file. Now, once you have tested for yourself and are happy with the results, it's time to push your code. A tip before you commit, run a sub agent code reviewer to look at your code. Then you get Claude to generate a commit message for you in your style. Rinse and repeat.

>> If you want to be effective with Claude code, follow the explore, plan, code, and commit workflow. Exploration will give the relevant context Claude needs for your project. Plan will create a plan of action that Claude will use to determine if they are successful. Code is the back and forth that you and Claude do before settling on the final outcomes of the plan. Commit helps you review and push your code so you can start on your next feature.
↑ 目次へ戻る

Claude Code 101 | Lesson 06「コンテキスト管理(Context management)」

出典: Anthropic Academy / YouTube動画ID eW3oTyfeWZ0 / 2026-07-04

日本語ナレッジ(要点整理)

  • Context = Claude の作業記憶。読んだファイル、実行したコマンド、送ったメッセージ——すべてがコンテキストウィンドウの領域を消費する。
  • コンテキストウィンドウとは:Claude が記憶に保持できる領域の量。プロンプト入力・ファイル読み取り・tool call・tool call の結果、すべてが加算される。有限なので最適化が極めて重要
  • 満杯になると:上限に近づくと自動で compaction(圧縮)。重要な詳細を要約し、不要な tool call の結果を除去して領域を空ける。ただし詳細が失われる可能性がある
  • コマンド
  • /compact:その時点までを手動圧縮。作業の記憶を保ちつつ領域を空けたいときに便利。
  • /clear:完全にゼロから。前セッションの記憶をすべて消す。
  • /context:コンテキストの状態を確認。サイズの概観、最も領域を食っているカテゴリ、内訳のビジュアルが見られる。
  • どちらを使うか(目安)
  • /compact:特定の機能を作業中で、上限に当たったが続行が必要なとき。今の機能に関連するコンテキストを保つのが大事。
  • /clear:新しい機能を始めるとき。前の会話が新しいものにバイアスを持ち込むのを避ける。セッションを跨いで覚えさせたいことは CLAUDE.md に置き、毎回ゼロから再発見させない。
  • コンテキスト節約のコツ
  • 具体的に(Be specific):曖昧なプロンプトは一見小さいが、Claude がコードベースを余計に探索・推論するため、長い目で見ると逆にコストが増える。明確な指示のほうが節約になる。
  • MCP サーバーを管理する:MCP サーバーは使っていなくても全ツールをデフォルトでコンテキストに読み込む。無関係なものはオフに。Skills は MCP に似るが全部を前もって読み込まないので領域を節約できる。
  • サブエージェントを使う:メインと並行して完全に別のコンテキストウィンドウで動く。「認証エンドポイントはどこ?」のように答えだけ欲しいタスクは、サブエージェントに任せて要約だけ返させ、メインのコンテキストをきれいに保つ。

日本語(本文の自然な全訳)

コンテキストは Claude の作業記憶です。Claude が読むすべてのファイル、実行するすべてのコマンド、あなたが送るすべてのメッセージ——それらすべてがコンテキストウィンドウの領域を占めます。

コンテキストウィンドウとは?

コンテキストウィンドウは、Claude が記憶の中に保持できる領域の量だと考えてください。あなたがプロンプトを入力するたび、Claude がファイルを読むたび、tool call を実行するたび、tool call の結果を受け取るたびに、それはコンテキストウィンドウに追加されていきます。領域は有限なので、これをできる限り最適化することが重要になります。

コンテキストが満杯になると何が起きるか

上限に近づくと、コンテキストウィンドウは自動的に compact(圧縮)されます。compaction は重要な詳細を要約し、不要な tool call の結果を取り除いて、領域を空けます。ただし、このプロセスによって詳細が失われる可能性がある点に注意してください。

コマンド

compaction は /compact コマンドで手動でも実行できます。これはその時点までのすべてを圧縮します。以前に取り組んだ内容の記憶を保ちつつ、コンテキストの領域を空けたいときに便利です。

前のセッションの記憶を一切残さず、完全にゼロから始めたいなら、/clear を実行します。これはすべてを取り除きます。

コンテキストの状態を確認するには、/context コマンドを実行します。コンテキストサイズの全体像、最も領域を占めているカテゴリ、そしてその内訳を示すビジュアルが得られます。

どちらをいつ使うか

一般的な目安:

  • /compact を使う:特定の機能を作業中で、コンテキストの上限に当たっているが続行する必要があるとき。今の機能に関連したコンテキストを保つことは、開発を続けるうえで重要です。
  • /clear を使う:新しい機能を始めたいとき。前の会話が、新しく作るものにバイアスを持ち込むのは避けたいものです。セッションを跨いで Claude に覚えていてほしいことは、CLAUDE.md ファイルに入れておけば、毎回ゼロから再発見せずに済みます。

コンテキスト領域を節約するコツ

具体的にする。曖昧なプロンプトは一見小さく見えますが、実際には長い目で見るとより多くのコンテキストを消費します。明確な指示がないと、Claude はコードベースをもっと探索し、自分で推論せざるを得なくなります——これは、あと1〜2文だけ明確に書くよりも、はるかに多くのコンテキスト領域を食います。

MCP サーバーを管理する。MCP サーバーは、使っていないときでも、利用可能なすべてのツールをデフォルトでコンテキストに読み込みます。今のプロジェクトと無関係なサーバーが設定されているなら、オフにするとよいでしょう。Skills を試すのも手です——MCP サーバーと似た働きをしますが、全部を前もってコンテキストに載せないので領域を節約できます。

サブエージェントを使う。サブエージェントはメインエージェントと並行して動きますが、完全に別のコンテキストウィンドウを持ちます。「認証エンドポイントはどこにある?」のように答えだけが必要なタスクでは、サブエージェントが作業をして、要約だけをメインエージェントに返します。これでメインのコンテキストがきれいに保たれます。

まとめ

Claude Code の中でコンテキストを管理することは極めて重要です。長いセッションを要約するには /compact、ゼロから始めるには /clear を使いましょう。コンテキストウィンドウを効果的に使うには——プロンプトを具体的にし、今のコンテキストが何を消費しているかを確認し、答えだけが必要なタスクはサブエージェントに委ねましょう。

英語逐語(動画字幕)

Context is Claude's working memory. Every file it reads, every command it runs, every message you send, it all takes up space in the context window. Think of the context window as the amount of space that Claude can hold in its memory.

Whenever you enter a prompt, Claude reads a file, runs a tool call, gets a tool call result. This is added onto the context window. And since there's only a finite amount you can put in the context window, it becomes extremely important to optimize this as much as possible.

Now, when you approach this limit, the context window is automatically compacted. Compaction will summarize important details and remove the unnecessary tool call results and free up a lot of space in your context window. Do note though that this could potentially lose details in your previous conversation.

You can run the compaction manually as well with the /compact command. This will compact everything that you've done up to that point, which could be handy if you want to clear up context space, but also have a memory of what you previously worked on. If you want to completely start from scratch without memory of what was previously worked on, you can also run /clear and that will remove everything, starting from scratch.

To check the state of your context, run the /context command. Here, you'll get a big picture of how large your context size is, the different categories that are taking up the most context, and a graphic showing you all of this.

A general rule of thumb is when you're working on a specific feature and are going over the context window, but need to continue, then compact. Keeping the context relevant for this feature is important when continuing development. If you have finished the plan and want to start on a new feature, then clear. You don't want the previous conversation to present bias in anything new that you want to create. For things that you do want Claude to remember in other sessions, put it in the Claude.md file. That way, it doesn't have to rediscover things from scratch all over again.

Be specific. The irony behind writing a smaller prompt is that in the long run, it will take up more context. Without being explicit, Claude is forced to look around your code base more and do his own thinking, which takes up a lot more context window space than if you were just a little bit more clear with a sentence or two.

MCP servers load all of the tools available into context by default. So, if you have a lot of MCP servers for things that are unrelated to the project, it might be worth turning them off. You can also try out skills, which works similarly to MCP servers, but doesn't put the entire thing into context, saving you space.

Sub agents run in parallel with your main agent, but has a complete separate context window. So, for tasks that require an answer without the journey, like where is the authentication endpoints located, you can have the sub agent do the work and return just a summary to your main agent.

Managing context within Claude code is crucial. Use /compact to summarize long sessions and /clear to start fresh. To use your context window effectively, be specific with what you want. Check what's using your current context window and use sub agents to delegate tasks you only need the answer for.
↑ 目次へ戻る

Claude Code 101 | Lesson 07「コードレビュー(Code review)」

出典: Anthropic Academy / YouTube動画ID RKsADl0ZC3Y / 2026-07-04 ※この動画は BGM 主体で音声ナレーションがないため、「英語逐語」は本文原文(記事)を掲載する。

日本語ナレッジ(要点整理)

  • Claude Code には git ワークフローを速くする組み込み機能がいくつかある。
  • サブエージェントでレビュー(Review with a Subagent):PR を push する前に、変更をサブエージェントでレビューさせる。サブエージェントは自分のコンテキストウィンドウで新鮮な視点を持ち、そのセッションでコードを書いたメインエージェントのバイアスを引き継がない。
  • code-reviewer サブエージェントは read-only ツールに制限する。レビュアーは問題を指摘するのが役目で、ファイルを編集すべきではない。
  • サブエージェントの設定はリポジトリにチェックインすると、チーム全員が同じレビュアーを使える。
  • /commit-push-pr Skill:commit・push・PR 作成を1ステップでまとめて処理する。個別に手作業でやる代わりに、この skill を実行すれば Claude が全部やる。
  • Slack MCP サーバーを設定し、チャンネルを CLAUDE.md に記載していれば、PR リンクを自動でチームのチャンネルに投稿する。
  • --from-pr によるセッションリンク:Claude が gh pr create で PR を作ると、そのセッションが PR に自動リンクされる。後で戻る(レビューコメント対応やビルド失敗の修正など)ときは claude --from-pr <PR_NUMBER> で続きから再開できる。
  • 要点:push 前にバイアスのないコードレビューはサブエージェントで。commit → PR の一連は /commit-push-pr で1ステップ。PR の作業再開は --from-pr。小さな機能だが日々の摩擦を大きく減らす。

日本語(本文の自然な全訳)

Claude Code には、git ワークフローを速くする組み込み機能がいくつかあります。順に見ていきましょう。

サブエージェントでレビューする

PR を push する前に、Claude にサブエージェントを使って変更をレビューさせましょう。サブエージェントは自分自身のコンテキストウィンドウで、新鮮な視点で動きます——そのセッションでコードを書いてきたメインエージェントのバイアスを引き継ぎません。

code-reviewer サブエージェントを作るときは、read-only(読み取り専用)ツールに制限してください。レビュアーは問題を指摘すべきであって、ファイルを編集すべきではありません。サブエージェントの設定をリポジトリにチェックインしておけば、チーム全員が同じレビュアーを使えます。

/commit-push-pr Skill

/commit-push-pr skill は、commit・push・PR 作成をすべて1ステップで処理します。それぞれを手作業でやる代わりに、この skill を実行するだけで Claude が面倒を見てくれます。

Slack MCP サーバーを設定し、チャンネルを CLAUDE.md に記載していれば、PR リンクをあなたのチームのチャンネルに自動で投稿します。

--from-pr によるセッションリンク

Claude が gh pr create を通じて PR を作成すると、そのセッションは自動的にその PR にリンクされます。後で戻る必要があるとき——たとえばレビューコメントに対応したり、失敗したビルドを直したり——には、次を実行します。

claude --from-pr <PR_NUMBER>

これで、中断したところからそのまま再開できます。

まとめ

push する前のバイアスのないコードレビューにはサブエージェントを使いましょう。commit から PR までの一連の流れを1ステップで処理するには /commit-push-pr を使いましょう。そして、後で PR の作業を再開するには --from-pr を使いましょう。これらは小さな機能ですが、日々のワークフローから多くの摩擦を取り除いてくれます。

英語逐語(本文原文)

この動画は音声ナレーションがなく BGM のみ(字幕は「[music]」のみ)。以下はコース本文(記事)の英語原文。

Claude Code has a few built-in features that make your git workflow faster. Let's go through them.

Review with a Subagent

Before you push a PR, ask Claude to use a subagent to review your changes. The subagent runs in its own context window with fresh eyes — it doesn't carry the bias of the main agent that just spent the session writing the code.

When creating a code-reviewer subagent, restrict it to read-only tools. A reviewer should flag issues, not edit files. Check the subagent configuration into your repo so your whole team uses the same reviewer.

The /commit-push-pr Skill

The /commit-push-pr skill handles the commit, push, and PR creation all in one step. Instead of doing each manually, just run the skill and Claude takes care of it.

If you have a Slack MCP server configured with channels listed in your CLAUDE.md, it will automatically post the PR link to your team's channel.

Session Linking with --from-pr

When Claude creates a PR through gh pr create, the session gets linked to that PR automatically. If you need to come back to it later — maybe to address review comments or fix a failing build — run:

claude --from-pr <PR_NUMBER>

This picks up right where you left off.

Recap

Use a subagent for an unbiased code review before pushing. Use /commit-push-pr to handle the full commit-to-PR flow in one step. And use --from-pr to resume work on a PR later. These are small features, but they remove a lot of friction from your daily workflow.
↑ 目次へ戻る

Claude Code 101 | Lesson 08「CLAUDE.md ファイル(The CLAUDE.md file)」

出典: Anthropic Academy / YouTube動画ID O0FGCxkHM-U / 2026-07-04

日本語ナレッジ(要点整理)

  • CLAUDE.md は Claude Code の最重要機能の一つ。プロジェクトに関する永続的な記憶(persistent memory)を Claude Code に与える。
  • 解決する問題:CLAUDE.md がないと Claude は毎回ゼロから始まる——コードベースを再探索し、必要な依存を推測し、既存の実装を把握し直す。時に誤った前提を置き、軌道修正が難しくなる。
  • 仕組み:プロジェクトのルートに置く Markdown ファイル。セッション開始のたびに自動で読まれる。コードベースの「オンボーディングスクリプト」。内容はあなたのプロンプトに追記(appended)される
  • (本文の CLAUDE.md 例):スタック(Next.js 15 / App Router / Tailwind / Drizzle ORM)、コマンド(dev / test / lint)、コードスタイル(2-space indent、named exports、API ルートは app/api/、可能なら server actions)を書く。すると「React コンポーネントを作って」で、Tailwind を使い規約に従うことを最初から知っている。
  • CLAUDE.md はチームのためのもの。バージョン管理にコミットすべき。記憶ファイルには階層がある
  • Project-level CLAUDE.md:プロジェクトのルート。チームで共有。
  • User-level CLAUDE.md:自分の設定フォルダ。自分専用・全プロジェクトに適用。個人的な好みはここへ。
  • コツ
  • 訂正を記憶に保存する:同じ訂正(例:常に API ルートでなく server actions を使え)を繰り返すなら、明示的に memory に保存させる。次回から覚えている。
  • プロジェクトドキュメントを参照させる@ 記号 + ファイルパスで参照(例:@README.md)。
  • 最初は無しで始める:まず CLAUDE.md なしで始め、どこで繰り返し軌道修正するかを観察する。これで CLAUDE.md をコンパクトで必要な情報だけに保てる。準備ができたら /init で Claude に生成させる。

日本語(本文の自然な全訳)

Claude Code の最も有用な機能の一つが CLAUDE.md ファイルです。これは、あなたのプロジェクトについての永続的な記憶を Claude Code に与えます。

それが解決する問題

CLAUDE.md ファイルなしで Claude Code を開くと、毎回ゼロから始まります。コードベースを再探索し、どんな依存関係が必要かを見極め、すでに実装されている機能を把握し直さなければなりません。時には前提を置いてしまい、それが Claude を正しい方向へ導くのを難しくします。

CLAUDE.md はこれを解決します。プロジェクトのルートに追加する Markdown ファイルで、Claude Code はセッションを始めるたびに自動的に読み込みます。あなたのコードベースのオンボーディングスクリプトだと考えてください。CLAUDE.md ファイルの内容は、あなたのプロンプトに追記されます。

典型的な CLAUDE.md ファイルはこんな形です。

# Project

This is a Next.js 15 app using the App Router, Tailwind, and Drizzle ORM.

# Commands
- Dev server: `pnpm dev`
- Run tests: `pnpm test`
- Lint: `pnpm lint`

# Code Style
- Use 2-space indentation
- Prefer named exports
- All API routes go in app/api/
- Use server actions instead of API routes where possible

とてもシンプルです。これで Claude Code に React コンポーネントを作ってと頼めば、スタイリングに Tailwind を使い、あなたのコード規約に従うことをすでに知っています。

CLAUDE.md はチームのためのもの

CLAUDE.md はバージョン管理にコミットできますし、そうすべきです——そうすればチームもその恩恵を受けられます。実は、誰のためのものかによって記憶ファイルには階層があります。

  • Project-level CLAUDE.md は、プロジェクトのルートディレクトリに置きます。チームと共有されます。
  • User-level CLAUDE.md は、あなたの設定フォルダに置きます。これはあなた専用で、すべてのプロジェクトに適用されます。個人的な好みはここに入れましょう。

コツ

訂正を記憶に保存する。もし同じ訂正を繰り返しているなら——たとえば「API ルートではなく常に server actions を使って」と言い続けているなら——その規則を memory に保存するよう明示的に Claude に頼みましょう。次にプロジェクトを開いたときには、それを知っています。

プロジェクトドキュメントを参照する。Claude に参照してほしいドキュメントがプロジェクトにあるなら、@ 記号にファイルパスを付けて使います。

## README.md

Please read if you need more info: @README.md

最初は無しで始める。私たちは、まず CLAUDE.md ファイルなしでプロジェクトを始めることをおすすめします。そうすれば、どこで絶えずモデルを軌道修正しているかが見えてきます。これによって、CLAUDE.md をコンパクトに、必要な情報だけに絞って保てます。準備ができたら、/init を実行して Claude に生成させましょう。

まとめ

イライラする Claude Code セッションと生産的なセッションの違いは、しばしばコンテキストに帰着します——そして CLAUDE.md ファイルこそが、そのコンテキストを提供する手段です。まずはスタック、好み、コマンドから始めて、進めながらそこに積み上げていきましょう。

英語逐語(動画字幕)

注:字幕の自動文字起こしでは「CLAUDE.md」がしばしば「claw.md」等と誤認識されています。読み替えてください。

One of the most useful parts of Claude Code is the claw.md file. It gives Claude Code persistent memory about your project.

When you open up Claude Code without a claw.md file, it's like it has to start fresh every single time. It has to re-explore your code base, understand what dependencies are needed, and the features that are already implemented. Sometimes it has to make assumptions, which makes it harder for us to steer Claude in the right direction. But, that's where claw.md comes in. It's a markdown file that you add to the root of your project, and Claude Code reads it automatically every time you start a session. It's like an onboarding script for your code base. Simply put, the contents of claw.md file are appended to your own prompt. You can run the /init command, which will make Claude generate one based off of your code base.

So, let's have a look at one. This is a Next.js 15 app using the app router, Tailwind, and Drizzle ORM. Command, dev server, run tests, lint, code style, use two-space indentation, prefer named exports, all API routes go in app/api, use server actions instead of API routes where possible. And it's pretty straightforward. Now, if I ask Claude Code to create a React component, it knows how to style it with Tailwind or any other CSS framework that I'm using. We can see that Claude does a better job at doing his job right off the bat versus having to understand where everything is at first.

And before you ask, the answer is yes. You share this in your version control for your team to use, but there's actually a hierarchy of memory files depending on who it's for. So, first you have your project-level claw.md that lives in the root directory of your project. You have a user-level claw.md that lives in your configuration folder. This one is just for you and goes across all your projects. So, put your preferences here, like how you write code comments.

First, if you have to correct Claude to do something like always use server actions instead of API routes, then explicitly ask Claude to save this to memory, so that when you come back to this project, it will know every single time. Second, if you have docs in your project that you want Claude to reference, just use the @ symbol with the file path. And third is we recommend you start off a project without a Claude.md file, you can see where you have to constantly course correct the model. This keeps your Claude.md file compact and contain only the necessary information that Claude can work with.

The difference between a frustrating Claude code session and a productive one comes down to the context and the Claude.md file is how you provide that context. Start with your stack, your preferences, and then commands, and just build from there as you go.
↑ 目次へ戻る

Claude Code 101 | Lesson 09「サブエージェント(Subagents)」

出典: Anthropic Academy / YouTube動画ID jKErNxuxPXg / 2026-07-04

日本語ナレッジ(要点整理)

  • サブエージェント=タスクを委譲できる専門アシスタント。タスクを分解し、構成タスクを並行実行してコンテキスト管理を改善する。各サブエージェントは独立したコンテキストウィンドウを持つ。
  • 仕組み:コンテキストの多くはコードベース探索や web 検索の tool call に食われるが、その発見がメイン機能に常に関係あるわけではない。そこで「このコードベースを探索して」のようなタスクをサブエージェントに投げる。サブエージェントは並行して自分のコンテキストで探索し、終わったら要約だけをメインに返す。→ 途中経路でメインを散らかさずに答えだけ得られる。
  • 入力は2つ:設定ファイルからのカスタム system prompt と、親エージェントが書くタスク記述。サブエージェントは自律的に動き、ファイル読み書きやツール使用はメイン会話に現れず、要約だけが返り、サブエージェントの会話は完全に破棄される。
  • トレードオフ:メインは、サブエージェントがどう結論に至ったか・途中で何を発見したかの可視性を失う。
  • 組み込みサブエージェント(動画で言及):
  • general-purpose:探索と行動の両方を要する複数ステップのタスク用。
  • explore:コードベースの高速検索用。
  • plan:Plan Mode 中、計画提示前のリサーチ・分析用。
  • 自作サブエージェント(Creating Your Own):Markdown ファイル + YAML frontmatter で定義。最も簡単なのは Claude に作らせること:/agents → 「Create new agent」→ スコープ選択・目的定義・使えるツール選択・色選び、と進む。Claude が name・description・prompt を生成し、どんなプロンプトのときにこのサブエージェントを呼ぶかも決まる。
  • さらなるカスタマイズ
  • Persistent memory(永続記憶):会話を跨いで記憶を保持。同じプロジェクトで継続利用するときに有用。
  • Preload skills(skill のプリロード)skill キーに skill 名を列挙。メイン会話の skill と違い、ここでは skill 全体がコンテキストに読み込まれる点に注意。
  • さらに深掘りしたい人向けに専用コース 「Introduction to subagents」 がある。

日本語(本文の自然な全訳)

Claude はタスクをサブエージェントに委譲できます。サブエージェントはタスクを分解し、構成要素となるタスクを並行して実行し、あなたのコンテキスト管理を改善します。各サブエージェントは、自分自身の隔離されたコンテキストウィンドウで動作します。

どう動くか

Claude Code の中でコンテキストを管理することは重要です。コンテキストウィンドウの多くは、コードベースを探索する tool call やリサーチのための web 検索といったものに消費されます。その探索の過程で Claude が発見することは、あなたが開発しているメイン機能に必ずしも関係ありません。

ここでサブエージェントの出番です。Claude は「このコードベースを探索して」のようなタスクを処理するためにサブエージェントを生成します。サブエージェントは自分自身のコンテキストウィンドウで並行して動き、探索作業をすべてこなし、終わったらその発見を要約して、その要約を Claude に返します。

結果として、あなたは探し求めていた答えを得られます——そこに至るまでの道のり全体でメインのコンテキストを散らかすことなく。

自分のサブエージェントを作る

サブエージェントは、YAML frontmatter 付きの Markdown ファイルで定義されます。始める最も簡単な方法は、Claude に生成させることです。次を実行します。

/agents

そして「Create new agent(新しいエージェントを作成)」を選びます。エージェントのスコープを選び、目的を定義し、アクセスできるツールを選び、さらには色を選ぶ、といったステップを進みます。

Claude は、そのサブエージェントの name(名前)・description(説明)・prompt(プロンプト)を生成します。これはまた、あなたが与えるプロンプトに応じて、いつそのサブエージェントを呼ぶべきかを Claude に伝えます。

さらなるカスタマイズ

サブエージェントはさらにカスタマイズできます。いくつかのハイライト:

  • Persistent memory(永続記憶) を使うと、サブエージェントが会話を跨いで記憶を保持できます。同じプロジェクトで一貫して使う場合に最適です。
  • Preload skills(skill のプリロード)skill キーを追加し、skill を名前で列挙することで、サブエージェントに skill を前もって読み込ませられます。メイン会話の skill と違い、ここでは skill 全体がコンテキストに読み込まれる点に注意してください。

まとめ

コンテキストウィンドウをきれいに保つことは、Claude Code で生産的であり続けるための最良の方法の一つです。サブエージェントを使えば、重い作業をバックグラウンドで処理させ、答えだけをメインのコンテキストウィンドウに返させることができます。

さらに深く学びたいですか? 専用コース「Introduction to subagents」をご覧ください。

英語逐語(動画字幕)

注:この動画のナレーションは本文(記事)と構成が異なり、組み込みサブエージェント(general-purpose / explore / plan)に重点を置いています。

Sub-agents are specialized assistants that Claude can delegate tasks to. Each sub-agent runs in its own conversation context window with a custom system prompt that you define. When finished, it returns a summary to the main thread while all the intermediate work stays isolated.

One of the main advantages of sub-agents is that they help manage context window usage. When you chat with Claude Code, you're adding context to the main context window. Every tool call and its results get stored in this main context window. And so, when Claude uses a sub-agent, a separate window starts. The sub-agent receives two inputs, a custom system prompt from your configuration file, and a task description written by the parent agent based on what you ask for.

The sub-agent then works autonomously. When it reads files, edits files, or uses tools, none of these will appear in the main conversation. Just a summary is returned back. The entire sub-agent conversation then gets completely discarded.

Consider a task like investigating how the payment system works in an unfamiliar code base. Maybe you're trying to use Claude Code to figure out which service handles refunds. Well, without a sub-agent, Claude might read 15 files, run several searches, and trace through multiple function calls. All of that context fills your context window, even if you only needed one single fact, which service handles refunds.

With a sub-agent, you get the answer without the journey. The sub-agent explores, discovers the answer, and returns a focused summary, keeping your main context clean. But, the main window loses visibility into how the sub-agent reaches its conclusions and what it discovered along the way.

Claude Code includes several built-in sub-agents that you can use immediately, like the general-purpose sub-agent, used for multi-step tasks that require both exploration and action. The explore sub-agent, used for fast searching of code bases. The plan sub-agent, used during plan mode for research and analysis of your code base before presenting a plan. And you can also create your own sub-agents with custom system prompts and tool access.

Sub-agents like Claude Code break work into focused pieces, keep your main context window clean, and bring back just what you need, whether you're using the built-in ones or creating your own. They're a practical way to get more out of longer Claude Code sessions.
↑ 目次へ戻る

Claude Code 101 | Lesson 10「MCP(MCP)」

出典: Anthropic Academy / YouTube動画ID kkBFmwkDzdo / 2026-07-04

日本語ナレッジ(要点整理)

  • MCP(Model Context Protocol)= Claude Code を外部ツール・データソースに繋ぐオープン標準。質問すると、Claude がいつそのツールを使うべきかを自動で理解する。
  • コンテキストの多くはコードベースの外にある——データベース、生産性アプリ、公開リポジトリなど。MCP がその橋渡しをする。
  • agentic AI における「tools」:エージェントに行動する能力を与える。「テキストで返答するだけ」の従来 AI と違い、タスクをより効果的にこなせる。
  • 例:チームが Linear を使うなら Linear MCP サーバーで課題の詳細を取り込む。依存の最新ドキュメントが要るなら Context7 のような docs MCP サーバーが提供。(claude.com/connectors に数百のコネクタ)
  • MCP サーバーの追加claude mcp add コマンド。主に2種類:
  • HTTP servers:リモートサービス用。プロバイダがホストし、ネットワーク越しに接続。
  • Stdio servers:自分のマシンで動くローカルプロセス用。
  • セッション内では /mcp で接続状況の確認・ステータス・不要サーバーの無効化ができる。
  • スコープ(3種類)
  • Local:現在のプロジェクトのみ・自分だけ。
  • User:全プロジェクトで利用可能。
  • Project.mcp.json をバージョン管理にチェックイン → コードベースを触る全員が同じサーバーを自動で得る。
  • Context Costs(コンテキストコスト):MCP サーバーは使っていなくてもツール定義をコンテキストに追加する。多いと利用可能なコンテキストを圧迫。/mcp で確認し、使っていないものは無効化。
  • CLI 版があるツール(GitHub の gh、AWS の aws 等)は CLI のほうがコンテキスト効率が良い(永続的なツール定義を追加しないため)。
  • Skill を使う手もある:名前と説明だけがコンテキストに載り、必要と判断したときに初めて中身が読み込まれる。
  • MCP ツールがコンテキストウィンドウの 10% を超えると、Claude Code は自動で tool search モードに切り替える(必要時にツールを発見する)。ただし信頼性はやや落ちる場合がある。

日本語(本文の自然な全訳)

Model Context Protocol(MCP)は、Claude Code を外部のツールやデータソースに接続できるようにするオープン標準です。あなたが質問すると、Claude はそのツールをいつ使えばクエリにより良く対応できるかを自動的に理解します。

あなたのコンテキストの多くは、コードベースの外にあります——データベース、生産性アプリ、あるいは公開リポジトリの中に。MCP はそのギャップを橋渡しします。

MCP で何ができる?

まず、エージェント型 AI における「tools(ツール)」の概念を理解することが重要です。ツールは、Claude Code のようなエージェントに、タスクをより効果的に完了するのに役立つアクションを実行する能力を与えます。これは、テキストの返答だけが返ってくる典型的な AI とは異なります。

たとえば、あなたのチームがプロジェクト管理に Linear を使っているなら、Linear MCP サーバーを追加して、特定の課題の詳細を取り込めます。ある依存関係の最新ドキュメントが必要なら、Context7 のような docs MCP サーバーが、それを Claude Code に提供できます。

MCP サーバーを追加する

MCP サーバーは claude mcp add コマンドで追加できます。主に2種類あります。

  • HTTP servers はリモートサービス用です。これらはサービスプロバイダがホストし、ネットワーク越しに接続します。
  • Stdio servers は、あなたのマシンで動くローカルプロセス用です。

Claude Code セッション内では /mcp でサーバーを管理でき、何が接続されているか、ステータスを確認し、不要なサーバーを無効化できます。

サーバーのスコープ設定

MCP サーバーは3通りにスコープできます。

  • Local — 現在のプロジェクトでのみ、あなただけが利用可能。
  • User — あなたのすべてのプロジェクトで利用可能。
  • Project.mcp.json ファイルを使い、これをバージョン管理にチェックインすることで、コードベースに関わる誰もが、まったく同じサーバーを自動的に得られます。

コンテキストコスト

MCP サーバーは、あなたが実際に使っていないときでも、ツール定義をコンテキストウィンドウに追加します。多くのサーバーを設定していると、これが利用可能なコンテキストを食い込みます。/mcp を実行して何が接続されているかを確認し、実際に使っていないものは無効化しましょう。

ツールに CLI 版がある場合(GitHub の gh、AWS の aws など)、CLI のほうがコンテキスト効率が良いです——永続的なツール定義を追加しないからです。

Skill を使うことで得られる利点もあります。Skill は名前と説明がコンテキストに読み込まれ、Claude は必要だと判断したときにだけ Skill の全内容を読み込みます。

もし MCP ツールがコンテキストウィンドウの 10% を超えると、Claude Code は自動的に tool search モードに切り替わり、必要に応じて適切なツールを発見します——ただし、これはそれほど確実には動かない場合があります。

まとめ

MCP は Claude Code をあなたの外部ツールやデータソースに接続します。サーバーは claude mcp add で追加します。.mcp.json でプロジェクトにスコープすれば、チームが自動的にそれらを得られます。そして、使っていないサーバーを無効化して、コンテキスト使用量に目を配りましょう。

英語逐語(動画字幕)

注:字幕の自動文字起こしでは「Model Context Protocol」が「Model contact protocol」、「Claude」が「Cloud」等と誤認識されています。読み替えてください。

Model contact protocol is an open standard that lets Claude code connect to external tools and data sources. When you ask a question, Claude will automatically understand when it should use those tools to better understand your query.

Context is one of the most important parts when working with Claude code. A lot of your context lives elsewhere like your databases, your productivity apps, or in public repositories. This is where MCP comes in.

First, it's important to understand the concept of tools when talking about Agentic AI. Tools give agents like Claude code the ability to perform actions in order for them to better complete their tasks. This is different from other AI where you just get an output back directly in text usually. For example, if your team is using Linear as our project management software, you can add a Linear MCP server to bring in the details of your specific issues. If you want to get up-to-date documentation of a dependency that you're working with, then the Context 7 MCP server will provide Claude code with that. There are also hundreds of different connectors at claude.com/connectors.

You can add MCP servers with the Claude MCP add command. There are two main types. HTTP servers are for remote services. These are hosted by the service provider and connect over the network. STDIO servers are for local processes that run on your machine. You can manage your servers with the /mcp inside a Claude code session to see what's connected, the status, and disable servers that you don't want to use.

MCP servers can be scoped in three different ways. One, local means it's only available in the current project for you. Two, the user, which means it's available across all your projects. And three, project scope uses a .mcp.json file that you check into your version control, so anyone working on the code base gets the exact same servers automatically.

Now, one thing to be aware of is that MCP servers add tool definitions to your context window, even when you're not using them. So, if you have a lot of servers configured, this eats into your available context. Run the /mcp command to see what's connected and disable anything that you're not actively using or don't think that you're going to use. If a tool has a CLI equivalent like GH for GitHub or AWS for AWS, the CLI is more context efficient because it doesn't add persistent tool definitions.

You also might benefit from using a skill in this scenario. A skill has a name and a description that is loaded into context. Similar to MCP, when Cloud thinks it needs to use that skill, it then decides to load it into the context window, which is where you could put the command line interface tools. If your MCP tools exceed 10% of your context window, Cloud code will automatically switch to tool search mode, which will discover the right tools on demand, but this might not work as well since it's just not in the context.

>> Now, a quick recap. MCP connects Cloud code to your external tools and data sources. Add servers with Cloud MCP add, scope them to your project with .mcp.json so that your team gets them automatically, and keep an eye on the context usage by disabling servers that you're not actively using.
↑ 目次へ戻る

Claude Code 101 | Lesson 11「フック(Hooks)」

出典: Anthropic Academy / YouTube動画ID IkaPHiMDazM / 2026-07-04

日本語ナレッジ(要点整理)

  • Hooks = Claude Code のライフサイクルの特定ポイントでコマンドを実行する仕組み。他の機能との決定的な違いは、hooks は決定論的(deterministic)=必ず実行されること。
  • なぜ使うか:CLAUDE.md に「編集のたびに Prettier を走らせて」と書いても、たいてい従うが時々従わない。hook にすれば例外なく毎回起きる。
  • よくあるユースケース
  • ファイル編集後のauto-formatting(自動整形)
  • コンプライアンス用の全実行コマンドのログ記録
  • 本番ファイル変更などの危険な操作のブロック
  • タスク完了時の自分への通知送信
  • 仕組みsettings.json で設定。event(イベント)を選び、任意でmatcher(どのツールに適用するか)を設定し、実行するcommand を与える。イベント一覧:
  • PreToolUse — tool call の前に実行
  • PostToolUse — tool call 完了後に実行
  • UserPromptSubmit — プロンプト送信時(Claude が処理する前)に実行
  • Stop — Claude が応答を終えたときに実行
  • Notification — Claude が通知を送るときに実行
  • 設定は /hooks コマンド、または settings.json を直接編集。
  • 実践例(最頻出):編集後の auto-formatting。matcher を "Edit|MultiEdit|Write" にした PostToolUse hook で、Claude がファイルを変更するたびに発火。コマンドがファイル拡張子を見て適切なフォーマッタ(TypeScript は Prettier、Go は gofmt、Python は Ruff 等)を実行。
  • PreToolUse でブロック:tool call を実行前に止められる。hook はツール名と入力を JSON で stdin から受け取るexit code が挙動を決める:
  • exit 0 — 通常どおり進行
  • exit 2 — アクションをブロック。stderr のメッセージが Claude にフィードバックされ、なぜブロックされたかを理解して調整できる
  • その他の exit code — 非ブロッキングのエラー。表示はされるが停止はしない
  • → 本番 config ディレクトリへの書き込み、rm -rf を含む bash、main へのコミット等のハードルールを強制できる。
  • チームで共有.claude/settings.json の hooks はプロジェクトレベルでリポジトリにチェックイン可。チーム全員が同じ hooks を自動で得る。コマンド内では CLAUDE_PROJECT_DIR 環境変数でプロジェクト内スクリプトを参照し、Claude の作業ディレクトリに依らず動くようにする。
  • 鉄則:毎回必ず起きてほしいことは、プロンプトに書くな。hook にしろ

日本語(本文の自然な全訳)

Hooks を使うと、Claude Code のライフサイクルの特定のポイントでコマンドを実行できます。hooks とこのコースで扱った他のすべてとの決定的な違いは、hooks が決定論的である——つまり、常に実行される——という点です。

なぜ Hooks を使うのか

CLAUDE.md で Claude に「ファイル編集のたびに Prettier を走らせて」と伝えることはできます。たいていはそうしてくれます。しかし、時々やってくれません。hook は、それを例外なく毎回、確実に起こします。

よくあるユースケース:

  • ファイル編集後の自動整形
  • コンプライアンスのための、実行したすべてのコマンドのログ記録
  • 本番ファイルの変更のような危険な操作のブロック
  • Claude がタスクを終えたときに自分へ通知を送る

どう動くか

Hooks は settings.json で設定します。イベントを選び、任意でどのツールに適用するかの matcher を設定し、実行するコマンドを与えます。利用可能なイベントは次の通りです。

  • PreToolUse — tool call の前に実行される
  • PostToolUse — tool call が完了した後に実行される
  • UserPromptSubmit — あなたがプロンプトを送信したとき、Claude がそれを処理する前に実行される
  • Stop — Claude が応答を終えたときに実行される
  • Notification — Claude が通知を送るときに実行される

これらは Claude Code 内の /hooks コマンドか、settings.json を直接編集して設定します。

実践的な例

最もよくある hook——編集後の自動整形です。matcher を "Edit|MultiEdit|Write" にした PostToolUse hook を設定すると、Claude がファイルを変更するたびに発火します。コマンドがファイルの拡張子を確認し、適切なフォーマッタを実行します——TypeScript には Prettier、Go には gofmt、といった具合に、あなたのプロジェクトが使うものを。

PreToolUse でのブロック

PreToolUse hook は、tool call が実行される前にそれをブロックできます。あなたの hook は、ツール名と入力を JSON として stdin で受け取ります。exit code が挙動を決めます。

  • exit code 0 — 通常どおり進む。
  • exit code 2 — アクションをブロックする。stderr のメッセージが Claude にフィードバックとして返され、なぜブロックされたかを Claude が理解して調整できる。
  • その他の exit code — 非ブロッキングのエラー。あなたには表示されるが、何も止めない。

これが、ハードなルールを強制する方法です。本番 config ディレクトリへの書き込みをブロックする。rm -rf を含む bash コマンドをブロックする。main へのコミットをブロックする。あなたのチームが「提案」ではなく「保証」として必要とするものは何であれ、これで強制できます。

チームと Hooks を共有する

.claude/settings.json に設定された hooks はプロジェクトレベルで、リポジトリにチェックインできます。これで、あなたのチーム全体が同じ hooks を自動的に得られます。コマンド内では CLAUDE_PROJECT_DIR 環境変数を使ってプロジェクトに保存したスクリプトを参照し、Claude の現在の作業ディレクトリに関係なく動くようにしましょう。

まとめ

Hooks は、Claude Code の挙動に対する決定論的な制御を与えます。自動整形やログ記録には PostToolUse を、危険な操作のブロックには PreToolUse を使いましょう。/hookssettings.json で設定し、リポジトリにチェックインしてチームも得られるようにしましょう。

もし何かが毎回必ず起きる必要があるなら、それをプロンプトに入れてはいけません。hook に入れましょう。

英語逐語(動画字幕)

Hooks let you run commands at different points in Claude code's life cycle. The key difference between hooks and everything else we covered is that hooks are deterministic. They always run.

So, put it this way. You can tell Claude in your claude.md file to run prettier after every file edit and most of the time it will do that, but sometimes it won't. It's not perfect. But a hook makes it happen every single time with no exceptions.

Common use cases could include auto formatting after file edits, logging all executed commands for compliance, blocking dangerous operations like modifying production files, and sending yourself notifications when Claude finishes a task.

Hooks are configured in your settings.json file. You pick an event, optionally set a matcher for which tool it applies to, and provide a command to run. User prompt submit runs when you submit a prompt before Claude processes it. Pre-tool use which runs before a tool call. Post-tool use runs after a tool call completes. Notification runs when Claude sends a notification, and stop runs when Claude finishes responding.

The most common hook. Auto formatting after edits. You set a post-tool use hook with a matcher of edit or multi-edit, right? So, it fires whenever Claude modifies a file. The command checks the file extension and runs the appropriate formatter. This could be prettier for TypeScript, Go format for Go, Ruff for Python, whatever your project uses.

Pre-tool use hooks can block tool calls before they execute. So, your hook receives a tool name and input as JSON on stdin. If it exits with code two, the action is blocked and the stderr message gets fed back to Claude as feedback so Claude knows why it was blocked and can adjust. Exit code zero means proceed. Exit code two means block.

This is how you enforce hard rules. Block writes to a production config directory, block bash commands that contain rm -rf, block commits to main, whatever your team needs to be guaranteed, not suggested.

Hooks configured in .Claude/settings.json are project level and can be checked into your repo. This means that your entire team gets the same hooks automatically. Use the Claude project dir environment variable in your commands to reference scripts stored in your project so they work regardless of Claude's current working directory.

>> Hooks gives you deterministic control over Claude code's behavior. Use post-tool-use for auto-formatting and logging. Use pre-tool-use to block dangerous operations. Configure them in the /hooks or in settings.json and check them into your repository so your team gets them, too. If something needs to happen every time without fail, don't put it in a prompt. Put it in a hook.
↑ 目次へ戻る

Claude Code 101 | Lesson 12「スキル(Skills)」

出典: Anthropic Academy / YouTube動画ID bjdBVZa66oU / 2026-07-04 ※コース本文はリンクのみのため、内容は動画字幕を主体に構成する。

日本語ナレッジ(要点整理)

  • 問題意識:チームのコーディング規約、PR レビューの feedback 構造、コミットメッセージの形式——同じ説明を毎回 Claude に繰り返している。Skills はこれを解消する
  • Skill とはClaude に「あるやり方」を一度教える Markdown ファイル。以降、関連する場面で Claude がその知識を自動的に適用する。
  • Agent skills =エージェントが発見して使える、指示・スクリプト・リソースのフォルダ。より正確・効率的に物事をこなすため。Claude Code では SKILL.md ファイルを使う。
  • どう選ばれるかdescription(説明)が、Claude が使うか否かを判断する鍵。「この PR をレビューして」と頼むと、Claude はそのリクエストを利用可能な skill の description 群と照合し、一致するものを起動する。
  • 保存場所(誰が必要かで決める)
  • Personal skills:ホームディレクトリの .claude/skills。全プロジェクトについて回る。自分の好み——コミットメッセージのスタイル、ドキュメント形式、コード説明の好み。
  • Project skills:リポジトリのルート内の .claude/skills。リポジトリを clone した人全員に自動で付いてくる。チーム標準——会社のブランドガイドライン、Web デザインで使う推奨フォント・色など。
  • 他のカスタマイズ手段との違い(Skill が独特な理由=自動・タスク特化)
  • CLAUDE.md毎回すべての会話に読み込まれる。「常に TypeScript strict mode を使う」ような常時適用ルール向き。
  • Skillsオンデマンドで、リクエストに一致したときだけ読み込まれる。名前と説明だけが読み込まれるので、コンテキストウィンドウを埋め尽くさない。PR レビューのチェックリストは、デバッグ中にはコンテキストに要らない——レビューを頼んだときに読み込まれる。
  • Slash commands:自分でタイプする必要がある。Skills は不要——Claude が状況を認識して自動適用する。
  • Skill が効くのは:特定タスクに適用される専門知識。チームのコードレビュー基準、好みのコミットメッセージ形式、組織のブランドガイドライン。
  • 合言葉同じことを Claude に繰り返し説明していると気づいたら、それは「書かれるのを待っている skill」
  • さらに深掘りしたい人向けに専用コース 「Introduction to agent skills」 がある。

日本語(本文の自然な全訳)

コース本文は「さらに深く学びたいですか? 専用コース『Introduction to agent skills』をご覧ください」というリンクのみ。以下は動画ナレーションの全訳。

チームのコーディング規約を Claude に説明するたびに、あなたは同じことを繰り返しています。PR レビューのたびに、feedback をどう構造化してほしいかを説明し直します。コミットメッセージのたびに、好みの形式を Claude に思い出させます。

Skills はこれを解決します。

Skill とは、あるやり方を Claude に一度教える Markdown ファイルで、Claude はその知識を、関連する場面ならいつでも自動的に適用します。

Agent skills は、エージェントが発見して使える、指示・スクリプト・リソースのフォルダで、物事をより正確かつ効率的にこなすためのものです。Claude Code では SKILL.md ファイルを使います。

description(説明)は、Claude がその skill を使うかどうかを判断する手がかりです。あなたが Claude に「この PR をレビューして」と頼むと、Claude はそのリクエストを、利用可能な skill の description 群と照合し、これに一致するものを見つけます。Claude はあなたのリクエストを読み、利用可能なすべての skill の description と比較し、一致するものを起動します。

Skill はいくつかの場所に、誰に必要かに応じて保存できます。

Personal skills は、ホームディレクトリの .claude/skills に入り、あなたのすべてのプロジェクトについて回ります。これらはあなたの好み——コミットメッセージのスタイル、ドキュメントの形式、コードをどう説明してほしいか、です。

Project skills は、リポジトリのルートディレクトリ内の .claude/skills に入ります。そのリポジトリを clone した人は誰でも、これらの skill を自動的に得ます。ここはチーム標準が住む場所です——会社のブランドガイドライン、Web デザインで使う推奨フォントや色、といったものです。

Claude Code には、挙動をカスタマイズする方法がいくつかあります。Skills が独特なのは、自動的で、かつタスク特化だからです。

CLAUDE.md ファイルは、すべての会話に読み込まれます。Claude に常に TypeScript strict mode を使わせたいなら、それは CLAUDE.md ファイルに入れます。一方 Skills は、あなたのリクエストに一致したときにオンデマンドで読み込まれます。読み込まれるのは名前と説明だけなので、コンテキストウィンドウ全体を埋めることはありません。PR レビューのチェックリストは、デバッグしているときにはコンテキストに要りません。実際にレビューを頼んだときに読み込まれます。

Slash commands は、自分でタイプする必要があります。Skills は違います。Claude が状況を認識したときに、それを適用します。

Skills は、特定のタスクに適用される専門知識に最も向いています。チームが従うコードレビュー基準、あなたが好むコミットメッセージ形式、組織のブランドガイドライン、などです。

同じことを Claude に繰り返し説明していると気づいたら——それはまさに、書かれるのを待っている skill です。

英語逐語(動画字幕)

Every time you explain your team's coding standards to Claude, you're repeating yourself. Every PR review, you redescribe how you want feedback structured. Every commit message, you remind Claude of your preferred format. And skills fix this.

A skill is a markdown file that teaches Claude how to do something once, and Claude applies that knowledge automatically whenever it's relevant. Agent skills are folders of instructions, scripts, and resources that agents can discover and use to do things more accurately and efficiently. With Claude Code, we have the skill.md file.

The description is how Claude decides whether to use the skill. When you ask Claude to review this PR, it matches your request against available skill descriptions and finds this one. Claude reads your request, compares it to all available skill descriptions, and activates the ones that match.

You can store skills in a few places depending on who needs them. Personal skills go in the home directory .claude/skills and follow you across all your project. These are your preferences, your commit message style, your documentation format, how you like code explained. Project skills go in the .claude/skills inside of the root directory of your repository. Anyone who clones the repository gets these skills automatically. This is where team standards live, like your company's brand guidelines, preferred fonts, and colors that you use for web design.

Claude Code has several ways to customize behavior. Skills are unique because they're automatic and task-specific. Claude.md files load into every conversation. If you want Claude to always use TypeScript strict mode, that goes in your claw.md file. Skills, on the other hand, load on demand when they match your request. It only loads in the name and description, so it doesn't fill up your entire context window. Your PR review checklist doesn't need to be in the context when you're debugging. It loads when you actually ask for a review.

Slash commands require you to type them. Skills don't. Claude applies them when it recognizes the situation. Skills work best for specialized knowledge that applies to specific tasks. Code review standards your team follows, commit message formats that you prefer, brand guidelines of your organization. If you find yourself explaining the same thing to Claude repeatedly, well, that's a skill waiting to be written.
↑ 目次へ戻る

Claude Code 101 | Lesson 13「コースクイズ(Course quiz)」

出典: Anthropic Academy / YouTube動画ID UAmKyyZ-b9E / 2026-07-04

クイズ(受験は別途実施)

このレッスンはコース修了クイズです。本文はクイズ表示用の JavaScript のみで、設問内容そのものは動的読み込みのためテキスト化されていません。受験は Anthropic Academy 上で別途実施してください(合格すると修了証= certificates/claude-code-101-certificate.pdf が発行される)。

Lesson 01〜12 の要点(各ノートの「日本語ナレッジ」)を復習しておけば十分に対応できる内容です。

↑ 目次へ戻る