Skip to main content
Bridge

October 8, 2026

Skills, Commands, Subagents or Hooks: Which to Use

Claude Code has four ways to give the agent reusable behaviour. A one-question-at-a-time guide to picking the right one, with a minimal example of each.

Skills and commandsClaude CodePlaybookDecision guide
HyunKi Lee··5 min read

Verified on October 8, 2026

Claude Code gives you four ways to make behaviour reusable, and they overlap. Pick by asking two questions: must it happen every time, and does it need its own room to work? A rule that must always hold is a hook. A big side task is a subagent. Know-how is a skill. A prompt you type often is a command.

What to consider

  • Must it always happen? The model can skip an instruction. A hook cannot.
  • How much will it read? Long searches and reviews fill the context window. A subagent keeps them out of it.
  • Who starts it? The agent on its own, or you by name.

At a glance

SkillSlash commandSubagentHook
Lives in.claude/skills/x/SKILL.md.claude/commands/x.md.claude/agents/x.md.claude/settings.json
StartsWhen a task matches, or /xWhen you type /xWhen Claude delegates, or you askOn an event, every time
Runs inThe main conversationThe main conversationIts own context windowOutside the model, as a shell command
Use it whenThe agent should recognise a task on its ownYou want a shortcut for a promptA side task would flood the contextA rule must hold every time

Pick one

flowchart LR
  A[Behaviour you want again and again] --> B{Must it happen every time, with no exceptions?}
  B -- yes --> H[Hook]
  B -- no --> C{Does it need lots of reading or searching?}
  C -- yes --> S[Subagent]
  C -- no --> D{Should the agent pick it up on its own?}
  D -- yes --> K[Skill]
  D -- no --> M[Slash command]

Hook: format every file Claude edits

Hooks run your command, not the model, so they never forget. This one formats each file after an edit. The hook receives the tool call as JSON on standard input. How to Auto-Format Files Edited by Claude Code sets it up step by step.

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          { "type": "command", "command": "jq -r '.tool_input.file_path' | xargs npx prettier --write" }
        ]
      }
    ]
  }
}

Subagent: review code in a separate context

A subagent works in its own context window and returns only its conclusion, so a long search or review does not crowd your main conversation. For a repetitive job, Manager and Subagents: A Workflow for Repetitive Tasks has a manager agent hand each step to its own subagent.

---
name: code-reviewer
description: Reviews a diff for bugs and missing tests. Use after a change is complete.
tools: Read, Grep, Glob
---

You review code changes. List each problem with the file, the line,
and the input that breaks it. Do not edit files.

Skill: teach a repeatable task

Use a skill when the agent should recognise the task on its own, such as writing release notes or following your deploy checklist. See How to Create Custom Skills for Claude Code and Codex for the full setup.

Slash command: a prompt you type often

Fix GitHub issue #$ARGUMENTS. Read the issue with `gh issue view`,
write a failing test, fix it, and run the suite.

Save it as .claude/commands/fix-issue.md, then type /fix-issue 123. Claude Code now treats commands as a kind of skill: existing .claude/commands/ files keep working, and for new work a skill with disable-model-invocation: true does the same job and can bundle files.

Move a prompt you keep pasting in three steps

  1. Find it. Look for any instruction you have pasted more than twice this week.
  2. Place it. Run it through the chart above.
  3. Test it. Create the file and check that it starts when you expect and not otherwise.

Get started

Frequently asked questions

What is the difference between a skill and a slash command?

A skill starts when the agent recognises a task on its own, or when you type its name. A slash command starts when you type it. Claude Code now treats commands as a kind of skill: existing .claude/commands/ files keep working, and a skill with disable-model-invocation: true does the same job and can bundle files.

When should I use a hook instead of an instruction?

When the rule must hold every time. The model can skip an instruction, but a hook runs your command outside the model on every matching event, so it never forgets. Formatting each file after an edit is one example.

Why use a subagent for a code review?

A subagent works in its own context window and returns only its conclusion, so a long search or review does not crowd your main conversation.

Want to try Bridge?

Bridge is on Google Play for Android. See the plans and prices.

See pricing