skip to content
サイトロゴ 子育てSEパパのIT・AI×副業ラボ
Table of Contents

この記事で扱う内容

この記事では、Claude Code CLIのダウンロードとインストール方法についてご紹介します。

前提

前提知識・前提スキル

  • Windows OS の基本操作ができる人

前提環境

  • 使用PC
    • OS が Windows 11であること
    • Gitがインストールされていること(最新版が推奨されている)
    • Claude Code CLIをインストールしても良いこと
参考記事Gitのダウンロードとインストール方法【Windows】【初心者向け】
  • その他
    • Claudeアカウントを作成済みであること
    • ClaudeアカウントのサブスクリプションプランがClaude Codeを利用可能であること
      (Claude Code CLIを利用する場合)
参考記事Claudeアカウント作成方法【初心者向け】【無料】

Claude Codeとは

Claude Codeは、**Anthropic社が提供する「AIコーディング支援サービス(コーディングエージェント)」**です。

AI「Claude」を使って開発作業を支援してくれます。

コードベースを読み取り、複数ファイルの編集やコマンド実行まで行い、バグ修正や機能追加をサポートします。

Claude Code CLIとは

Claude Code CLIは、AIサービス「Claude」をコマンドライン(黒い画面)から使うための開発者向けツールです。

コードの生成や修正、タスクの自動化などを、ターミナル上で効率よく行えます。

Claude Code CLIのダウンロードとインストール方法

Claude Codeのダウンロードとインストール方法のアイキャッチ画像

スタートメニューで「ターミナル」を検索後、「ターミナル」を選択し起動する

ターミナルを起動する操作の画面キャプチャ

ターミナル(PowerShell)が表示されるため、以下のコマンドで「Claude Code CLI」をダウンロード・インストールする

コマンド例

irm https://claude.ai/install.ps1 | iex
ターミナル(PowerShell)が表示されるため、以下のコマンドで「Claude Code」をダウンロード・インストールする操作(コマンド例)の画面キャプチャ

実行結果例

ターミナル(PowerShell)が表示されるため、以下のコマンドで「Claude Code」をダウンロード・インストールする操作(実行結果例)の画面キャプチャ

Claude Code CLIのパスをWindows環境変数に追加する

Claude CodeのパスをWindows環境変数に追加する画面キャプチャ

今回は、Claude Code CLIインストール時に表示されたメッセージに従い、Claude Codeのパスをユーザー環境変数「Path」に追加します。

環境変数種別環境変数名環境変数値
ユーザー環境変数PathC:\Users\ユーザー名\.local\bin\

詳細な操作方法が知りたい方は、以下のブログ記事を参考にしてください。

https://sepapalab.com/how-to-set-environment-variables-on-windows11/#toc12

(任意)ターミナル(PowerShell)で「claude」コマンドを試し打ちする

(任意)ターミナル(PowerShell)で「claude」コマンドを試し打ちするのアイキャッチ画像

Claude Code CLIを利用しない場合(無料プラン可)

コマンド例

claude --help to get started
(任意)ターミナル(PowerShell)で「claude」コマンドを試し打ちする操作(コマンド例)の画面キャプチャ

実行結果例

Usage: claude [options] [command] [prompt]
Claude Code - starts an interactive session by default, use -p/--print for non-interactive output
Arguments:
prompt Your prompt
Options:
--add-dir <directories...> Additional directories to allow tool access to
--agent <agent> Agent for the current session. Overrides the 'agent' setting.
--agents <json> JSON object defining custom agents (e.g. '{"reviewer":
{"description": "Reviews code", "prompt": "You are a code
reviewer"}}')
--allow-dangerously-skip-permissions Enable bypassing all permission checks as an option, without it
being enabled by default. Recommended only for sandboxes with no
internet access.
--allowedTools, --allowed-tools <tools...> Comma or space-separated list of tool names to allow (e.g.
"Bash(git:*) Edit")
--append-system-prompt <prompt> Append a system prompt to the default system prompt
--betas <betas...> Beta headers to include in API requests (API key users only)
--chrome Enable Claude in Chrome integration
-c, --continue Continue the most recent conversation in the current directory
--dangerously-skip-permissions Bypass all permission checks. Recommended only for sandboxes with
no internet access.
-d, --debug [filter] Enable debug mode with optional category filtering (e.g.,
"api,hooks" or "!1p,!file")
--debug-file <path> Write debug logs to a specific file path (implicitly enables debug
mode)
--disable-slash-commands Disable all skills
--disallowedTools, --disallowed-tools <tools...> Comma or space-separated list of tool names to deny (e.g.
"Bash(git:*) Edit")
--effort <level> Effort level for the current session (low, medium, high)
--fallback-model <model> Enable automatic fallback to specified model when default model is
overloaded (only works with --print)
--file <specs...> File resources to download at startup. Format:
file_id:relative_path (e.g., --file file_abc:doc.txt
file_def:img.png)
--fork-session When resuming, create a new session ID instead of reusing the
original (use with --resume or --continue)
--from-pr [value] Resume a session linked to a PR by PR number/URL, or open
interactive picker with optional search term
-h, --help Display help for command
--ide Automatically connect to IDE on startup if exactly one valid IDE is
available
--include-partial-messages Include partial message chunks as they arrive (only works with
--print and --output-format=stream-json)
--input-format <format> Input format (only works with --print): "text" (default), or
"stream-json" (realtime streaming input) (choices: "text",
"stream-json")
--json-schema <schema> JSON Schema for structured output validation. Example:
{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}
--max-budget-usd <amount> Maximum dollar amount to spend on API calls (only works with
--print)
--mcp-config <configs...> Load MCP servers from JSON files or strings (space-separated)
--mcp-debug [DEPRECATED. Use --debug instead] Enable MCP debug mode (shows MCP
server errors)
--model <model> Model for the current session. Provide an alias for the latest
model (e.g. 'sonnet' or 'opus') or a model's full name (e.g.
'claude-sonnet-4-6').
--no-chrome Disable Claude in Chrome integration
--no-session-persistence Disable session persistence - sessions will not be saved to disk
and cannot be resumed (only works with --print)
--output-format <format> Output format (only works with --print): "text" (default), "json"
(single result), or "stream-json" (realtime streaming) (choices:
"text", "json", "stream-json")
--permission-mode <mode> Permission mode to use for the session (choices: "acceptEdits",
"bypassPermissions", "default", "dontAsk", "plan")
--plugin-dir <paths...> Load plugins from directories for this session only (repeatable)
-p, --print Print response and exit (useful for pipes). Note: The workspace
trust dialog is skipped when Claude is run with the -p mode. Only
use this flag in directories you trust.
--replay-user-messages Re-emit user messages from stdin back on stdout for acknowledgment
(only works with --input-format=stream-json and
--output-format=stream-json)
-r, --resume [value] Resume a conversation by session ID, or open interactive picker
with optional search term
--session-id <uuid> Use a specific session ID for the conversation (must be a valid
UUID)
--setting-sources <sources> Comma-separated list of setting sources to load (user, project,
local).
--settings <file-or-json> Path to a settings JSON file or a JSON string to load additional
settings from
--strict-mcp-config Only use MCP servers from --mcp-config, ignoring all other MCP
configurations
--system-prompt <prompt> System prompt to use for the session
--tmux Create a tmux session for the worktree (requires --worktree). Uses
iTerm2 native panes when available; use --tmux=classic for
traditional tmux.
--tools <tools...> Specify the list of available tools from the built-in set. Use ""
to disable all tools, "default" to use all tools, or specify tool
names (e.g. "Bash,Edit,Read").
--verbose Override verbose mode setting from config
-v, --version Output the version number
-w, --worktree [name] Create a new git worktree for this session (optionally specify a
name)
Commands:
agents [options] List configured agents
auth Manage authentication
doctor Check the health of your Claude Code auto-updater
install [options] [target] Install Claude Code native build. Use [target] to specify version
(stable, latest, or specific version)
mcp Configure and manage MCP servers
plugin Manage Claude Code plugins
setup-token Set up a long-lived authentication token (requires Claude
subscription)
update|upgrade Check for updates and install if available
(任意)ターミナル(PowerShell)で「claude」コマンドを試し打ちする操作(実行結果例1)の画面キャプチャ (任意)ターミナル(PowerShell)で「claude」コマンドを試し打ちする操作(実行結果例2)の画面キャプチャ (任意)ターミナル(PowerShell)で「claude」コマンドを試し打ちする操作(実行結果例3)の画面キャプチャ (任意)ターミナル(PowerShell)で「claude」コマンドを試し打ちする操作(実行結果例4)の画面キャプチャ

Claude Code CLIを利用する場合(無料プラン不可)

任意の作業フォルダへ移動する

コマンド例

cd D:\ClaudeCodeTest
任意の作業フォルダへ移動する操作の画面キャプチャ(コマンド例)

実行結果例

PS D:\ClaudeCodeTest>
任意の作業フォルダへ移動する操作の画面キャプチャ(実行結果例)

claudeコマンドを試し打ちする

「claude」コマンドを実行する

コマンド例

claude
「claude」コマンドを実行する操作の画面キャプチャ(コマンド例)

実行結果例

Welcome to Claude Code v2.1.63
…………………………………………………………………………………………………………………………………………………………
* █████▓▓░
* ███▓░ ░░
░░░░░░ ███▓░
░░░ ░░░░░░░░░░ ███▓░
░░░░░░░░░░░░░░░░░░░ * ██▓░░ ▓
░▓▓███▓▓░
* ░░░░
░░░░░░░░
░░░░░░░░░░░░░░░░
█████████ *
██▄█████▄██ *
█████████ *
…………………█ █ █ █………………………………………………………………………………………………………………
Let's get started.
Choose the text style that looks best with your terminal
To change this later, run /theme
❯ 1. Dark mode ✔
1. Light mode
2. Dark mode (colorblind-friendly)
3. Light mode (colorblind-friendly)
4. Dark mode (ANSI colors only)
5. Light mode (ANSI colors only)
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
1 function greet() {
2 - console.log("Hello, World!");
2 + console.log("Hello, Claude!");
3 }
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
Syntax theme: Monokai Extended (ctrl+t to disable)
「claude」コマンドを実行する操作の画面キャプチャ(実行結果例)
テキストスタイルの確認メッセージが表示されるため、任意のスタイルを選択し、「Enter」キーを押す
テキストスタイルの確認メッセージが表示されるため、任意のスタイルを選択し、「Enter」キーを押す操作の画面キャプチャ
ログイン方法を確認するメッセージが表示されるため、任意の方法を選択し、「Enter」キーを押す

※今回は、「1. Claude account with subscription · Pro, Max, Team, or Enterprise」を選択します。

ログイン方法を確認するメッセージが表示されるため、任意の方法を選択する操作の画面キャプチャ
ブラウザが自動で起動しログイン画面が表示されるため、Claudeアカウントでログインする

※今回は、メールアドレスでログインします。

ブラウザが自動で起動し、Claudeの認証画面が表示されるため、任意の方法でログインする操作の画面キャプチャ1 ブラウザが自動で起動し、Claudeの認証画面が表示されるため、任意の方法でログインする操作の画面キャプチャ2
登録してあるメールアドレスにメールが送られてくるため、「Claude.aiにサインイン」ボタンを押す
登録してあるメールアドレスにメールが送られてくるため、「Claude.aiにサインイン」ボタンを押す操作の画面キャプチャ
Claude Codeに対するClaudeアカウント接続承認画面が表示されるため、対象のアカウントを確認し、「承認する」ボタンを押す
Claude Codeに対するClaudeアカウント接続承認画面が表示されるため、対象のアカウントを確認し、「承認する」ボタンを押す操作の画面キャプチャ
承認完了画面が表示されるため、このウィンドウを閉じる
承認完了画面が表示されるため、このウィンドウを閉じる操作の画面キャプチャ
Claude Code CLIの画面に接続したClaudeアカウントとログイン成功のメッセージが表示されるため、「Enter」キーを押す
Claude Code CLIの画面に接続したClaudeアカウントとログイン成功のメッセージが表示されるため、「Enter」キーを押す操作の画面キャプチャ
セキュリティに関する注意事項が表示されるため、内容を確認後、「Enter」キーを押す
セキュリティに関する注意事項が表示されるため、内容を確認後、「Enter」キーを押す操作の画面キャプチャ
作業フォルダの信頼性を確認するメッセージが表示されるため、「1. Yes, I trust this folder(はい、このフォルダを信頼します)」を選択し、「Enter」キーを押す
作業フォルダの信頼性を確認するメッセージが表示されるため、「1. Yes, I trust this folder(はい、このフォルダを信頼します)」を選択し、「Enter」キーを押す操作の画面キャプチャ
Claude Code CLIが利用可能になる
Claude Code CLIが利用可能になる操作の画面キャプチャ

Claude Code CLIに指示(プロンプト)を試し打ちする

Claude Code CLIに任意の指示(プロンプト)を入力後、「Enter」キーを押す

※今回は、テストファイルを作成します。

コマンド例

試しに `テストです。` と記載された `Test.txt` を作成してみてください。
Claude Code CLIに任意の指示(プロンプト)を入力後、「Enter」キーを押す操作の画面キャプチャ(コマンド例)

実行結果例

● Write(Test.txt)
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Create file
Test.txt
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
1 テストです。
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
:::note
Do you want to create Test.txt?
「Test.txt」を作成しますか?
:::
##### ファイル操作の許可レベルを確認するメッセージが表示されるため、「1. Yes(はい)」を選択後し、「Enter」キーを押す
![ファイル操作の許可レベルを確認するメッセージが表示されるため、「1. Yes(はい)」を選択後し、「Enter」キーを押す操作の画面キャプチャ](./image-50.png)
:::note
選択肢の意味ですが、以下の通りと考えて良いと思います。
No
選択肢
意味
備考
1
Yes
このファイル操作だけ許可する
・通常、これを選択しておけば良い
2
Yes, allow all edits during this session (shift+tab)
このセッション中のファイル操作をすべて許可する
・開発効率は上がるが誤操作リスクも高まる
3
No
このファイル操作を許可しない
:::
| No | 選択肢 | 意味 | 備考 |
| --- | ---------------------------------------------------- | ---------------------------------------------- | ---------------------------------------- |
| 1 | Yes | このファイル操作だけ許可する | ・通常、これを選択しておけば良い |
| 2 | Yes, allow all edits during this session (shift+tab) | このセッション中のファイル操作をすべて許可する | ・開発効率は上がるが誤操作リスクも高まる |
| 3 | No | このファイル操作を許可しない | |
##### 指示(プロンプト)に対する完了メッセージが表示されるため、結果を確認する
![指示(プロンプト)に対する完了メッセージが表示されるため、結果を確認する操作の画面キャプチャ1](./image-52.png)
![指示(プロンプト)に対する完了メッセージが表示されるため、結果を確認する操作の画面キャプチャ2](./image-53.png)
## おすすめの関連記事
[Gitのダウンロードとインストール方法【Windows】【初心者向け】](/how-to-download-and-install-git-to-windows/)
[Windows 11の環境変数を画面操作で設定する方法【初心者向け】](/how-to-set-environment-variables-on-windows11/)
[Claudeアカウント作成方法【初心者向け】【無料】](/how-to-create-a-claude-account/)
[Windows版Claudeアプリ(Claude for Windows)のダウンロード・インストール方法【初心者向け】](/how-to-download-and-install-claude-for-windows/)
[PyCharmとClaude Code CLIをClaude Codeプラグインで連携する方法【Windows】【初心者向け】](/how-to-integrate-pycharm-and-claude-code-cli-using-the-claude-code-plugin/)
## 参考
- [Claude Code公式サイト(Product > Claude Code)](https://claude.com/product/claude-code)
- [Claude Code Docs(はじめに)](https://code.claude.com/docs/ja/overview#%E3%81%AF%E3%81%98%E3%82%81%E3%81%AB)