---
title: "#26: Writing Your First Skill"
description: "Today we'll write our very first skill for Claude Code from scratch, and look at what actually happens when Claude decides to use it."
url: https://littlecupsofclaude.com/26
date: 2026-11-30
author: Jake Marsh
topics: ["Claude Code CLI"]
---

# #26: Writing Your First Skill 📦

> Today we'll write our very first skill for Claude Code from scratch, and look at what actually happens when Claude decides to use it.

Published 2026-11-30 by Jake Marsh on Little Cups of Claude. Canonical: https://littlecupsofclaude.com/26
Topics: [Claude Code CLI](https://littlecupsofclaude.com/topics/claude-code-cli)

Today we'll write our very first **skill** for **Claude Code** from scratch, and look at what actually happens when **Claude** decides to use it.

A **skill** is a folder with a `SKILL.md` file inside. The file holds instructions, and the folder can hold anything else those instructions need. The interesting part is how little of it **Claude** reads until it's needed. Let's get started.

## Making The Folder

We'll build a skill that writes release notes for our **Cortana** app. Personal skills live in our home directory and show up in every project:

```bash
mkdir -p ~/.claude/skills/release-notes
```

For a skill the whole team should get, we'd use `.claude/skills/release-notes/` inside the repo and commit it instead.

## The SKILL.md File

Every `SKILL.md` has **YAML** frontmatter between `---` markers, then plain **Markdown** instructions:

```markdown
---
description: Writes user-facing release notes from merged changes. Use when someone asks for release notes, a changelog entry, or "what's new" copy.
---

Write release notes for Cortana.

- Group changes under New, Improved, and Fixed
- One short sentence per change, written for customers
- Skip refactors, test changes, and dependency bumps
- Details on our tone are in [voice.md](voice.md)
```

Every frontmatter field is optional, but `description` is the one the docs recommend, because it's how **Claude** decides when the skill applies. The folder name becomes the command, so we can also run it ourselves with `/release-notes`.

## When Claude Loads It

At the start of a session, **Claude** doesn't read our instructions at all. It gets a listing of skill names and descriptions, and the full `SKILL.md` body only enters the conversation when the skill is invoked.

That's why the description matters so much. The combined `description` and `when_to_use` text is cut off at 1,536 characters in that listing, so the main use case belongs first. If we have lots of skills, **Claude Code** drops some descriptions to fit a budget of around ~1% of the context window, starting with the ones we use least.

Two fields change who gets to invoke it:

```markdown
---
description: Background on how our legacy billing system works
user-invocable: false
---
```

`user-invocable: false` hides the skill from the `/` menu, so only **Claude** can load it. That's handy for background knowledge. The opposite, `disable-model-invocation: true`, means only we can run it, and it also keeps the description out of context entirely.

To check that **Claude** can see our new skill, we can just ask:

```text
What skills are available?
```

**Claude Code** watches skill folders, so edits to `SKILL.md` get picked up in the current session. If a brand new skill doesn't appear, `/reload-skills` re-scans for it.

## Supporting Files

Here's where a skill gets more interesting than a single prompt. The folder can carry reference docs, examples, and scripts:

```text
release-notes/
├── SKILL.md
├── voice.md
├── examples.md
└── scripts/
    └── merged-prs.sh
```

We link to each file from `SKILL.md` and say what's in it, and **Claude** reads them only when it needs them. Scripts get executed rather than loaded, so their contents never cost us context. Our big style guide sits on disk until a release actually comes up. Neat!

The docs suggest keeping `SKILL.md` itself under 500 lines and moving the details out into files like these.

## How Long It Sticks Around

Once invoked, the rendered `SKILL.md` stays in the conversation as a single message across later turns. **Claude Code** doesn't re-read the file, so instructions should read as standing rules ("run the tests after every edit") rather than one-time steps.

Compaction is the exception. After the conversation is summarized, each invoked skill is re-attached with only its first 5,000 tokens kept, and all re-attached skills share a 25,000 token budget. The most important instructions belong near the top.

## Watch Out

If the frontmatter **YAML** doesn't parse, the skill still loads, but with no fields set. `/release-notes` keeps working while **Claude** quietly stops matching on our description. To catch that, we can validate a whole skills folder:

```bash
claude plugin validate ~/.claude/skills
```

Running with `--debug` also shows the parse error. And since a field name has to match exactly, a typo like `disable-model-invoke` gets ignored without any warning.

More info about **skills** can be found at [the Claude Code docs](https://code.claude.com/docs/en/skills).
