DEV Community

AgentKoji
AgentKoji

Posted on Originally published at agentkoji.com

Claude Codeのコマンド早見表と自作コマンド

Claude Code の / コマンドを作業の流れに沿って整理し、.claude/commands/ での自作コマンドの作り方をまとめました(Claude Code 2.1.309、2026年10月23日時点)。

基本

  • コマンドはメッセージの先頭でだけ認識され、後ろの文字は引数になる
  • / で一覧が出て、続けて打つと絞り込める
  • ターミナルでは先頭に skill を最大6つ続けて書ける(/skill-a /skill-b do XYZ)
  • 応答中に送ると待ち行列に入る。/status、/tasks、/usage はすぐ動く

場面別の早見表(抜粋)

場面 コマンド 何をするか
初めてのリポジトリ /init CLAUDE.md の下書きを作る
/permissions allow・ask・deny のルールを管理
作業中 /plan plan mode に入る
/context コンテキストの使用状況を見る
/compact [指示] 会話を要約して空きを作る
/btw [質問] 履歴に残さず横道の質問
並列 /batch <指示> 大きな変更を分けて worktree で進める
出荷の前 /diff、/code-review、/security-review 差分の確認とレビュー
セッション /clear、/resume、/branch 新規・再開・分岐
不調 /rewind、/doctor、/debug 巻き戻し・点検・ログ
いつでも /usage、/status 利用枠・状態

出典:https://code.claude.com/docs/en/commands (2026-10-23確認)

自作コマンド

カスタムコマンドは skill に統合されましたが、.claude/commands/ の Markdown も動きます。ファイル名がコマンド名です。

---
description: Fix a todo-app issue by number. Use when the user gives an issue number.
argument-hint: "[issue-number]"
---

Fix issue #$ARGUMENTS in the todo app.

1. Read the failing test or the steps in the issue.
2. Make the smallest change that fixes it.
3. Run `npm test` and report the result.
Enter fullscreen mode Exit fullscreen mode

.claude/commands/fix-issue.md に置くと /fix-issue 42 で $ARGUMENTS が 42 になります。位置ごとなら $0、$1。サブディレクトリは : 区切りで、.claude/commands/release/notes.md は /release:notes です。disable-model-invocation: true で Claude が自分から使わなくなります。

claude plugin validate .claude/commands で書式を確認できます。YAML が壊れたファイルは、メタデータが空のまま読み込まれる、とエラーに出ました。

commands と skills

同じ名前なら skill が優先されます。補助ファイルを置けるので、新しく作るなら skill が公式のおすすめです。

出典:https://code.claude.com/docs/en/skills (2026-10-23確認)

全コマンドの表と「うまく出ないとき」の確認表は元記事にあります。

👉 全文:https://agentkoji.com/ja/articles/claude-code-slash-commands/

Top comments (0)