Slash Command는 Claude Code에서 /명령어로 호출하는 작업 단축키다. Markdown 파일 하나가 커맨드 하나가 되며, 저장 위치에 따라 프로젝트 전용과 전역으로 나뉜다. Commands와 Skills는 둘 다 Markdown 파일이지만 호출 방식이 근본적으로 다르다.
Slash Command 파일은 .claude/commands/에 저장한다. (skills/가 아님에 주의)
.claude/commands/ # 프로젝트 전용 — git으로 팀 공유 가능
~/.claude/commands/ # 전역 — 내 컴퓨터의 모든 프로젝트에서 사용
팀 공유가 필요한 커맨드는 반드시 .claude/commands/에 넣어야 한다.
git clone 시 이 폴더가 자동으로 딸려오기 때문이다.
개인 습관 커맨드는 ~/.claude/commands/에 넣는다.
---
name: fix
description: 이슈 번호를 받아서 버그 수정
allowed-tools: Read, Grep
disable-model-invocation: false
---
이슈 #$1 번을 수정해줘.
원인 분석 후 최소한의 코드 변경으로 해결해.
YAML 프론트매터(--- 사이)가 메타데이터이고, 그 아래 내용이 Claude에게 전달되는 프롬프트다.
$1, $2, $ARGUMENTS/fix 42 high
$1 → "42" (첫 번째 인자)
$2 → "high" (두 번째 인자)
$ARGUMENTS → "42 high" (전체를 통째로)
disable-model-invocationfalse (기본값) → Claude가 상황 판단해서 자동 실행 가능
true → 사람이 직접 타이핑해야만 실행됨
배포, DB 마이그레이션처럼 돌이킬 수 없는 작업에는 반드시 true를 설정한다.
| Commands | Skills | |
|---|---|---|
| 저장 위치 | .claude/commands/ | .claude/skills/ |
| 호출 방식 | 내가 /명령어로 직접 호출 | Claude가 맥락 보고 자동 로드 |
| 예시 | /pr, /deploy | "코드 설명해줘" → 자동 감지 |
처음에 Slash Command 파일을 .claude/skills/에 저장한다고 생각했다.
정확한 경로는 .claude/commands/이고, skills/는 완전히 다른 개념이다.
.claude/commands/에 저장한다 (skills/ 아님).claude/commands/, 개인 전용은 ~/.claude/commands/$1, $2, $ARGUMENTS로 인자를 받아 동적 프롬프트를 만든다disable-model-invocation: true는 Claude 자동 실행 방지 옵션이다description 필드로 자동 감지가 어떻게 동작하는지/compact, /clear, /review)를 언제 써야 하는지A Slash Command is a shortcut invoked by typing /command in Claude Code. Each Markdown file becomes one command, and its scope — project-only or global — depends on where it is saved. Commands and Skills are both Markdown files, but they differ fundamentally in how they are triggered.
Slash Command files go in .claude/commands/. (Not skills/ — an easy mistake to make.)
.claude/commands/ # Project-only — shared with team via git
~/.claude/commands/ # Global — available across all projects on your machine
Team-shared commands must go in .claude/commands/ so they are included automatically on git clone. Personal habit commands go in ~/.claude/commands/.
---
name: fix
description: Receive an issue number and fix the bug
allowed-tools: Read, Grep
disable-model-invocation: false
---
Fix issue #$1.
Analyze the root cause and resolve it with minimal code changes.
The YAML frontmatter (between ---) is metadata. Everything below it is the prompt sent to Claude.
$1, $2, $ARGUMENTS/fix 42 high
$1 → "42" (first argument)
$2 → "high" (second argument)
$ARGUMENTS → "42 high" (everything at once)
disable-model-invocationfalse (default) → Claude can auto-invoke this command when it judges fit
true → Only runs when a person types the command explicitly
Always set to true for irreversible operations like deployments or DB migrations.
| Commands | Skills | |
|---|---|---|
| Location | .claude/commands/ | .claude/skills/ |
| How triggered | You type /command directly | Claude auto-loads based on context |
| Example | /pr, /deploy | "explain this code" → auto-detected |
Initially thought Slash Command files go in .claude/skills/.
The correct path is .claude/commands/. skills/ is an entirely separate concept.
.claude/commands/ (not skills/).claude/commands/, personal commands → ~/.claude/commands/$1, $2, $ARGUMENTS to build dynamic prompts with argumentsdisable-model-invocation: true prevents Claude from auto-running the command