Claude Code setup guide

When to use Claude Code skills vs subagents, hooks, MCP and plugins

Use CLAUDE.md for conventions Claude should follow in every session. Put reusable instructions in a skill you can call with a slash command. Give a subagent work that would fill your conversation with file reads. Use MCP to reach an outside system, a hook for a check that must run every time, and a plugin to share the setup across repositories.

Last updated

By CWYN · Published · Feature behavior as of · See Anthropic’s Claude Code features overview and skills documentation

1. Compare Claude Code features

Context cost here means what enters your main conversation. A feature can load automatically and still leave the decision to Claude.

FeatureWhat it isWhen it loadsContext costDeterministic?Best forExample
CLAUDE.mdPersistent project instructionsEvery sessionThe instructions occupy context every sessionLoading is automatic. Claude interprets the text.Project-wide conventionsName files in snake_case.
RulesInstruction files in .claude/rules/Every session, or when a matching file opensThe text of each loaded rulePaths control loading. Claude interprets the rule.Conventions for particular filesUse sentence case in docs headings.
SkillReusable instructions and reference materialDescription each session, full text when usedThe description, then the playbook if used hereNo. Claude interprets the steps.A repeatable taskA /deploy checklist
SubagentA worker with its own context windowWhen Claude delegates the taskOnly the returned summaryNo. The worker uses judgment.Parallel work or a review that reads many filesCheck paths across project READMEs.
HookA handler for a lifecycle eventAt every matching eventZero unless it returns outputYes for the trigger. A prompt or subagent can still use judgment.A required checkRun ESLint after each edit.
MCPA connection to external tools and dataTools are available when connected. Results arrive on a call.Depends on the tool and the data returnedDepends on the tool called.Access to an outside systemQuery a database.
PluginAn installable bundle of featuresOnce installed, each part uses its own triggerDepends on the features usedEach part keeps its own behavior.Sharing a setup across repositoriesInstall a team’s /my-plugin:review skill.

2. Skills vs subagents

Use a skill when you want to reuse the instructions. Use a subagent when you want the work to happen in a separate context.

Suppose you review the file paths in a README. A skill can teach Claude what counts as a broken link. If checking the links means opening files across the repository, give the review to a subagent. Its file reads stay in its own context, and you get a summary of the paths to fix. See how to give a project subagent a read-only review task.

You can use the same checklist either way. List it in a subagent’s skills: field to preload it for that worker. If you prefer to start the review with a slash command, set context: fork in the skill’s frontmatter to run the skill in isolation.

3. Skills vs hooks

Put guardrails in hooks. Use a skill for the decisions Claude should make after a check runs.

A PostToolUse hook can run ESLint after each matching edit. A /fix-lint skill can explain which fixes your project accepts. If an edit must be blocked before it happens, use a PreToolUse hook that checks the proposed edit.

A hook can run a script, send an HTTP request, call an MCP tool, or use a prompt or subagent. The event starts the hook without Claude deciding to run it. For a working file guard, see the Claude Code hook examples. If an expected check never runs, check the hook’s event and matcher.

4. Skills vs custom commands

Custom commands have been merged into skills. Prefer a skill for a new slash command.

Existing files in .claude/commands/ still work. Claude can invoke them even if you never type the command. When a command needs supporting files, give it a skill directory. For example, here is how to keep the name /deploy.

  1. Create the directory .claude/skills/deploy/. The directory name supplies the command name.
  2. Move .claude/commands/deploy.md to .claude/skills/deploy/SKILL.md. Put supporting files beside it and refer to them from the instructions.
  3. If only you should start the workflow, add disable-model-invocation: true to the YAML frontmatter. You still invoke the skill with /deploy.

For a command you can try on a draft release note, create your first project skill.

5. Skills vs MCP

Use MCP to reach an external system. Use a skill to teach Claude how to work with the result.

If your weekly report starts with copying database rows into chat, connect the database through a Model Context Protocol (MCP) server. A skill can specify which records belong in the report and how to summarize them. To provide the connection, add an MCP server to Claude Code.

6. Skills vs plugins

Write a skill for the task. Package it in a plugin when another repository needs the same setup.

A plugin can deliver a review skill, its subagent, a lint hook and an MCP server in one installation. Plugin skills include the plugin name in their slash command, so a skill called review in my-plugin runs as /my-plugin:review. You can distribute that bundle through a marketplace.

7. CLAUDE.md vs skills vs rules

Keep project-wide conventions in CLAUDE.md, scope rules to the files they concern, and put occasional workflows in skills.

Aim to keep CLAUDE.md under 200 lines. If a convention only concerns documentation, move it into .claude/rules/ with paths frontmatter so it loads when a matching file opens. A rule without a path restriction loads every session.

Both CLAUDE.md and skills can import files with @path. If the material is a deployment playbook, a skill gives you a /deploy workflow and loads the full instructions only when you use it.

8. Pick by situation

  1. Claude gets the same convention wrong twice. Put the convention in CLAUDE.md.
  2. You keep typing the same prompt. Give it a slash command with a user-invocable skill.
  3. You paste the same playbook a third time. Move its steps and reference files into a skill.
  4. You keep copying data from a browser tab. Connect the source with an MCP server.
  5. A side task fills the conversation with file reads. Send it to a subagent and ask for the findings.
  6. A check should run even if you forget to ask. Attach a hook to the matching event.
  7. A second repository needs the same setup. Bundle the features in a plugin.

9. Claude Code feature FAQ

Are Claude Code custom commands deprecated?

Anthropic merged custom commands into skills. Existing .claude/commands/ files still work. You can keep a working command there and move it into a skill directory when you need supporting files.

Can a subagent use a skill?

Yes. List the skill in the subagent’s skills: field. The worker starts with those instructions in its own context and returns a summary to your conversation.

Which one costs the least context?

A hook that returns no output adds nothing to the main conversation. A subagent keeps the file reads in its own window but adds a summary. A skill Claude can invoke uses space for its description each session and for its instructions when used.

How do I make a rule that always holds?

Enforce it at the event where a violation could occur. For example, have a PreToolUse hook reject a matching tool call that would edit .env. An instruction in CLAUDE.md or a skill can explain why the file is protected. The hook blocks the edit.

Next steps

Check your project instructions

Check your CLAUDE.md with the free setup file checker

Project setup files

Get the Claude Code Complete Setup Pack ($12.95).