{} Claude Skills ยท ch.6 ยท picking the primitive
๐Ÿงญ Chapter 6 ยท Skill vs memory vs hook vs agent

Pick the right primitive

Skills, memory, hooks, and agents look like cousins until you've used the wrong one for the job. This chapter is the decision you make before you write anything.

By Chapter 6 you know what a skill is. Now the harder question: when isn't a skill the right answer? There's a small family of Claude primitives that all look similar from a distance. They have very different jobs.

The whole chapter, in one sentence: hooks fire by themselves, memory holds facts, agents do bounded jobs, and skills are the recipe Claude reaches for when you ask. Get that straight and most architectural decisions become obvious.

1Four cousins, one family

Here's the whole field on one page. Read this once, slowly. Most of the chapter is just nuance on top.

PrimitiveWhat it isTriggerPersistence
Skill A markdown recipe Claude reads when triggered User invokes (explicit or implicit) Per-invocation
Memory Persistent files at ~/.claude/projects/<cwd>/memory/ Always loaded into context Across sessions
Hook Shell command in settings.json, fires on events Automatic on configured events Stateless per fire
Agent A sub-task Claude dispatches Claude decides during a task One-shot
๐Ÿงญ
The columns matter more than the rows. How does it get triggered, and how long does it live? Two questions, four answers. Most picking-the-wrong-primitive bugs trace back to confusing one of these columns.

2Skill vs Memory โ€” recipes vs facts

Skills are recipes. Memory is facts.

A skill says "here's how to deploy a static site": find the build directory, rsync to the host, print the URL. Memory says "the user's deploy target is evil.lt and they prefer scp." One describes a procedure. The other holds the data the procedure works on.

The two are easy to mix up because they're often used together. The deploy skill reads the memory entry to know where to ship things. That doesn't make them the same primitive โ€” it just means good skills lean on memory rather than re-asking the user.

Two heuristics that almost never lie:

  • If you find yourself encoding facts as a skill โ€” "user's git email is X" โ€” move them to memory.
  • If you find yourself encoding a procedure as memory โ€” "to deploy, do steps 1โ€“5" โ€” move it to a skill.
๐Ÿ’ก
A quick test: read it out loud. If it sounds like a sentence ("the user prefers X"), it's memory. If it sounds like instructions ("do A, then B, then C"), it's a skill.

3Skill vs Hook โ€” waiting vs firing

Skills wait. Hooks fire.

A skill sits in ~/.claude/skills/ doing nothing until something triggers it โ€” you type a slash command, or your phrasing matches its description. It's a recipe pinned to the fridge: useful, ready, but never moving on its own.

A hook lives in settings.json and runs by itself on configured events: PostToolUse, OnFileChange, SessionStart, and so on. The harness watches for the event and executes the hook for you. No invocation, no thinking about it, no prompt required.

The decision is almost mechanical:

  • "I'd rather never think about invoking this again." โ†’ hook.
  • "I want to invoke this on purpose, when I decide to." โ†’ skill.

Hooks don't live in the skills folder. They're configuration, not content. If you've ever written a hook, you know you're touching settings.json, not creating a folder.

4Skill vs Agent โ€” recipe vs sub-task

Skills are persistent recipes. Agents are one-shot sub-tasks.

A skill is something you wrote down once and keep using. An agent is something Claude dispatches mid-task โ€” a fresh context, a focused job, a result that comes back when it's done. The agent disappears when the work is finished.

The relationship is usually skills call agents, not the other way around. The book-builder skill spawns one Opus agent per chapter. The skill is the recipe; the agents do the actual work the recipe defined.

If you catch yourself debating "should this be a skill or an agent?" โ€” almost always the answer is: the skill is the architecture, and inside it you might dispatch agents to do the heavy lifting. The two compose; they don't compete.

5When the answer is "just write the prompt"

The fifth option is the one nobody mentions: don't build anything at all.

For a one-off task, skip the abstraction. If you want a function explained line by line, just say that. If you want a SQL query for tonight's report, write the prompt. Skills, memory, hooks, and agents are all overhead โ€” they pay off only when you'll do the same thing again.

A loose rule that holds up:

  • Done it once? Just prompt.
  • Done it twice? Consider a skill.
  • Done it five times? Definitely a skill.

This is also true in reverse. If you're staring at a skill you wrote three months ago and haven't touched since, it might just be a long prompt that never paid off โ€” fine to delete.

6Migration patterns

Picking a primitive isn't permanent. Things drift; that's healthy. Here are the moves that come up most.

Memory โ†’ Skill

You wrote down "I always deploy via scp to evil.lt" as a memory entry. Six months later you've got steps, fallbacks, post-deploy checks. The fact has grown into a procedure. Codify it as a skill and keep the bare facts in memory.

Skill โ†’ Hook

You've got a format-on-save skill, and you find yourself invoking it after every edit. The invocation is no longer the point. Move the trigger to a hook โ€” PostToolUse with a prettier --write command โ€” and stop thinking about it.

Skill โ†’ Memory

You wrote a skill that's really just restating a fact: "the user prefers pnpm." There's no procedure in there. Move it to memory and delete the skill.

Prompt โ†’ Skill

You've typed the same kind of request five times this week. Stop typing it. Write the skill once.

๐Ÿ”
The migration visualizer below (widget B) lets you click each of these arrows and read the case study in context โ€” useful when you're trying to decide which way something should drift.

7Three case studies

The same scenario set, three answers, three different primitives. Read the scenario, then read why.

Memory
"I want Claude to know my git email."
A fact about you. No procedure, no event. Drop it in a CLAUDE.md or memory entry and Claude has it across every session. Building a skill for this would be all overhead and zero recipe.
Hook
"Format my code on every save."
Something must run automatically on an event. That's exactly what hooks are for โ€” a PostToolUse entry in settings.json with prettier --write. A skill would require you to invoke it; the whole point is not to.
Skill
"Deploy my static site cleanly when I ask."
Intentional invocation, an actual recipe (build, rsync, verify, report URL), repeated across many projects. This is the canonical skill shape: workflow you trigger on purpose.

8Decide live: the picker

Five yes/no questions. Most decisions only need two or three. Tell it the shape of what you want and it'll show you the primitive plus a starter snippet.

Interactive ยท primitive picker (extended) Yes / no your way to the right answer
question 1 of 5

9Migration visualizer

Click any arrow between the four boxes to read a short case study on that migration. The arrows are the moves that actually come up in practice.

Interactive ยท migration visualizer Click an arrow ยท read the case study
Click any orange arrow on the left to read the case study.

10Case study browser

Six scenarios. Guess the right primitive first, then flip the card to check. Score yourself.

Interactive ยท case study browser 0 / 6 ยท 0 attempted
Click a pill to guess ยท click the card to flip it

11What memory and hook files actually look like

Two side-by-side examples โ€” both very much not-a-skill. The first is a memory file (a fact). The second is a hook fragment in settings.json (an automation). Recognising the shape of each is half the battle of not reaching for a skill when you don't want one.


          
This is a fact. There's no procedure โ€” Claude reads it and uses the facts when relevant. Memory, not skill.

          
Fires automatically every time Claude edits a file. No invocation needed. Hook, not skill.