1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Claude Code】 Custom Slash Command を作成する Custom Slash Command を作成する

Last updated at Posted at 2025-07-17

なにこれ?

※IME 入力時のバグのようにタイトルで同じ文字列が二度繰り返されていますが、バグではありません。

最近、 Claude Code を使用するようになって Custom Slash Commands のありがたみを感じるようになってきました。
しかし、 Custom Slash Command の作成は意外とめんどくさい。
どういう文言でどういうステップにしようかな〜なんて考えて、考えた内容を言語化してファイルに書き出すのもめんどくさい。(AI Agent 依存症?)

というわけで、「Custom Slash Command を作成」してくれる Custom Slash Command を作成してみたら、意外とイイ感じだったので共有します。

TL;DR

この発想にいたって、 Claude さんにたずねてみたチャットが以下です。同じように質問すれば似たような Custom Slash Command を定義してくれるでしょう。

Custom Slash Command の中身は上記チャットの Artifact からコピーしてください。

チャットのプロンプト(上記リンクが切れたとき用) Claude Code の Custom Slash Commands を作成する Custom Slash Command を作成したい。 同じようなことをしている人がいればそれを参考に Custom Slash Command を作成してください。

How to use?

  1. Claude Code 内で、 /create-custom-command add-claude-rule といったメッセージを入力
  2. どのような Custom Slash Command を作るか聞かれるので質問に回答
  3. Custom Slash Command のできあがり

実際の使用例

CLAUDE.md にルール追加もめんどくさいので、それをイイ感じにやってくれる Custom Slash Command を追加してもらった例

image.png

作成された Custom Slash Command の使用例

上記で作成してもらった CLAUDE.md にルールを追加してくれる Custom Slash Command を使ってみた例

image.png

かんそう

Custom Slash Command で $ARGUMENT を受け取れるのは知っていたけど、ステップに分けて対話的にいろいろやってくれるのは意外と知らなかった。
Custom Slash Command の難点はそれ自体を定義することだったので、コイツのおかげでかなりは捗りそう。

みなさんも Custom Slash Command で良き Vibe Coding ライフをお送りください。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?