3.2 Create and configure custom slash commands and skills
Create project- or user-scoped slash commands and skills, configure SKILL.md frontmatter (context: fork, allowed-tools, argument-hint, disable-model-invocation) and decide what belongs in a skill versus CLAUDE.md.
Key points
- 1
Project-scoped commands live in
.claude/commands/<name>.mdand project skills in.claude/skills/<name>/SKILL.md; both are committed and available to everyone who clones or pulls. User-scoped equivalents live in~/.claude/commands/and~/.claude/skills/and are personal across all projects. - 2
.claude/commands/is the older single-file format; skills are the current mechanism and support supporting files and richer frontmatter. Both create a/nameslash command. There is nocommandsarray in settings files and CLAUDE.md does not define invocable commands. - 3
Skills can be invoked by a person (
/name args) or loaded automatically by Claude when thedescriptionmatches the conversation.$ARGUMENTS,$0/$1and${CLAUDE_SESSION_ID}are substituted into the skill body. - 4
context: forkruns the skill in an isolated subagent context; the subagent does not see the conversation history and only its result returns. Use it for skills with verbose output (codebase analysis, dependency graphs) or exploratory content (brainstorming alternatives) so they do not pollute the main session. - 5
allowed-toolsin skill frontmatter configures the tools available to the skill during execution; the exam guide treats it as the way to restrict a skill to, for example, file operations so it cannot run destructive shell commands. Current docs also providedisallowed-tools; for an absolute guarantee, add a PreToolUse hook or a deny rule. - 6
argument-hint(for example[issue-number]or[version-tag]) shows in autocomplete and tells developers what parameter the skill expects when they invoke it without arguments. - 7
disable-model-invocation: truestops Claude from auto-invoking a skill; only a human typing/nameruns it. Use it for side-effecting workflows such as deploy, commit or release.user-invocable: falseis the opposite: hidden from the menu, only Claude can load it. - 8
Skills vs CLAUDE.md: CLAUDE.md is always loaded, so it holds universal standards, project facts and short workflow rules. Skills load on demand, so they hold multi-step procedures, occasional workflows, side-effecting actions and anything long enough to bloat every session.
- 9
Personal customisation: create a variant in
~/.claude/skills/with a different name (for examplereview-a11y) so teammates are unaffected and the team's original stays available. A personal skill with the same name shadows the project skill for that user (priority is enterprise, then personal, then project). - 10
Skill content enters the conversation when invoked and stays across turns, so write it as standing guidance and keep SKILL.md focused, moving detail into supporting files.
Read the source
Test yourself on 3.2 Create and configure custom slash commands and skills
Ten questions, with the answer and explanation after each one.