Skip to main content
reopt Handbook
reopt Handbook
Claude Code Command MasterLabels and command selectionHow to read a detail guideComplete command listTerminal CLI Commands and Flags

Task guides

Core command basicsStarting and resuming workSkills and Custom CommandsAutomation and Web CommandsOperations and Safety CommandsCustom commands and skillsMCP connections and commands

Conversation and context

Cmd. /add-dirCmd. /backgroundCmd. /compactCmd. /contextCmd. /copyCmd. /exportCmd. /forkCmd. /importCmd. /initCmd. /memoryCmd. /recapCmd. /renameCmd. /resumeCmd. /rewindCmd. claude project purge

Planning and execution

Cmd. /autofix-prCmd. /batchCmd. /desktopCmd. /goalCmd. /loopCmd. /planCmd. /remote-envCmd. /scheduleCmd. /tasksCmd. /teleportCmd. /workflows

Review and verification

Cmd. /code-reviewCmd. /runCmd. /run-skill-generatorCmd. /security-reviewCmd. /simplifyCmd. /verify

Models and settings

Cmd. /claude-apiCmd. /configCmd. /effortCmd. /fastCmd. /modelCmd. /output-styleCmd. /update-config

Permissions and integrations

Cmd. /agentsCmd. /hooksCmd. /ideCmd. /mcpCmd. /permissionsCmd. /pluginCmd. /reload-pluginsCmd. /reload-skillsCmd. /sandboxCmd. /skillsCmd. /web-setup

Status and diagnostics

Cmd. /debugCmd. /diffCmd. /doctorCmd. /fewer-permission-promptsCmd. /release-notesCmd. /team-onboarding

Display and input

Cmd. /colorCmd. /focusCmd. /keybindingsCmd. /powerupCmd. /statuslineCmd. /terminal-setupCmd. /themeCmd. /tui

Account and usage

Cmd. /upgradeCmd. /usageCmd. /usage-credits

Legacy

Cmd. /costCmd. /pr-commentsCmd. /reviewCmd. /statsCmd. /ultrareviewCmd. /vimCmd. /approved-toolsCmd. /commandsCmd. /extra-usageCmd. /settingsCmd. /tagCmd. /todos

Verification and history

Current verification scopeHandbook updatesRelease coverage historyEarlier verification recordsCommand change history
Handbook›Claude Code Command Master›Custom commands and skills
한국어English

Custom commands and skills

Choose the commands for custom commands and skills and follow their availability rules and concrete examples.

Key takeaways

  • Define a skill directory, control who can invoke it, and pass task-specific arguments.

Current Model

Custom commands and skills are now one slash-command experience. A file at .claude/commands/deploy.md and a skill at .claude/skills/deploy/SKILL.md both create /deploy and behave the same way. Existing .claude/commands/*.md files keep working, but new workflows should usually use .claude/skills/<name>/SKILL.md because skills add a directory for supporting files, richer frontmatter controls, scripts, dynamic context injection, and the ability for Claude to load them automatically when relevant. If a skill and a command share the same name, the skill takes precedence.

Both you and Claude can invoke a skill by default: you type /skill-name, and Claude can also load it automatically when its description matches your request.

Recommended Shape

A skill is a directory whose SKILL.md is the entrypoint. Other files are optional and load only when referenced.

.claude/skills/
  release-check/
    SKILL.md
    checklist.md
    scripts/
      collect-release-info.sh
---
name: release-check
description: Check release risk, test coverage, and documentation gaps. Use when preparing a release or asked to assess merge readiness.
disable-model-invocation: true
allowed-tools: Read Grep Bash
argument-hint: [release-target]
---

Release target: $ARGUMENTS
Current effort: ${CLAUDE_EFFORT}

## Recent changes

!`git diff HEAD`

1. Summarize the changed area.
2. Check required tests and docs against checklist.md.
3. Return blockers first, then follow-up risks.

The directory name (release-check) becomes the command you type. The frontmatter name only sets the display label in skill listings; it does not change what you type after / (except for a plugin-root SKILL.md).

Key Controls

Only description is recommended; every field is optional.

ControlUse it when
descriptionClaude needs to decide whether the skill is relevant. Put the key use case first; the combined description + when_to_use is capped at 1,536 characters.
when_to_useYou want extra trigger phrases or example requests appended to the description.
disable-model-invocation: trueThe workflow has side effects and should only run when the user types it. Also keeps it out of Claude's context and out of preloaded subagents.
user-invocable: falseThe skill is background knowledge, not a user command, so it should be hidden from the / menu (but Claude can still load it).
allowed-toolsThe skill needs pre-approved tools while still respecting global permissions. Space-, comma-separated, or a YAML list.
disallowed-toolsCertain tools must never run while the skill is active (e.g. blocking AskUserQuestion in a background loop).
argument-hintYou want an autocomplete hint for expected arguments, e.g. [issue-number].
argumentsYou want named positional placeholders ($name) instead of indexes.
$ARGUMENTS, $ARGUMENTS[N], $NThe command needs user-supplied input. $0 is the first argument, $1 the second.
${CLAUDE_EFFORT}, ${CLAUDE_SESSION_ID}, ${CLAUDE_SKILL_DIR}The skill should adapt to current effort, log per session, or reference bundled files.
model, effortThe skill should run at a specific model or effort level for its turn.
context: fork (+ agent)The skill should run in an isolated subagent context with its content as the prompt.
pathsThe skill should auto-activate only for files matching given globs.

Who can invoke

FrontmatterYou can invokeClaude can invoke
(default)YesYes
disable-model-invocation: trueYesNo
user-invocable: falseNoYes

Note: user-invocable: false only hides the skill from the / menu; it does not block Claude's Skill tool. Use disable-model-invocation: true to stop Claude from invoking it.

Dynamic Context Injection

Lines of the form !`<command>` run before the skill is sent to Claude, and the command output replaces the placeholder. This is preprocessing, not something Claude executes — Claude only sees the final rendered text.

## Current changes

!`git diff HEAD`

The inline form is only recognized when ! starts a line or follows whitespace. For multi-line commands, use a fenced block opened with ```!. You can disable this behavior globally with "disableSkillShellExecution": true in settings.

When to Keep .claude/commands

Keep a legacy command file when the prompt is short, has no supporting files, and is already widely used by the team — those files still work and support the same frontmatter. Move it to a skill when you need scripts, examples, references, explicit invocation controls, or automatic loading by Claude.

Validation

  • Run /skills and search for the command name (press t to sort by token count).
  • Invoke the command with a sample argument.
  • Confirm whether Claude can invoke it automatically or only the user can (see the table above).
  • Keep SKILL.md concise — under ~500 lines — and move long references into separate files. Once invoked, the body stays in context for the rest of the session, so every line is a recurring token cost.
  • Treat allowed-tools as a permission grant, not just documentation. Review project skills before trusting a repo, since a skill can grant itself broad tool access.
  • If a skill is added or edited on disk mid-session, run /reload-skills to pick it up without restarting.

Related Commands

  • /skills: list and filter available skills, and hide skills from Claude or the / menu.
  • /reload-skills: re-scan skill and command directories so on-disk changes apply without a restart. (Available from v2.1.152.)
  • /plugin: distribute shared skills and commands as plugins.
  • /reload-plugins: reload active plugins to apply pending changes without restarting.
  • /fewer-permission-prompts: scan transcripts for common read-only Bash and MCP calls and add a prioritized allowlist to project .claude/settings.json.
  • /config (alias /settings): adjust theme, model, output style, and other preferences.

For the full built-in command list, see the official commands reference. For skill authoring details, see the skills guide.

Related docs

Skills and Slash Commands

Claude Code Complete Guide · Package repeatable Claude Code workflows into reusable commands and skills.

Skills and Custom Commands

How to design reusable Claude Code skills and slash commands for team workflows.

From Docs to Skills, Plugins, and MCP

Agentic Documentation · Split rules, workflows, distribution units, and external context into the right agent surface.

Skills Ecosystem

Enterprise Project Architecture · Build reusable agent skills, commands, and documents for repeated engineering workflows.

Ch3. Project Layout and Discovery

Enterprise Eve Agent Development · How Eve turns agent directory slots into a source manifest, and why path-derived identity is an operations contract.

Operations and Safety Commands

Commands for permission control, MCP, plugins, cleanup, sandboxing, and troubleshooting.

MCP connections and commands

Choose the commands for mcp connections and commands and follow their availability rules and concrete examples.

On this page

Current ModelRecommended ShapeKey ControlsWho can invokeDynamic Context InjectionWhen to Keep .claude/commandsValidationRelated Commands