Claude Code · Intermediate/Lesson 01 of 08~5 min

Turn a repeated workflow into a skill

Every session, you type the same instructions again. Lesson 1 turns one of them into a file — and the repetition stops.

The Third Way engineering team||Verified against Claude Code v2.1.285 (stable), October 2026

01The goal

Turn a workflow you keep repeating into a project skill: a file that runs when you type its name, and that Claude loads on its own when a request matches what it is for.

02The idea

A skill is a folder holding a SKILL.md file: YAML frontmatter that says what the skill is for, then the instructions Claude follows. A project skill lives in .claude/skills/<name>/SKILL.md. Commit it, and everyone who works in the repository gets it — the same argument as CLAUDE.md, one level up: written, reviewable, versioned beats retyped.

The economics are the reason this is lesson 1. Until a skill runs, at most its description sits in the context window — a line or two. When it runs, the whole file loads. You pay for the full instructions exactly when they earn their keep, and never before. A CLAUDE.md rule is always in the window; a skill is in the window only while it works.

↳Two ways a skill runs
By name

You type /five-whys followed by a problem. $ARGUMENTS in the body receives whatever you typed after the name.

By match

You ask something that fits the description. Claude reads the description, decides the skill applies, and loads the file itself.

Either way

Claude Code loads the whole SKILL.md, and Claude follows the instructions inside it.

The description is doing the auto-loading, so it is the sentence to write carefully: what the skill does, and when to use it.

One frontmatter field matters for safety: disable-model-invocation: true keeps the skill to the first way only — you, typing its name. Use it for workflows with side effects, a deploy being the canonical case; Claude should not decide on its own to run a deploy. And if your repository already has files under .claude/commands/, they are the older format and still run as /name — prefer a skill for new work.

03The walkthrough

Pick the thing you have now explained to Claude three times. If nothing comes to mind, use ours: five whys, the root-cause routine — reproduce, ask why of the evidence, stop at a cause the team can fix. Create the folder and write the file yourself; reading it before it runs is the habit.

↳.claude/skills/five-whys/SKILL.md
---
name: five-whys
description: Finds the root cause of a bug or recurring
problem by asking "why" of the evidence until the answer
is a cause the team can fix. Use when the user asks why
something keeps happening, or wants the root cause
rather than a quick fix.
argument-hint: "[problem]"
---
 
Find the root cause of this problem: $ARGUMENTS
 
1. Reproduce the problem; state how you did it.
2. Ask "why" of the evidence, not of guesses —
five times or until the cause is actionable.
3. Report the chain, the root cause, and two fixes.
 
Don’t change any files.
The description says what it does and when to use it; the body ends with the constraint that keeps it read-only. Both habits scale to every skill you write.
  1. 01Start claude in your repo and run /skills: the list includes five-whys, marked as a project skill. If the skills folder did not exist when the session started, run /reload-skills first.
  2. 02Run it by name, with a problem from your repository: /five-whys npm test fails on one machine but not the other — adjust to something real for you. Watch it reproduce, ask why of the evidence, and land on a cause. In a second terminal, git status should list nothing new: the skill said don’t change any files, and it held.
  3. 03/clear, then ask a question that matches the description without naming the skill: "Why does this keep happening? I want the root cause, not a quick fix." Before Claude answers, the transcript shows the skill loading through the Skill tool — Claude found it from the description alone. That is the moment this lesson exists for.

Once a skill has run, its text stays in the conversation and Claude Code does not re-read the file — edit a skill and it reaches the session the next time it runs, not the next turn.

04Your turn

Build a test-first skill the same way, and finish it yourself: a folder .claude/skills/tdd/SKILL.md, description saying it builds small features test-first and when to use it, body running Red (write the failing test, watch it fail) then Green then Refactor — the Green and Refactor steps are yours to write, and they are the exercise. Leave disable-model-invocation off: this one should load on its own when you ask for a small feature test-first. Run it by name on something small — a slugify(heading) function, or your repo’s equivalent — approve the edits and test runs, and let it commit. Then /clear and ask for a second small feature test-first without naming it, and watch the Skill tool load it. Commit the skill.

Two guardrails worth the ink. A skill can pre-approve tools with allowed-tools, and a project skill’s grant applies even in a claude -p run in a folder you have never trusted — so read the skills in a repository before you run Claude Code there, and think hard before adding allowed-tools to your own. And keep side-effect workflows behind disable-model-invocation: true; auto-loading is for analysis, not for deploys.

↳Check yourself
Q1

Before a skill ever runs, what of it sits in the context window?

  1. ANothing at all
  2. BAt most its description
  3. CThe whole SKILL.md, compressed
→Check your answer
Answer: B

The description is always available; the full file loads only when the skill runs. That asymmetry is why skills scale better than CLAUDE.md for occasional workflows.

Q2

Which frontmatter field keeps a skill to running only when you type its name?

  1. Aallowed-tools: none
  2. Bdisable-model-invocation: true
  3. Cmodel: manual
→Check your answer
Answer: B

It stops Claude from loading the skill on its own — the right setting for workflows with side effects, such as a deploy.

Q3

You edited a skill that already ran this session. When does Claude get the new version?

  1. AOn your next message
  2. BWhen the file is saved
  3. CThe next time the skill runs
→Check your answer
Answer: C

A run skill’s text stays in the conversation and the file is not re-read. Re-run the skill, or start fresh, to pick up the edit.

The Third Way engineering team
Delivery engineering
Work with us