Skip to main content

3.2 Custom slash commands and skills

Command scoping​

ScopeDirectoryShared?
Project.claude/commands/Yes — version-controlled, available on clone/pull
User~/.claude/commands/No — personal

A /review command that must reach every developer when they clone or pull goes in .claude/commands/. CLAUDE.md holds instructions, not command definitions, and there is no .claude/config.json commands array — both are distractors.

Skills​

Skills live in .claude/skills/<name>/SKILL.md and configure behaviour through YAML frontmatter (skills reference, Equipping agents for the real world with Agent Skills):

.claude/skills/analyze-codebase/SKILL.md
---
name: analyze-codebase
description: Maps module structure and dependency flows for a target directory.
context: fork
allowed-tools: Read, Grep, Glob
argument-hint: <directory to analyze>
---

Map the structure of $ARGUMENTS. Report modules, entry points, and cross-module
dependencies as a bulleted outline. Do not modify files.
FrontmatterEffectUse when
context: forkRuns the skill in an isolated sub-agent context; outputs do not pollute the main conversationVerbose output (codebase analysis) or exploratory context (brainstorming alternatives)
allowed-toolsPre-approves the listed tools for the invoking turn — they run without a permission prompt. It grants; it does not restrict, and unlisted tools stay callableA trusted procedure that would otherwise stop for approval at every step
disallowed-toolsRemoves the listed tools from the pool while the skill is activePrevent destructive actions — e.g. a scaffolding skill that must never delete or execute
argument-hintPrompts the developer for required parameters when the skill is invoked bareThe skill needs an argument to be meaningful

Personal customization: create a variant in ~/.claude/skills/ under a different name so teammates' invocations are unaffected.

Skills vs CLAUDE.md​

SkillsCLAUDE.md
LoadingOn demand, when invokedAlways loaded
ContentTask-specific workflowsUniversal standards
CostZero until usedEvery session pays the tokens

Quiz​

  1. Question 1

    You want a custom /review slash command that runs your team’s standard code review checklist, available to every developer when they clone or pull the repository. Where should the command file be created?

  2. Question 2

    Your /audit-deps skill walks the dependency tree, prints every transitive package with its version and license, and finishes with a short list of packages needing an upgrade. The list is accurate. Developers complain that after running the skill, the main conversation has lost the thread of the feature they were building. Which frontmatter change addresses this?

  3. Question 3

    A /cleanup-branches skill deletes local branches that have been merged. During testing it once misread a prompt and performed a force push. You need the skill to be incapable of anything beyond listing and deleting local branches, whatever it is asked to do.

  4. Question 4

    Your /scaffold-service skill needs a service name and a target language. Developers invoke it with no arguments about half the time, and the skill guesses, producing scaffolds nobody wanted. Which frontmatter option addresses this?