CertSafari
    Anthropic Claude Certified Architect – Foundations (CCAR-F)· Lessons

    Domain 3 · Lesson 14/30

    Custom slash commands and skills in Claude Code

    Create and configure custom slash commands and skills

    22 min read
    3.33% of exam
    5 sources
    Published 20 Oct 2026
    Docs as of 14 Oct 2026

    What you will be able to do

    • Choose between a .claude/commands/ file and a SKILL.md directory under .claude/skills/, and predict the command name each produces
    • Place a skill at project or personal scope so it is shared with the team or kept private, as intended
    • Work out which definition runs when a personal skill, a project skill and a command file share one name
    • Configure argument-hint, allowed-tools and context: fork in SKILL.md frontmatter and explain what each one does at run time
    • Decide whether an instruction belongs in CLAUDE.md or in a skill
    • Create a project-scoped slash command in .claude/commands/ and commit it so every teammate can invoke it

    Key concept

    Skill (SKILL.md) — A skill is a named, reusable prompt stored as a SKILL.md file in its own directory under .claude/skills/. Its YAML frontmatter sets how it runs: its arguments, which tools are pre-approved, and whether it runs in a forked subagent. Only its description loads in every session; the full content loads when someone invokes it or when it fits the task.

    1.Two file formats for one mechanism

    A custom slash command turns a prompt you type over and over into a /name you can invoke. Claude Code reads these from two formats. The older one is a single Markdown file in .claude/commands/. The newer one is a directory in .claude/skills/ that holds a SKILL.md file. Both formats run the same way, and a command file supports the same frontmatter as a skill except name and paths.

    Choosing between skills and CLAUDE.md comes down to when the instructions load. CLAUDE.md is always-loaded: it enters every session automatically, so it holds universal standards that apply to every task, such as "Use pnpm, not npm". Skills and command files work by on-demand invocation, when you type /name or when Claude matches a skill's description to the task, which makes them the place for task-specific workflows like a release checklist. A good signal that something belongs in a slash command is that you keep typing the same prompt to start one kind of task.

    New work should use the skill format, because a skill is a directory. Next to SKILL.md you can keep reference docs, examples and scripts. Claude reads those files only when the skill points to them, so SKILL.md stays short. A command file is one flat prompt and has nowhere to put supporting material. Existing command files keep working, so you don't need to migrate them.

    Creating a project-scoped slash command for team-wide availability takes one file and one commit. Add a Markdown file such as .claude/commands/release-notes.md inside the repository, commit it, and every teammate who pulls can type the same /release-notes. Version control is the distribution channel: the prompt travels with the code, and a change to it goes through review like any other change. The same file saved as ~/.claude/commands/release-notes.md is a user-scoped command instead. It follows you into every project on your machine but never enters the repository, so it suits personal shortcuts, not workflows the team depends on.

    The two formats get their command names in different ways. A command file's name is its filename without the extension, and each subdirectory becomes a colon-separated prefix. A skill takes its name from its directory, or from the frontmatter name field when that field is set.

    How each format turns a file path into the name you type
    FileName comes fromExample
    .claude/commands/deploy.mdFile name without extension/deploy
    .claude/commands/frontend/component.mdSubdirectory path, / replaced by :, then file name/frontend:component
    .claude/skills/deploy-staging/SKILL.mdFrontmatter name or the directory name/deploy-staging, or /deploy with name: deploy

    Checkpoint 1 of 10· Match them up

    Match each file to the slash command you type to run it. Assume none of the files sets a frontmatter name field.

    Tap a term, then the definition that fits it.

    Sources123

    2.Project or personal: who gets the skill

    The directory a skill sits in decides who can use it. This follows the same split between shared and personal configuration that applies to CLAUDE.md, covered in Project (shared) vs user (personal) configuration scope. For commands and skills, the split is between .claude/ inside the repository and ~/.claude/ in your home directory.

    A project skill at .claude/skills/<name>/SKILL.md belongs to the repository. Once you commit it, every teammate who pulls gets the same /name. A project command file in .claude/commands/ is shared the same way. A personal skill at ~/.claude/skills/<name>/SKILL.md loads in all of your projects on your machine. It never enters any repository, so nobody else ever sees it.

    This difference explains a common failure. A developer writes /lint-report, tests it, and it works. A teammate pulls the latest commit and the command doesn't exist. Restarting won't fix it, and neither will a license or a CI run. If the file sits under ~/.claude/skills/, it is outside the repository and git never saw it. If it sits under .claude/skills/ but was never staged, the commit doesn't contain it either. Either way the fix is the same: put the skill in the project directory and commit it.

    Where skills load from, and who sees them
    LocationPathLoads in
    Project.claude/skills/<skill-name>/SKILL.mdSessions in this repository. Commit it so your team gets it too
    Personal~/.claude/skills/<skill-name>/SKILL.mdAll your projects on this machine, but not Cowork or cloud sessions
    Enterprise.claude/skills/<skill-name>/SKILL.md in the managed settings directoryAll users on machines where your organization deploys it

    Checkpoint 2 of 10· Check yourself

    A developer wrote /lint-report as ~/.claude/skills/lint-report/SKILL.md, and it works for them. After pulling the latest commit, a teammate finds the command doesn't exist. What makes /lint-report available to the whole team?

    Checkpoint 3 of 10· Exam question

    After a developer adds a /lint-report skill, it works when they run Claude Code themselves, but a teammate who pulled the latest commit reports the skill doesn't exist. The developer confirms the file was never staged in any commit. What is the most likely cause?

    Sources14

    3.When two definitions share a name

    When the same skill name exists in more than one place, exactly one definition runs. The two files are not merged, and Claude Code doesn't raise an error. Precedence goes enterprise first, then personal, then project. Many people expect the committed team skill to win, but it doesn't. Your personal copy replaces it for you, and you get no warning.

    Three terms in the table below need unpacking. A plugin is a package that bundles and distributes Claude Code features, and the skills inside it are namespaced by the plugin's name: a plugin's review skill is typed /my-plugin:review, so it never collides with your own /review. Bundled skills are prompt-based commands that ship with Claude Code itself, such as /code-review, as opposed to the skills you write. An alias is a second name for the same command: /clear also answers to /reset and /new, and the bundled /code-review also answers to /review. Your skill can take over the main name but not the alias, so a project code-review skill replaces /code-review while /review keeps running the bundled command.

    Which definition runs when names collide
    Same name inWhich one runs
    Two of enterprise, personal, and projectEnterprise over personal, and personal over project
    A skill and a file in .claude/commands/The skill
    A plugin skill and a skill at any of the locations aboveBoth load, because plugin skills are namespaced as /plugin-name:skill-name
    Any of those locations and a bundled skillYour skill replaces the bundled command, but not its aliases

    These rules shape how you customise a team skill for yourself. Say you like the team's review skill but want a stricter version. If you save it as ~/.claude/skills/review/SKILL.md, it replaces the team version in every repository you open. You will then run different instructions from your teammates without noticing. Give the personal variant its own name, such as ~/.claude/skills/review-strict/. That way /review still runs the shared workflow and your version runs only when you ask for it. The same reasoning covers migration: if a skill and a .claude/commands/ file share a name, the skill runs and the command file is ignored.

    Checkpoint 4 of 10· Check yourself

    Your team has committed .claude/skills/review/SKILL.md. You want a stricter version for your own use. When you type /review, it should still run the shared team workflow in every repository. Where should your variant go?

    Checkpoint 5 of 10· Exam question

    A project's .claude/skills/review/SKILL.md is checked into the repo for team-wide use. A senior engineer also keeps a ~/.claude/skills/review/SKILL.md on their laptop for personal projects, unaware it uses the same name. When this engineer works in the shared repository and runs /review, which skill actually executes?

    Sources1435

    4.Passing arguments and prompting for them with argument-hint

    Most workflows need input, such as an issue number, a filename or a branch. Whatever you type after the command name reaches the skill through placeholders. $ARGUMENTS expands to everything you typed. $ARGUMENTS[0], or its shorthand $0, picks out a single argument by position. The arguments frontmatter field lets you name the positions instead: with arguments: [issue, branch], $issue is the first argument and $branch is the second. If the body contains no placeholder, Claude Code appends the input as ARGUMENTS: <value>.

    A manually triggered skill that receives the issue to fix through $ARGUMENTSmarkdown
    ---
    name: fix-issue
    description: Fix a GitHub issue
    disable-model-invocation: true
    ---
    Analyze and fix the GitHub issue: $ARGUMENTS.
    
    1. Use `gh issue view` to get the issue details
    2. Understand the problem described in the issue
    3. Search the codebase for relevant files
    4. Implement the necessary changes to fix the issue
    5. Write and run tests to verify the fix

    Nothing in that file tells a teammate that /fix-issue expects a number. Someone who types just /fix-issue has to guess. The argument-hint field fixes this. Its value, for example [issue-number] or [filename] [format], appears in autocomplete as soon as the command is selected, so the developer sees what to supply before running it. It is a hint for the person typing. It doesn't validate input and it doesn't make an argument required.

    argument-hint only works in Claude Code. If you upload the same SKILL.md to claude.ai, to the Skills API, or package it with package_skill.py, the upload rejects the key. Those channels accept only name, description, license, compatibility, metadata and allowed-tools.

    Checkpoint 6 of 10· Fill the gap

    A developer runs /fix-issue 1234. Which token in the skill body receives the 1234 they typed?

    ---
    name: fix-issue
    description: Fix a GitHub issue
    disable-model-invocation: true
    ---
    Analyze and fix the GitHub issue:  ? .
    
    1. Use `gh issue view` to get the issue details
    2. Understand the problem described in the issue
    3. Search the codebase for relevant files
    4. Implement the necessary changes to fix the issue
    5. Write and run tests to verify the fix
    6. Ensure code passes linting and type checking
    7. Create a descriptive commit message
    8. Push and create a PR

    Sources1

    5.Scoping tools during a skill run with allowed-tools

    A skill can declare which tools it works with, for the length of its run. This applies to a single invocation the same idea as Scoped tool access per agent. allowed-tools lists the tools Claude may use without asking for permission during the turn that invokes the skill. The grant ends when you send your next message, so it doesn't widen permissions for the rest of the session.

    A skill whose run pre-approves only read and search toolsmarkdown
    ---
    name: my-skill
    description: What this skill does
    disable-model-invocation: true
    allowed-tools: Read Grep
    ---
    
    Your skill instructions here...

    allowed-tools grants approval. It doesn't remove anything. Take a report-generator skill set to allowed-tools: Write Edit. During its run, writes and edits go through without prompts. That keeps the skill to file-writing work, because a destructive shell command would stop at a permission prompt instead of running. Bash is still in Claude's tool pool, though. To take a tool out of reach entirely, add disallowed-tools, which removes the listed tools while the skill is active. A rule can also be narrower than a whole tool: Bash(${CLAUDE_SKILL_DIR}/scripts/render.sh *) pre-approves one bundled script and no other shell command.

    Checkpoint 7 of 10· Fill the gap

    While this skill runs, Claude should be able to read and search files without a permission prompt each time. Nothing should be taken out of Claude's tool pool, and permissions should go back to normal after the turn. Which frontmatter key belongs in the blank?

    ---
    name: my-skill
    description: What this skill does
    disable-model-invocation: true
     ? : Read Grep
    ---
    
    Your skill instructions here...

    Sources1

    6.Isolating a skill run with context: fork

    A skill normally runs inline: its instructions and everything it produces go into your main conversation. That works for a short checklist. It works badly for a skill that reads fifty files to map a codebase, or one that explores four architectures before picking one. All of that intermediate output stays in your context for the rest of the session. context: fork applies the isolation described in Delegating verbose exploration to protect main context to a skill: the skill runs in a subagent that has its own context.

    A research skill that runs in a forked Explore subagentmarkdown
    ---
    name: deep-research
    description: Research a topic thoroughly
    context: fork
    agent: Explore
    ---
    
    Research $ARGUMENTS thoroughly:
    
    1. Find relevant files using Glob and Grep
    2. Read and analyze the code
    3. Summarize findings with specific file references

    Invoking this skill starts a fresh, isolated context. The body of SKILL.md becomes the subagent's prompt. The agent field picks the subagent type, and that type sets the model, tools and permissions. The subagent does its searching and reading in its own window. When it finishes, it sends back a summary, and only that summary enters your conversation. A model field on a forked skill sets the subagent's model. Forked runs happen in the background by default. Set background: false if you want the invoking turn to wait for the result.

    context: fork is the only field that controls where a skill runs. Several other fields sound similar but control something else. disable-model-invocation: true stops Claude from triggering the skill on its own, so only a person typing /name can start it. user-invocable: false does the opposite and hides the skill from the / menu. paths limits automatic loading to work on matching files. All three are about when the skill starts or who starts it. With any of them, the skill's output still lands in the main conversation.

    Checkpoint 8 of 10· Match them up

    A codebase-mapping skill fills your session with dozens of file reads. A teammate suggests four frontmatter fields that might help. Pair each field with what it actually controls.

    Tap a term, then the definition that fits it.

    Checkpoint 9 of 10· Exam question

    A team's explore-alternatives skill asks Claude to brainstorm several competing architecture approaches before settling on a recommendation. The team wants that exploratory back-and-forth kept separate from the main conversation, with only the final recommendation surfacing back to the user. Which configuration accomplishes this?

    Sources1

    7.Skill or CLAUDE.md

    Skills and CLAUDE.md both hold instructions, but they load at different times. CLAUDE.md files at every level of the CLAUDE.md hierarchy (user, project, directory) load into every session automatically. A skill's description loads each session, but its full content loads only when someone invokes the skill or Claude decides it is relevant. Use that difference to decide where an instruction goes. If it should apply to every task, put it in CLAUDE.md. If it is a procedure or reference you need for one kind of task, make it a skill.

    CLAUDE.md compared with a skill
    AspectCLAUDE.mdSkill
    LoadsEvery session, automaticallyOn demand
    Can trigger workflowsNoYes, with /<name>
    Best for"Always do X" rulesReference material, invocable workflows

    The two often work together. A one-line rule such as "Use pnpm, not npm" or "Run tests before committing" belongs in CLAUDE.md, because it applies to every task and costs little to load each time. A full API style guide, an eight-step deploy checklist or a release procedure would add context to every session where nobody needs it. Put those in skills. A common pattern is for CLAUDE.md to say "follow our API conventions" while a skill holds the full guide. Some triggers point clearly to a skill: you keep typing the same prompt to start a task, or you are pasting the same multi-step playbook into chat for the third time.

    Checkpoint 10 of 10· Check yourself

    Your project CLAUDE.md holds two things: the one-line rule "Use pnpm, not npm" and a 300-line API style guide that matters only when someone writes endpoints. Every session currently loads both. How should you restructure them?

    Sources3

    Practise it for real

    Build a project skill that forks into a subagent, then add an argument hint for teammates.

    1. 1.Create .claude/skills/deep-research/SKILL.md in a repository, with the frontmatter name: deep-research, description: Research a topic thoroughly, context: fork and agent: Explore, and a body that begins Research $ARGUMENTS thoroughly.

      Why: A directory under .claude/skills/ is a project skill, and context: fork makes it run in its own subagent.

      You should see: /deep-research appears in the / menu for sessions in this repository.

    2. 2.Run /deep-research authentication flow.

      Why: $ARGUMENTS expands to the text you typed after the command name, and the forked subagent receives the skill body as its prompt.

      You should see: The file searches and reads happen in the subagent. Your main conversation receives a summary with file references.

    3. 3.Add argument-hint: [topic] to the frontmatter, then type /deep-research without any argument.

      Why: argument-hint tells someone invoking the skill what input it expects.

      You should see: Autocomplete shows [topic] next to the command.

    4. 4.Commit the .claude/skills/deep-research/ directory.

      Why: Committing a project skill is what makes it available to teammates.

      You should see: Teammates have /deep-research after they pull.

    Sources

    (5)

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “a Markdown file in .claude/commands/ is the older format and still works.”
      ↩︎ Two file formats for one mechanism
      “Prefer a skill for new work, since skills also support supporting files.”
      ↩︎ Two file formats for one mechanism
      “Commit it so your team gets it too”
      ↩︎ Project or personal: who gets the skill
      “With deploy in both ~/.claude/skills/ and the project’s .claude/skills/, /deploy runs the personal one”
      ↩︎ When two definitions share a name
      “A skill and a file in .claude/commands/ | The skill”
      ↩︎ When two definitions share a name
      “A project code-review skill replaces /code-review, and the bundled alias /review never runs your skill”
      ↩︎ When two definitions share a name
      “Wherever the plugin is enabled, as /plugin-name:skill-name”
      ↩︎ When two definitions share a name
      “Hint shown during autocomplete to indicate expected arguments.”
      ↩︎ Passing arguments and prompting for them with argument-hint
      “Named positional arguments for $name substitution in the skill content.”
      ↩︎ Passing arguments and prompting for them with argument-hint
      “Unexpected key(s) in SKILL.md frontmatter: argument-hint.”
      ↩︎ Passing arguments and prompting for them with argument-hint
      “Tools Claude can use without asking permission during the turn that invokes this skill.”
      ↩︎ Scoping tools during a skill run with allowed-tools
      “The grant clears when you send your next message.”
      ↩︎ Scoping tools during a skill run with allowed-tools
      “Tools removed from Claude’s available pool while this skill is active.”
      ↩︎ Scoping tools during a skill run with allowed-tools
      “The subagent summarizes its results and returns them to your main conversation when it finishes”
      ↩︎ Isolating a skill run with context: fork
      “The agent field determines the execution environment (model, tools, and permissions)”
      ↩︎ Isolating a skill run with context: fork
      “Set to true to prevent Claude from automatically loading this skill.”
      ↩︎ Isolating a skill run with context: fork
      “Set to false to wait for the forked subagent’s result in the turn that invoked the skill”
      ↩︎ Isolating a skill run with context: fork
      “Enterprise over personal, and personal over project.”
      ↩︎ Exam trap 1
      “All your projects on this machine, but not Cowork or cloud sessions”
      ↩︎ Exam trap 2
      “Tools Claude can use without asking permission during the turn that invokes this skill.”
      ↩︎ Exam trap 3
      “Set to fork to run in a forked subagent context.”
      ↩︎ Exam trap 4
      “Subdirectory path relative to commands/ with each / replaced by :, then the file name without extension”
      ↩︎ Checkpoint
      “Sessions in this repository. Commit it so your team gets it too”
      ↩︎ Checkpoint
      “Set to fork to run in a forked subagent context.”
      ↩︎ Checkpoint
    2. 2.
      “Single-file prompts; same mechanism as skills”
      ↩︎ Two file formats for one mechanism
      “Reusable prompts invoked with /name or auto-invoked”
      ↩︎ Key concept
      “Single-file prompts; same mechanism as skills”
      ↩︎ Exam trap 5
    3. 3.
      “Loads | Every session, automatically | On demand”
      ↩︎ Two file formats for one mechanism
      “You keep typing the same prompt to start a task | Save it as a user-invocable skill”
      ↩︎ Two file formats for one mechanism
      “Plugins and marketplaces package and distribute these features”
      ↩︎ When two definitions share a name
      “CLAUDE.md holds always-on rules; skills hold reference material loaded on demand”
      ↩︎ Skill or CLAUDE.md
      “Description loads each session; full content loads when used”
      ↩︎ Skill or CLAUDE.md
      “You paste the same playbook or multi-step procedure into chat for the third time”
      ↩︎ Skill or CLAUDE.md
      “when the same name exists at multiple levels, one definition wins based on priority (managed > user > project for skills”
      ↩︎ Checkpoint
    4. 4.
      “Personal skills: ~/.claude/skills/, available across all your projects”
      ↩︎ Project or personal: who gets the skill
      “Bundled skills: prompt artifacts included with Claude Code, for example /code-review”
      ↩︎ When two definitions share a name
    5. 5.
      “Wipe conversation history and start fresh (project memory stays). Aliases: /reset, /new.”
      ↩︎ When two definitions share a name

    Ready to test yourself?

    Practise the 16 questions on this subdomain.

    Spotted a mistake, or was something unclear? Tell us.