Claude Code
Claude Code Customization and Extension
Exam objective: Analyzing a repeatable team workflow to choose the extension mechanism that fits it, whether a Skill, plugin, Rules file, hook, subagent, or slash command, and authoring and packaging that extension for distribution.
What the exam tests
Given a repeatable team workflow, pick the extension mechanism that fits it, author it correctly and package it for distribution. The deciding properties are when it loads, who triggers it, whether it must be enforced, whether it needs its own context, and who has to receive it.
- CLAUDE.md: facts and conventions needed in every session.
- Rules file (
.claude/rules/*.md): modular instructions; withpathsfrontmatter they load only for matching files. - Skill (
SKILL.md): reference material or a workflow, loaded on demand or run as/name. - Slash command (
.claude/commands/*.md): the older format of a skill. It still works; write new ones as skills. - Hook: a command, HTTP request, MCP tool call, prompt or subagent run on a lifecycle event.
- Subagent (
.claude/agents/*.md): a worker with its own context, prompt and tool set that returns a summary. - Plugin: the packaging unit for the above (and MCP servers), distributed through a marketplace.
Key rules
Skills. description drives automatic invocation. disable-model-invocation: true leaves only the user able to start it (use for side effects). user-invocable: false leaves only Claude. allowed-tools pre-approves tools for the invoking turn; it does not restrict others. context: fork runs the skill in a subagent that does not see the conversation, so it needs an explicit task. Keep SKILL.md focused and move bulk reference into supporting files.
Hooks. Use them when something must happen every time. PreToolUse can block; PostToolUse runs after the fact. A command hook blocks with exit 2 and a reason on stderr, or exit 0 with a JSON deny decision. exit 1 generally lets the action proceed.
Subagents. name and description are required. Omitting tools inherits the available tools. To make one read-only, leave out Bash as well as Write and Edit. skills preloads full skill content.
Plugins. Only plugin.json goes in .claude-plugin/; skills/, agents/, hooks/hooks.json and .mcp.json sit at the plugin root. Skills and agents are namespaced. Use ${CLAUDE_PLUGIN_ROOT} for bundled files and ${CLAUDE_PLUGIN_DATA} for state that survives updates.
my-marketplace/
├── .claude-plugin/marketplace.json # name, owner, plugins[{name, source}]
└── plugins/team-tools/
├── .claude-plugin/plugin.json # name (skill prefix)
├── skills/review/SKILL.md # /team-tools:review
└── hooks/hooks.json # {"hooks": {...}}
Develop with claude --plugin-dir ./team-tools, check with claude plugin validate, then host the marketplace on a git host. Teammates run claude plugin marketplace add <owner>/<repo> and claude plugin install team-tools@<marketplace>.
Traps
- Putting a hard rule in CLAUDE.md or a skill. That is a request, not a guarantee.
- Splitting CLAUDE.md with
@imports to save context. Imports load with the file. - Expecting
allowed-toolsin a skill to sandbox it. - Confusing
user-invocable: falsewithdisable-model-invocation: true. - Plugin subagents ignore
hooks,mcpServersandpermissionMode; ship hooks and MCP servers at plugin level. - A
CLAUDE.mdat a plugin root is not loaded; write the instructions as a skill. - After converting
.claude/into a plugin, originals stay loaded and duplicate hooks run twice. - A marketplace entry
namethat differs from the manifestnamebreaks installs by the manifest name.
Decide quickly
| Situation | Choice | Why |
|---|---|---|
| Convention every session needs | CLAUDE.md | Always loaded |
| Guidance only for some paths | Rule with paths | Loads with matching files |
| Procedure or reference used sometimes | Skill | Loads on demand |
| Deploy-like workflow a person must start | Skill with disable-model-invocation: true | Claude cannot start it |
| Must run or block every time | Hook | Deterministic |
| Verbose side task or restricted worker | Subagent | Isolated context, own tools |
| One repository's team | Commit under .claude/ | Shared by version control |
| Many repositories, versioned updates | Plugin in a marketplace | One installable unit |