Skip to main content
Bridge

October 9, 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.

← AI Playbook
Claude CodePlaybookDecision guide
HyunKi··4 min read

Verified on October 9, 2026

Skills, Commands, Subagents or Hooks: Which to Use

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.

{
  "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.

---
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 a Claude Code Skill 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

Want to try Bridge?

Bridge ships early October 2026. Become a founding member and lock in founders pricing.

Become a founding member