Skip to content
Claude Certified Architect – Foundations (CCAR-F) Exam Prep

Lesson 14 of 30 · 7 min

x
14/30

Slash Commands and Skills

Video lesson: CCAR-F 14/30: Slash Commands and Skills

What goes where

  • CLAUDE.md: always-loaded facts and guidance.
  • Skills: procedures and reference material; the body loads only when used, so long reference content is almost free until needed.
  • Slash commands (.claude/commands/deploy.md): still work and create /deploy, but skills add supporting files, invocation controls and automatic loading. Prefer skills for new work. A skill overrides a command with the same name.

Skill anatomy

A directory with SKILL.md: YAML frontmatter (must start on line 1) then Markdown instructions. Optional supporting files (reference.md, scripts/) are loaded or run on demand. Keep SKILL.md under about 500 lines.

Locations and precedence: enterprise > personal (~/.claude/skills/<name>/SKILL.md) > project (.claude/skills/<name>/SKILL.md); plugin skills are namespaced (/plugin:skill).

Frontmatter that matters

FieldPurpose
name, description, when_to_useSelection; descriptions are always in context (combined text truncated at 1,536 characters, so lead with the key use)
argument-hint, argumentsAutocomplete hint, named positional args
allowed-toolsTools pre-approved for the invoking turn. It does not restrict other tools
disallowed-toolsTools removed while active
disable-model-invocation: trueOnly you can invoke (use for /deploy, /commit)
user-invocable: falseHidden from the menu; Claude-only background knowledge
context: fork + agentRun in a subagent (Explore, Plan, general-purpose or custom)
pathsGlob patterns limiting automatic activation
model, effort, hooksOverrides while active

Arguments and dynamic context

$ARGUMENTS, $0/$1 positional, $name named. ` !command runs a shell command **before** Claude sees the skill and injects the output (live data such as gh pr diff). If an injected command fails, the **whole skill invocation aborts**. disableSkillShellExecution` in settings turns this off.

Forked context

context: fork runs the skill in a new subagent that does not see your conversation; the skill must be self-contained. Explore and Plan agents start without CLAUDE.md. Use it only for skills with an explicit task; pure guideline content produces nothing useful. This differs from forking the conversation, which copies history.

Context cost

Once invoked, a skill's content stays in the conversation; after auto-compaction the first 5,000 tokens of each invoked skill are re-attached within a 25,000-token combined budget.

Exam traps

  • Reading allowed-tools as a restriction. It pre-approves; it does not limit.
  • Using CLAUDE.md for a long procedure that belongs in a skill.
  • A forked skill that depends on the conversation ("continue what we discussed").
  • A side-effecting skill (deploy) that Claude can auto-invoke. Set disable-model-invocation: true.
  • Plugin skills colliding. They are namespaced.

References

  1. Skills — checked Oct 16, 2026

Check your understanding

  • A /deploy workflow must only run when a human types it. Setting?Show answer

    Answer

    disable-model-invocation: true.
  • Inject the current PR diff into a skill. Mechanism?Show answer

    Answer

    ` !gh pr diff ` dynamic context injection.
  • Does a context: fork skill see the chat history?Show answer

    Answer

    No.
Previous

Progress is saved in this browser.

Next Lesson