Claude Certification Program · Five exams · Guides updated December 7, 2026

Home › Study guides › CCDV-F › Domain 3 › Lesson 3.2

CCDV-F · Domain 3 · 8% of the exam · Lesson 3.2 · 20 min read Updated for the December 7, 2026 exam guide (v1.1)

Customizing Claude Code: Skills, slash commands, rules, hooks, subagents and plugins

How to match a repeatable team workflow to a Skill, slash command, rules file, hook or subagent in Claude Code, and package it as a plugin.

Written against skill 3.2 of the official CCDV-F exam guide (Version 1.1, effective December 7, 2026). An independent resource, not affiliated with Anthropic; the practice questions are written from scratch.

3.2.1 Why a team's habits need somewhere to live

Noemi leads a four-person team building Staveline, a web app where independent music teachers sell lesson slots and pupils book them. Everyone on the team uses Claude Code, Anthropic's coding agent, every day. After three months she notices the same scenes repeating. Ayo pastes the same twelve-line prompt each time he adds a database migration. Claude Code forgets to run the formatter after about one edit in ten, so pull requests fill with whitespace noise. Someone typed "we're nearly ready to ship" and Claude started the release procedure on its own. A security review of the booking flow poured forty files into the conversation, and Claude lost the plan it was following. And the team's new admin dashboard repository has none of this setup at all.

None of these is a model problem: each is a repeatable workflow that nobody has given a home, and Claude Code offers a different extension mechanism for each kind.

Six workflows, six mechanisms

Staveline's repeated workflowsfour developers, one Claude Code setup
API conventions for src/api/a path-scoped rules file
Adding a migrationa Skill
Writing release notesa slash command a person starts
Formatting after every edita hook
Reviewing the booking flowa subagent
The admin dashboard repositorya plugin
Each of Staveline's repeated workflows goes to the mechanism that matches how it starts, whether it must always happen and who else needs it.

3.2.2 Guidance Claude reads: rules files, Skills and slash commands

Three of the six mechanisms are text that Claude reads when the moment comes. They differ in WHEN the text loads and WHO starts it, and those two differences decide between them.

A rules file is a Markdown file in .claude/rules/. Without front matter it loads at the start of every session, like the project CLAUDE.md. With a paths list it loads only when Claude reads, writes or edits a matching file. Staveline's API conventions matter only in src/api/, so Noemi moves them out of CLAUDE.md into .claude/rules/api.md with paths: ["src/api/**/*.ts"]. They stop costing context while someone works on the front end. paths is the only field Claude Code reads from a rule.

A Skill is a folder with a SKILL.md file plus any templates, scripts or reference files a procedure needs. At the start of a session Claude sees only each skill's name and description. The body loads when someone invokes the skill with /name, or when Claude matches the task to its description. That makes a skill the home for Ayo's migration procedure: a checklist, a template and a check script that load only when someone adds a migration. Project skills live in .claude/skills/<name>/ and reach everyone who clones the repository; personal ones live in ~/.claude/skills/.

Here is Ayo's skill. Look at the description, which tells Claude when the skill applies, at $ARGUMENTS, which receives whatever follows the command name, and at ${CLAUDE_SKILL_DIR}, the skill's own folder.

---
name: add-migration
description: Adds a database migration to Staveline. Use when a change needs a new table, column or index.
---

Add a migration for: $ARGUMENTS

1. Copy `${CLAUDE_SKILL_DIR}/template.sql` into `db/migrations/` with today's timestamp.
2. Write the up and down steps. Never drop a column that still holds data.
3. Run `${CLAUDE_SKILL_DIR}/check-migration.sh` and fix everything it reports.
4. Summarise the change for the pull request description.

A slash command is any workflow you start by typing / and its name. Custom commands have been merged into skills: an older single file such as .claude/commands/release-notes.md still works, and .claude/skills/release-notes/SKILL.md creates the same /release-notes with room for supporting files. What turns a skill into a command that only a person can start is one front matter line, disable-model-invocation: true. Claude can no longer load it on its own, and its description leaves the context. That fixes the release that started itself. The opposite setting, user-invocable: false, hides a skill from the / menu so that only Claude loads it, which suits background knowledge that is not an action anyone would run.

3.2.3 Actions Claude Code runs: hooks

Now the formatter. Noemi's first fix was a line in CLAUDE.md: "Run Prettier after every edit." Claude follows it most of the time, and that is the problem: an instruction is something Claude weighs against the task in front of it. If a step must happen every time, with no judgement involved, it should not be an instruction at all.

A hook is a shell command, HTTP request, MCP tool call, prompt or subagent that Claude Code runs at a fixed point in its lifecycle, such as PostToolUse, after a tool call succeeds, or PreToolUse, before one runs. Claude does not decide whether a hook fires; Claude Code fires it on every matching event. Hooks live under hooks in a settings file: .claude/settings.json for the whole team, ~/.claude/settings.json for you. They cost no context unless they return output. Think of a smoke detector next to a sign saying "please report fires": only the sign depends on someone reading it.

Here is the hook Noemi commits to .claude/settings.json. Look at the matcher, which limits it to the file-editing tools, and at the command, which reads the edited file's path from the JSON that Claude Code passes in.

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          {
            "type": "command",
            "command": "f=$(jq -r '.tool_input.file_path') && npx prettier --write --ignore-unknown \"$f\""
          }
        ]
      }
    ]
  }
}

The same mechanism enforces limits. A PreToolUse hook whose script exits with code 2 blocks the call before it runs, so a script can refuse edits to generated files such as db/schema.generated.ts. Hooks and skills also pair: a hook runs the linter after every edit, and a /fix-lint skill tells Claude how the team wants the errors fixed.

An instruction versus a hook

"Run Prettier after edits" in CLAUDE.md

Claude reads itat session start
Claude weighs itagainst the task at hand
Usually followedone edit in ten missed

PostToolUse hook

Claude edits a file
Claude Code fires the hookno decision by Claude
Prettier runsafter every matching edit
The instruction is weighed by Claude on each edit; the hook is fired by Claude Code on every matching edit, whatever Claude decides.

3.2.4 Work that runs elsewhere: subagents

The booking-flow security review is a different shape of problem. It needs judgement, so a hook is wrong. It also reads forty files, so a skill alone is wrong too: a skill runs in the main conversation, and everything it reads lands there. The test: does the work produce far more material than the main conversation will look at again?

A subagent is a specialised assistant defined in a Markdown file in .claude/agents/ for the team, or ~/.claude/agents/ for you. Its front matter needs a name and a description; tools can restrict what it may use, and model can pick a cheaper or stronger model. The body becomes its system prompt. Claude delegates when a task matches the description, or when you name the subagent, and the subagent works in its own context window. Only its final report comes back. Picture sending a colleague to read the archive and return with one page.

Here is the team's reviewer. Look at tools: read and search only, so the review cannot change code. "Use proactively" in the description encourages Claude to delegate without being asked.

---
name: booking-security-reviewer
description: Reviews changes to booking, payments and accounts for security issues. Use proactively after edits under src/booking/ or src/payments/.
tools: Read, Grep, Glob
model: sonnet
---

You review Staveline code for security problems. Read the changed files and
anything they call. Report only: each issue, its file and line, why it matters
and a suggested fix, most severe first. Do not restate code that is fine.

Skills and subagents combine. A subagent's skills field preloads a skill's full content when the subagent starts, and a skill with context: fork runs itself in a forked subagent. So the team's review checklist can live in a skill that the reviewer preloads, while the forty files stay out of the main conversation.

3.2.5 Analysing a workflow: one question per mechanism

This is the step the exam cares about most: given a team's repeatable workflow, choose the mechanism. Read off what starts it, when it must run and who needs it.

Mechanism What starts it Choose it when the workflow...
Rules file Session start, or Claude touching a matching file is guidance for part of the codebase: a folder, a language
Skill Claude matching its description, or a person typing /name is a procedure or reference material needed sometimes
Slash command A person typing /name (disable-model-invocation: true) should run only when someone decides, often with side effects
Hook Claude Code, on a lifecycle event must happen every time and needs no judgement
Subagent Claude delegating, or a person naming it reads or produces far more than the main conversation needs
Plugin Installing it is a set of the above that other repositories need

In a scenario, the requirement words map onto the last column. "Every time" or "always" points to a hook, and "only when the release manager runs it" to a slash command. "Checklist" points to a skill, "in the src/api/ folder" to a rule, "reads dozens of files" to a subagent and "the other repositories" to a plugin.

Five questions about a workflow

Must it happen every time?yes: a hook
Who starts it?a person: slash command; Claude: Skill
Is it tied to some files?yes: a path-scoped rule
Does it flood the context?yes: a subagent
Does another repository need it?yes: a plugin
Ask them in order; the first yes usually names the mechanism, and the last decides whether to package the result.

The order matters. "Every time" comes first because it is the one requirement that text cannot meet, and a hook is the only mechanism here that Claude Code runs without Claude choosing to. Real workflows often split across mechanisms. The migration procedure is a skill, but its rule "never edit db/schema.generated.ts" also becomes a PreToolUse hook, because inside a skill it is only a request. And CLAUDE.md stays short: the docs suggest under 200 lines, with reference material moved to skills and folder guidance to rules.

3.2.6 Packaging for distribution: plugins

The admin dashboard is Staveline's second repository, and Noemi's first instinct is to copy the .claude/ folder across. It works for a week. Then Ayo improves the migration skill in one repository and not the other, and the two drift apart. The docs name the trigger: when a second repository needs the same setup, package it as a plugin.

A plugin is a directory that Claude Code installs and loads as one unit, holding skills, subagents, hooks, MCP servers and other components. Its manifest, .claude-plugin/plugin.json, needs only a name, which becomes the prefix on every skill and subagent: the migration skill now runs as /staveline-dev:add-migration, so two plugins can each ship an add-migration without colliding. The components sit at the plugin root. Only the manifest goes inside .claude-plugin/; components saved there do not load.

staveline-dev/
  .claude-plugin/plugin.json
  skills/add-migration/SKILL.md
  skills/release-notes/SKILL.md
  agents/booking-security-reviewer.md
  hooks/hooks.json

Converting follows from that layout. Copy .claude/skills/ and .claude/agents/ to the plugin root, move the hooks object from .claude/settings.json into hooks/hooks.json unchanged, and refer to bundled scripts as ${CLAUDE_PLUGIN_ROOT}/..., because you never know where a plugin will be installed. Two things do not travel as they are. Claude Code does not load a CLAUDE.md at a plugin root, and rules files are not among the components the plugin layout lists. The docs say to write a plugin's instructions as skills, and a rule that must hold every time as a hook. And a plugin's subagents ignore the hooks, mcpServers and permissionMode fields; those go in the plugin's own hooks and MCP configuration.

Then test and ship. claude plugin validate ./staveline-dev checks the manifest and every skill, agent and command file. claude --plugin-dir ./staveline-dev loads the plugin for one session, and /reload-plugins picks up edits. To distribute it, the team commits a .claude-plugin/marketplace.json that lists the plugin to a git repository, which makes that repository a marketplace: a catalog to install from. Each developer adds it once with claude plugin marketplace add, then runs claude plugin install staveline-dev@staveline-tools. A repository can enable the plugin for everyone through enabledPlugins in its committed .claude/settings.json, though each developer still installs it. For updates, raise version with every release, or leave it out so the git commit decides; a pinned version that never changes keeps everyone on the old copy.

From one repository's setup to every repository

.claude/ in one repositoryskills, agents, hooks in settings
Plugin directorymanifest, skills/, agents/, hooks/hooks.json
Validate and testclaude plugin validate, --plugin-dir
Marketplace repositorymarketplace.json lists the plugin
Every repositoryone install, one version
The same files move into a plugin directory, are validated and tested locally, and reach every repository as one versioned install from a marketplace.

3.2.7 The exam traps

Almost every mistake here puts a workflow in the mechanism built for a different trigger.

  • ✗ Putting an every-time step ("format after each edit", "never touch generated files") in CLAUDE.md, a rule or a skill. ✓ Make it a hook. Text is guidance Claude weighs; a hook is run by Claude Code on every matching event.
  • ✗ Leaving a workflow with side effects, such as a release or a deploy, as a skill Claude can start by itself. ✓ Set disable-model-invocation: true, so it becomes a slash command only a person starts.
  • ✗ Growing CLAUDE.md with procedures and folder-specific conventions. ✓ Move procedures into skills and folder guidance into path-scoped rules, which load only when needed.
  • ✗ Writing a skill for work that reads dozens of files. ✓ Delegate it to a subagent that returns a summary; a skill's work happens in the main conversation.
  • ✗ Copying .claude/ into each repository, or putting the components inside .claude-plugin/. ✓ Package a plugin with the components at its root, version it and distribute it through a marketplace.

3.2.8 Put it together: give each workflow its mechanism

The fastest way to feel the differences between these mechanisms is to build a small set and then pack it as a plugin.

The other skill in this domain covers the ground these mechanisms stand on: Claude Code operation explains the CLAUDE.md hierarchy, settings.json and the permission modes that decide what any of them may do. Deterministic guardrails take the PreToolUse hook further, as an enforcement layer that holds under adversarial instructions. And capability mechanism selection makes the related choice for applications on the API, between built-in tools, custom tools, Skills and MCP servers.

Key takeaways

  • ✓ Every repeatable workflow has a trigger, a guarantee, a scope, a context load and a reach, and those decide its mechanism.
  • ✓ Rules files, Skills and slash commands are instructions Claude reads: rules load at launch or for matching paths, Skills load when invoked or relevant, and disable-model-invocation: true makes a Skill a person-only slash command.
  • ✓ A hook is run by Claude Code on a lifecycle event whatever Claude decides, so every step that must always happen without judgement belongs in one.
  • ✓ A subagent works in its own context window with its own tools and returns only a summary, which keeps heavy reading out of the main conversation.
  • ✓ Ask "must it happen every time?" first, because no text-based mechanism can promise that.
  • ✓ A plugin packages skills, subagents, hooks and MCP servers under a namespaced manifest, with components at its root, and a marketplace distributes one versioned copy to every repository.

Check your understanding

4 questions written for this lesson. Every answer option is explained, including the ones you did not pick. Nothing is stored.

CCDV-F practice questions are being rewritten

The 159 CCDV-F practice questions here were written for the previous exam guide and are tagged to its domains. New questions for the December 7, 2026 guide (v1.1) are being written. Until they are ready, the practice for the new guide is the questions at the end of every lesson, with every answer option explained. The old bank stays open for general practice.

Back to Domain 3 → The previous-guide bank →

Sources