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.
| File | Name comes from | Example |
|---|---|---|
| .claude/commands/deploy.md | File name without extension | /deploy |
| .claude/commands/frontend/component.md | Subdirectory path, / replaced by :, then file name | /frontend:component |
| .claude/skills/deploy-staging/SKILL.md | Frontmatter 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.
A command file is named after its filename without the extension. Each subdirectory under commands/ becomes a prefix, with the slash replaced by a colon. A skill takes its name from its directory, because the file inside is always called SKILL.md and no frontmatter name is set here.
“Subdirectory path relative to commands/ with each / replaced by :, then the file name without extension”Source: code.claude.com
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.
| Location | Path | Loads in |
|---|---|---|
| Project | .claude/skills/<skill-name>/SKILL.md | Sessions in this repository. Commit it so your team gets it too |
| Personal | ~/.claude/skills/<skill-name>/SKILL.md | All your projects on this machine, but not Cowork or cloud sessions |
| Enterprise | .claude/skills/<skill-name>/SKILL.md in the managed settings directory | All 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?
A skill under ~/.claude/ sits outside the repository, so git never sees it. Teammates get a skill only when it's in the project's .claude/skills/ directory and committed. A restart doesn't change that, and neither does switching to the command-file format while it stays in the home directory.
“Sessions in this repository. Commit it so your team gets it too”Source: code.claude.com
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?
Correct answer: D — The skill was saved under ~/.claude/skills/lint-report/SKILL.md, which lives outside the repository and was never version-controlled.
- A. Incorrect. Claude Code does not require a restart to detect a newly added skill, and this doesn't explain why the file was never staged in a commit to begin with.
- B. Incorrect. There is no enterprise licensing requirement for sharing a project-scoped skill; committing the .claude/skills/ directory to version control is what makes it available to teammates.
- C. Incorrect. Skill availability is not gated behind a CI pipeline run.
- D. Correct. The personal ~/.claude/skills/ directory lives outside the git repository, so a skill placed there is never staged, committed, or shared with anyone else who clones or pulls the project; only a skill committed under the project's .claude/skills/ directory reaches teammates.
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.
| Same name in | Which one runs |
|---|---|
| Two of enterprise, personal, and project | Enterprise 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 above | Both load, because plugin skills are namespaced as /plugin-name:skill-name |
| Any of those locations and a bundled skill | Your 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?
Skills override by name, and personal beats project. A personal skill named review would quietly replace the team's /review for you in every repository. A different name keeps /review shared and runs your variant only when you ask for it. A same-named command file is ignored in favour of the skill. An unstaged edit to the project file still changes what /review does for you.
“when the same name exists at multiple levels, one definition wins based on priority (managed > user > project for skills”Source: code.claude.com
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?
Correct answer: A — The personal skill at ~/.claude/skills/review/SKILL.md, because a skill with the same name at the personal level overrides one from the project level.
- A. According to official Claude Code documentation, skill priority follows a strict hierarchy: Enterprise > Personal (
~/.claude/skills/) > Project (.claude/skills/) > Plugins. When a personal and a project skill share the same name, the personal skill takes precedence and is the one that executes. This behavior allows individual users to override team-level skills with their own customizations. - B. This is incorrect. The official skill precedence places personal skills above project-level skills. Therefore, a project skill will not override a personal one; it is the reverse. For team-wide standards, it is recommended to commit project skills to the repository, but they will be superseded if a user has a personal skill with the identical name.
- C. Claude Code does not merge skills with identical names or chain their execution. The priority hierarchy is used to select exactly one skill definition, and only that skill runs when invoked. The conflict resolution is based on precedence, not concatenation.
- D. Claude Code silently resolves naming conflicts using its priority order without raising an error. The higher-precedence skill (personal, in this hierarchy) simply overrides the lower one. While using unique, descriptive skill names is recommended to avoid accidental overrides, no error is thrown if a conflict exists.
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>.
---
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 fixNothing 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$ARGUMENTS expands to everything typed after the command name. $issue works only after arguments: [issue] is declared in the frontmatter, and this skill doesn't declare it. [issue-number] is the kind of value you give argument-hint, which is shown in autocomplete. It is a hint for the person typing and never gets substituted into the body.
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.
---
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.
Bash isn't on the pre-approved list, so the command doesn't run silently. Claude has to ask for permission first, under the session's normal permission rules. To make Bash unavailable during the skill, list it under disallowed-tools.
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...allowed-tools lets Claude use Read and Grep without asking during the turn that invokes the skill. The grant ends with your next message. disallowed-tools does the opposite and removes the listed tools while the skill is active. argument-hint only shows a hint in autocomplete, and tools isn't a skill frontmatter field.
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.
---
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 referencesInvoking 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.
Only context: fork changes where the skill runs, so it is the only one of the four that keeps the verbose output out of your main context. The other three control who starts the skill or when it loads. With any of them, the skill's output still lands in the main conversation.
“Set to fork to run in a forked subagent context.”Source: code.claude.com
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?
Correct answer: A — Set context: fork on the skill, so it runs in a subagent with its own context and hands back just its result to the caller.
- A. Correct.
context: forkruns the skill in a forked subagent context, so the exploratory reasoning stays there and only the subagent's final result returns to the main conversation. - B. Incorrect. This setting only controls who can start the skill, limiting it to manual invocation. Once a teammate runs it, the skill still executes inline, so every brainstormed approach lands in the main conversation.
- C. Incorrect. This setting only removes the skill from the user's slash menu so that only Claude can load it. The skill still runs inside the main conversation, so the full back-and-forth stays visible there.
- D. Incorrect.
pathsonly limits when the skill is loaded, based on the files Claude is working with. It does not move execution into a separate context, so the brainstorming still plays out in the main conversation.
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.
| Aspect | CLAUDE.md | Skill |
|---|---|---|
| Loads | Every session, automatically | On demand |
| Can trigger workflows | No | Yes, with /<name> |
| Best for | "Always do X" rules | Reference 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?
CLAUDE.md loads into every session, so it suits short rules that apply to every task, like which package manager to use. A long guide needed for only one kind of task would add context to every session, so it belongs in a skill that loads on demand. CLAUDE.md can then point to it.
“CLAUDE.md holds always-on rules; skills hold reference material loaded on demand”Source: code.claude.com
Sources3
Practise it for real
Build a project skill that forks into a subagent, then add an argument hint for teammates.
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.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.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.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.https://code.claude.com/docs/en/skillsOfficial docs
“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.https://code.claude.com/docs/en/claude-directoryOfficial docs
“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.https://code.claude.com/docs/en/features-overviewOfficial docs
“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.https://code.claude.com/docs/en/agent-sdk/skillsOfficial docs
“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.
“Wipe conversation history and start fresh (project memory stays). Aliases: /reset, /new.”
↩︎ When two definitions share a name