Skip to content
Bernhard GötzendorferAI automation that runs on its own · Vienna
FoundationTechnical How-tos

Claude Code skills, hooks and subagents: what goes where

Claude Code skills, hooks and subagents in practice: a skill brings knowledge, a hook blocks, a subagent reviews. With examples from my own plugin.

Graphic with three columns: a skill brings knowledge, a hook blocks, a subagent reviews.

TL;DR

On 19 April 2026 a Claude Code session in my repo ran git reset --hard HEAD~1. Uncommitted work running at the same time was gone. The rule against it was already in my project rules, but nothing enforced it. Since then I separate them: knowledge goes into a skill, prohibitions into a hook, reviews to a subagent.

A rule that only lived in text

In my projects several sessions often work in the same folder. So the rules say that no session runs git reset, git clean or git stash without asking. The rule was in the context. On 19 April it was broken anyway.

To be honest, that was not really a model failure. A rule in text is a request. The model weighs it against everything else in its context. Sometimes the request loses.

The same day I built a hook that catches exactly these commands before they run. It is public in the repo, with the reason at the top of the file: pre-bash-destructive-guard.mjs. Since then it blocks git reset --hard and git clean -f in the main session. For git stash it only warns.

What is a skill in Claude Code?

A skill is a folder with a SKILL.md file. At the top sits a short description, below it the actual instructions. At the start of a session Claude only sees the descriptions. It loads the rest once a skill fits the task. You can also call a skill yourself with /name. That is how the skills docs describe it.

So the description decides whether the skill shows up at all. In some of my skills it says just as clearly when they should not run. My skill deepen makes a task deeper instead of bigger. Its description says explicitly: not for requests with "only", "just" or "quick", not for one-step changes (SKILL.md). How I measured the prompt behind it before building it in is in Deeper, not bigger.

A skill is knowledge on demand. It tells the model how something works, and the model has to follow through on its own.

When does a hook actually block?

A hook is a program that Claude Code starts at fixed points: before a tool runs, after it, when a session starts or ends, when a subagent finishes. The full list of events is in the hooks docs.

The one that blocks is mostly the hook before the tool, PreToolUse. If it exits with code 2 or returns deny, the call does not run. The model gets the reason back and can continue differently. That is what my hook from 19 April does.

I learned two things along the way.

First, a hook that hangs does not block. If it runs into its timeout, the call goes through by default. The docs warn about this themselves and offer the setting onFailure: "block" for it. For hard limits they also recommend permission rules.

Second, not every hook should block. My loop guard notices when the same action comes three times within the last five calls. It only warns. And the hook that caps the number of parallel agents lets the call through when it fails itself, instead of stopping everything. A broken guard should not stop all work. Both files state this at the top.

When is a subagent worth it?

A subagent is a separate Claude instance with its own context, its own instructions and its own tool list. It gets a task, works on its own and returns only its result (subagents docs). Several can run in parallel.

I use subagents for two things. For work that reads a lot and should return little, such as a search across many files. And for a judgement without prior knowledge. Before several changes go to main together, a subagent reads the full diff and measures for itself before I merge them.

How much I work this way shows in the numbers from my Session Orchestrator, as of October 2026: 20,000+ agent runs, a median of 13 agents per large session. Of the agents with clean records, 96.0% finished without an abort. What the fleet around it looks like is in Building an agent fleet.

A subagent is not a cure-all. It costs time and tokens, and its result is a summary. What it does not report, you do not see. That is why I ask for evidence in the task: which command, which output.

Rule of thumb: what goes where

QuestionTool
Should the model know how something works?Skill
Must something never happen, whatever the model thinks?Hook, plus a permission rule
Should someone without my prior knowledge check, or read a lot?Subagent

The mix-up that cost me the most was the first row with the second. I wrote prohibitions as text into rules and skills and wondered why they sometimes did not hold. Since April I first ask of every prohibition whether it needs to be a hook. The same principle, only at the end of a task instead of before it, is in Loop engineering.

What I take away

  1. What only lives in text, the model weighs. A hook blocks, as long as it runs.
  2. The description of a skill matters more than its content. It decides whether the skill gets loaded at all.
  3. A subagent is most useful when it knows less than I do.

All three are part of the Session Orchestrator, my open-source plugin for Claude Code. If you are building your own hooks or skills and get stuck somewhere, write to me.

Common questions

What is a skill in Claude Code?

A folder with a SKILL.md file. At the start Claude only sees the description and loads the rest once the skill fits the task. You can also call it yourself with /name.

When does a hook in Claude Code actually block?

A PreToolUse hook prevents the call when it exits with code 2 or returns deny. If it hangs until the timeout, the call goes through by default, unless the hook is set to onFailure block. For hard rules the docs also recommend permission rules.

When is a subagent worth it?

When a task needs a fresh context: a search that reads many files, or a review without the prior knowledge of the session that wrote the code. Only the result comes back.

Do I need a plugin for this?

No. Skills, hooks and subagents also work directly in the project under .claude/ or in your home folder. A plugin bundles them so you get the same set in several repos.

session-orchestrator

Your task becomes tested work, and the next session picks up where the last one stopped.

No language model
in the tool. Your coding agent writes the code.
The code
gives the agent its workflow: plan, work in rounds with tests after each one, wrap up. The state is kept as plain text in your repository.

session-orchestrator.com (opens another website in a new tab)Product page for session-orchestratorWhat I build for you