Domain 3 · Lesson 2 · Claude Code Config (20%)

Custom Slash Commands & Skills

Task Statement 3.2 — project vs user scope, and the SKILL.md frontmatter that matters.

Course progress: Domain 3 ▸ lesson 2 of ~4

Slash commands: project vs user scope

ScopeLocationAvailability
Project.claude/commands/Shared via VCS — every dev who clones/pulls gets it
User~/.claude/commands/Personal, not shared
Canonical exam item A /review command that must reach every developer on clone/pull → .claude/commands/ in the repo. Not ~/.claude/commands/ (personal), not CLAUDE.md (context, not commands), and not a .claude/config.json commands array (that mechanism doesn't exist).

Skills and their SKILL.md frontmatter

Skills live in .claude/skills/, each with a SKILL.md. Three frontmatter options are tested:

FrontmatterEffect
context: forkRun the skill in an isolated sub-agent context so its (often verbose) output doesn't pollute the main conversation. Use for codebase analysis, brainstorming alternatives.
allowed-toolsRestrict which tools the skill may use during execution (e.g., limit to file writes to prevent destructive actions).
argument-hintPrompt the developer for required parameters when they invoke the skill with no arguments.

Personal customization: create a variant in ~/.claude/skills/ with a different name so you don't affect teammates.

Skills vs CLAUDE.md — when to use which

The distinction Skills = on-demand invocation for task-specific workflows. CLAUDE.md = always-loaded universal standards. If it should apply to everything, always → CLAUDE.md. If it's a procedure you run sometimes → skill.

Check yourself

You want a /review command available to every developer automatically when they clone the repository. Create it in:
Correct: option 1. Project-scoped commands ship with the repo. User scope (2) isn't shared; CLAUDE.md (3) holds context, not command definitions; the config.json commands array (4) is a fabricated mechanism.
A codebase-analysis skill produces a flood of output that clutters the main conversation. The frontmatter option to isolate it is:
Correct: option 2. context: fork runs the skill in an isolated context so verbose output doesn't pollute the main session. allowed-tools restricts tools, argument-hint prompts for args — neither isolates output.
Decision rules Team-wide command → .claude/commands/. Verbose/exploratory skill → context: fork. Prevent destructive tool use → allowed-tools. Missing args → argument-hint. Always-on standard → CLAUDE.md; run-sometimes procedure → skill.
Ask your teacher. Want to see a real SKILL.md with all three frontmatter fields? Ask.