cc101 チートシートcc101 Cheat Sheet

Claude Code の「あれ、なんだっけ?」を 1 枚で解決。印刷してモニタの横にどうぞ。Every "wait, what was that command?" moment, solved on one page. Print it and keep it next to your monitor.

← ホームへ← Home

インストール & 更新Install & update

コマンドCommand説明What it does
curl -fsSL https://claude.ai/install.sh | bashネイティブインストール(推奨・自動更新つき)Native installer (recommended; auto-updates)
brew install --cask claude-codeHomebrew 版(更新は手動)Homebrew cask (manual updates)
npm install -g @anthropic-ai/claude-codenpm 版(Node.js 22+ が必要・sudo 禁止)npm install (needs Node.js 22+; never sudo)
claude --versionバージョン確認(インストール成功の合図)Check version (proof the install worked)
claude update今すぐ手動アップデートApply an update right now
brew upgrade claude-codeHomebrew 版のアップデートUpdate the Homebrew install
claude doctor総合診断(--text で読みやすい出力)Full diagnostics (--text for friendlier output)
which -a claude重複インストールの発見(古い版が残っている時)Find duplicate installs (when an old version lingers)
sw_versmacOS バージョン確認(13.0 以上が必要)Check macOS version (13.0+ required)

セッションの開始と再開Starting & resuming sessions

コマンドCommand説明What it does
claude対話セッションを開始Start an interactive session
claude "fix the login bug"最初のプロンプト付きで開始Start with an initial prompt
claude -c / --continueこのディレクトリの直近の会話を続行Continue the most recent conversation here
claude -r / --resume保存済みセッションのピッカーを開くOpen the saved-session picker
claude --resume "auth-refactor"名前や ID を指定して再開Resume by name or ID
claude -n "auth-refactor"名前を付けて開始(ピッカーで見つけやすく)Start a named session (easy to find later)
claude --from-pr 42PR にひもづいたセッションを再開Resume the session linked to a PR
claude -p "explain this code"一回きりの実行:答えを出力して終了Print mode: answer once, then exit
cat file.txt | claude -p "summarize"パイプで入力を渡すPipe input straight in
claude --permission-mode planプランモード(読み取り専用)で開始Start in plan mode (read-only)
claude --model opusモデルを指定して開始Start with a specific model
claude --worktree feature-authworktree を作って並行作業Spin up a git worktree for parallel work

終了はどれでも:⌃ Ctrl + D/exit(または /quit)、⌃ Ctrl + C を 2 回。

Exit any of these ways: ⌃ Ctrl + D, /exit (or /quit), or ⌃ Ctrl + C twice.

セッション内キーボード & 入力プレフィックスIn-session keys & input prefixes

キーボードKeyboard

キーKey説明What it does
⎋ EscClaude の応答を途中で止める(作業内容は保持)Stop Claude mid-response (work so far is kept)
⎋ Esc ⎋ Esc下書きをクリア。入力が空ならチェックポイントに巻き戻しClear the draft; if input is empty, rewind to a checkpoint
⇧ Shift + Tab権限モードを切替:default → acceptEdits → plan → …Cycle permission modes: default → acceptEdits → plan → …
⇧ Shift + ⏎ Enter複数行入力(⌃ Ctrl + J\ + でも可)Multiline input (⌃ Ctrl + J or \ + also work)
⌃ Ctrl + C1 回で入力クリア、2 回でセッション終了Once clears input; twice exits the session
⌃ Ctrl + R履歴を逆方向検索Reverse-search command history
⌃ Ctrl + Oトランスクリプト表示(ツール呼び出しの詳細)Toggle transcript view (detailed tool calls)
⌃ Ctrl + TClaude のタスクリストを表示/非表示Toggle Claude's task list
⌃ Ctrl + B実行中の Bash コマンドをバックグラウンドへSend a running Bash command to the background
⌃ Ctrl + Gプロンプトやプランを $EDITOR で編集Edit your prompt or plan in $EDITOR
⌃ Ctrl + L画面を再描画(表示乱れの修復)Redraw the screen (fixes garbled display)
⌥ Option + Pモデルピッカーを開く(要 Option=Meta 設定)Open the model picker (needs Option-as-Meta)
⌥ Option + T拡張思考の ON/OFF(Fable 5 には効果なし)Toggle extended thinking (no effect on Fable 5)
⌃ Ctrl + V画像をペースト(iTerm2 では ⌘ Cmd + VPaste an image (in iTerm2 use ⌘ Cmd + V)

⌥ Option 系ショートカットは初期設定では動きません。iTerm2:Settings → Profiles → Keys → Option キーを「Esc+」に。Terminal.app:Settings → Profiles → Keyboard →「Use Option as Meta Key」にチェック。

⌥ Option shortcuts don't work out of the box. iTerm2: Settings → Profiles → Keys → set the Option keys to "Esc+". Terminal.app: Settings → Profiles → Keyboard → check "Use Option as Meta Key".

入力プレフィックスInput prefixes

先頭文字Prefix説明What it does
/スラッシュコマンド。/mo のように打つと絞り込み検索Slash commands. Type /mo to filter the list as you go
!シェルモード:コマンドを直接実行し、出力を会話に追加。Tab で履歴補完、⎋ Esc で解除Shell mode: run a command directly and add its output to the chat. Tab completes from history; ⎋ Esc exits
#メモリに追加:.claude/memory/ に保存され、次回以降も自動で読み込まれるAdd to memory: saved under .claude/memory/ and auto-loaded in future sessions
@ファイル参照のあいまい補完(@auth.ts など)Fuzzy file references (e.g. @auth.ts)

スラッシュコマンド(よく使う約 20 個)Slash commands (the ~20 you'll actually use)

🗂 セッション🗂 Session
/clearまっさらな会話を開始(前の会話は /resume に保存)Start fresh (previous chat is saved for /resume)
/resume名前・ID で再開、または一覧から選択Resume by name/ID, or pick from the list
/renameセッションに表示名を付けるGive the session a display name
/rewindコードと会話をチェックポイントへ巻き戻しRoll code and conversation back to a checkpoint
/exit / /quitセッションを終了Exit the session
🧠 モデル & コンテキスト🧠 Model & context
/modelモデルを切替(引数なしでピッカー表示)Switch models (no argument opens the picker)
/effort推論の深さを設定:low / medium / high / xhigh / maxSet reasoning depth: low / medium / high / xhigh / max
/contextトークン使用量をグリッド表示+最適化のヒントVisualize token usage as a grid + optimization hints
/compact会話を要約して空きを作る(焦点の指示も可)Summarize the chat to free space (optional focus)
/usageセッションのコストと利用状況(/cost /stats も同じ)Session cost & usage (/cost and /stats are aliases)
📝 メモリ & 設定📝 Memory & setup
/initCLAUDE.md をひな形から自動生成Generate a starter CLAUDE.md
/memoryCLAUDE.md と自動メモリを閲覧・編集View & edit CLAUDE.md and auto-memory
/permissionsallow / ask / deny ルールを管理Manage allow / ask / deny rules
/config設定 UI を開く、または key=value で直接設定Open settings UI, or set key=value directly
/mcpMCP サーバの接続・認証・有効/無効Connect, authenticate, enable/disable MCP servers
/hooks設定済み hooks の一覧を表示List configured hooks
🔧 ワークフロー🔧 Workflow
/planプランモードに入る(読み取り専用で計画)Enter plan mode (read-only planning)
/diff対話型 diff ビューアInteractive diff viewer
/code-review差分をバグ・改善点でレビューReview your diff for bugs and cleanups
/export会話をテキストで書き出しExport the conversation as plain text
/btw履歴に残さずサッと質問Ask a quick side question without touching history
🩺 ヘルプ & おまけ🩺 Help & fun
/helpコマンド一覧とヘルプShow help and available commands
/statusバージョン・モデル・アカウント・接続状態Version, model, account, connectivity
/doctorインストールと設定を診断Diagnose installation and settings
/radioClaude FM(lo-fi ラジオ)を再生 📻Open Claude FM lo-fi radio 📻

/ を打つだけで全コマンドが検索できるので、この表すら覚えなくて大丈夫。/mo と打てば /model/mcp に一瞬で絞り込まれます。

Type / and the whole catalog becomes searchable — you don't even need to memorize this table. Typing /mo instantly narrows to /model, /mcp, and friends.

メモリ & CLAUDE.md ファイル地図Memory & the CLAUDE.md file map

場所Location役割(読み込み順)Role (load order)
/Library/Application Support/ClaudeCode/CLAUDE.md組織の管理ポリシー(ユーザーは編集不可)Managed org policy (not user-editable)
~/.claude/CLAUDE.mdあなた専用・全プロジェクト共通のルールYour personal rules for every project
./CLAUDE.mdプロジェクト共有(git にコミット、./.claude/CLAUDE.md も可)Team-shared, checked into git (./.claude/CLAUDE.md also works)
./CLAUDE.local.md個人用の上書きメモ(.gitignore に追加する)Personal-only notes (add to .gitignore)
./src/CLAUDE.mdサブディレクトリ用。そこを触るときだけ遅延ロードNested; lazy-loaded only when Claude works there
.claude/memory/# プレフィックスの保存先(自動メモリ)Where # memory entries land (auto-memory)

設定ファイルと権限ルール構文Settings files & permission rule syntax

ファイルFileスコープ(上ほど優先)Scope (higher wins)
/Library/Application Support/ClaudeCode/managed-settings.json組織の管理設定(上書き不可)Managed policy (cannot be overridden)
--model などの CLI フラグCLI flags like --modelそのセッション限りの上書きSession-only override
.claude/settings.local.jsonプロジェクト個人設定(git 管理外)Personal project settings (gitignored)
.claude/settings.jsonプロジェクト共有設定(git にコミット)Team-shared project settings (committed)
~/.claude/settings.jsonユーザー全体の既定値Your global defaults
{
  "permissions": {
    "allow": ["Bash(npm run *)", "Read(.claude/**)"],
    "ask":   ["Bash(rm *)"],
    "deny":  ["Read(~/.ssh/**)"]
  }
}
ルール例Rule意味Meaning
Bash(npm run *)npm run で始まるコマンドCommands starting with npm run
Bash(ls *) vs Bash(ls*)前者は単語区切りあり(lsof は対象外)、後者はなしFirst has a word boundary (won't match lsof); second doesn't
Edit(src/**)プロジェクトの src/ 以下の編集Edits under the project's src/
Read(~/.ssh/**)ホームの .ssh 以下の読み取りReads under ~/.ssh
WebFetch(domain:github.com)github.com へのアクセスのみWeb requests to github.com only
mcp__github__*github MCP サーバの全ツールAll tools from the github MCP server

Hooks イベント一覧Hook events at a glance

イベントEvent発火タイミングFires when
SessionStart / SessionEndセッション開始(matcher: startup / resume / clear / compact)・終了Session begins (matcher: startup / resume / clear / compact) or ends
UserPromptSubmitあなたがプロンプトを送信した直後Right after you submit a prompt
PreToolUse / PostToolUseツール実行の直前・直後(matcher はツール名。ブロック可能)Before/after any tool call (matcher = tool name; can block)
FileChangedファイルの作成・変更(matcher はファイル名パターン)A file is created or modified (matcher = filename pattern)
Stop / StopFailureClaude の応答完了・失敗Claude finishes a response / a response fails
Notification通知の表示(matcher: permission_prompt など)A notification is shown (matcher: permission_prompt, etc.)
SubagentStart / SubagentStopサブエージェントの開始・終了A subagent starts or finishes
PreCompactコンテキスト圧縮の直前Just before context compaction
CwdChanged / WorktreeCreate / Setup作業ディレクトリ変更・worktree 作成・セットアップ処理Working dir changes / a worktree is created / setup flows

MCP コマンドMCP commands

コマンドCommand説明What it does
claude mcp add --transport http <name> <url>リモート HTTP サーバを追加Add a remote HTTP server
claude mcp add <name> -- <command> [args...]ローカル stdio サーバを追加(-- 区切りは必須!)Add a local stdio server (the -- separator is required!)
claude mcp add --scope project ....mcp.json に保存してチームで共有Save to .mcp.json and share with your team
claude mcp list設定済みサーバの一覧List configured servers
claude mcp get <name>サーバ 1 件の詳細を表示Show details for one server
claude mcp remove <name>サーバを削除Remove a server
claude mcp login <name>OAuth 認証を完了(logout で解除)Complete OAuth (logout to clear)
/mcpセッション内パネル:接続状態・認証・有効/無効切替In-session panel: connection status, auth, enable/disable

スコープは 3 種類:local(既定・このプロジェクトの自分だけ)、project.mcp.json でチーム共有)、user(自分の全プロジェクト)。

Three scopes: local (default — just you, this project), project (team-shared via .mcp.json), and user (all your projects).

ヘッドレスモード主要フラグHeadless mode: the flags that matter

フラグFlag説明What it does
-p "prompt"プリントモード:一度応答して終了(すべての起点)Print mode: answer once and exit (the starting point)
--output-format json結果・session_id・コストを含む JSON で出力(stream-json でストリーミング)Structured JSON with result, session_id, cost (stream-json to stream)
--barehooks・skills・プラグイン・MCP・CLAUDE.md をスキップ(CI 最速)Skip hooks, skills, plugins, MCP, CLAUDE.md (fastest for CI)
--max-turns 5エージェントの反復回数を制限Cap agentic iterations
--allowedTools "Bash(git *),Read,Edit"ツールを事前承認Pre-approve tools
--disallowedTools "Bash(rm *)"パターンで拒否Deny by pattern
--permission-mode acceptEditsファイル編集を自動承認(auto なら分類器が安全確認)Auto-approve file edits (auto adds a safety classifier)
--max-budget-usd 10.00支出の上限を設定Set a spend cap
--continue直近セッションの続きから実行Continue from the last session

組み合わせるとこうなります。git ログが 1 コマンドでチェンジログに:

Put together, one command turns your git log into a changelog:

git log --oneline main..HEAD | claude -p "Generate a changelog" --output-format json | jq -r '.result'