Recipe 004
Stop Re-Explaining Your Project: Give Claude Code a Memory with Skills and Agents
Your project grew, and now every fresh session the agent fumbles things it did perfectly last week. It's not getting dumber — it has amnesia. CLAUDE.md, skills, and subagents are the cure, and Claude Code can write them for you.
Here's a frustration every vibe coder hits around week three. Your project has grown past a handful of files. You open a fresh Claude Code session, ask for something it did flawlessly last week — and watch it stumble: wrong folder, forgotten conventions, a deploy command it has to rediscover by trial and error.
My first instinct was that the model was somehow getting worse. It wasn't. Every new session starts with amnesia. The agent that impressed you last week knew things because that conversation taught it — and the knowledge died with the session. The fix isn't better prompting. It's giving your kitchen a memory that survives the night.
Claude Code has three places to put that memory. Think of them as three kinds of kitchen paper.
1. CLAUDE.md — the house rules on the fridge
A plain markdown file named CLAUDE.md in your project root. Claude Code reads it at the start of every session, automatically. This is where the always-true facts live:
- what this project is, in two sentences
- the commands that actually work (
npm run dev, how to deploy, how to run tests) - conventions and hard-won gotchas ("the API lives in src/pages/api — never create a separate server")
Keep it under ~150 lines. It's house rules taped to the fridge, not a novel — every line you add is context the agent carries everywhere, so earn each one.
2. Skills — recipe cards in a box
House rules cover facts. But the thing that actually broke my fresh sessions was procedures — multi-step routines we'd figured out together, like "how we ship a release" or "how we add a new page." That's what skills are for.
A skill is a folder with one file: .claude/skills/<skill-name>/SKILL.md. The folder name becomes the command name.
---
description: Pre-release check for this project — run before every deploy.
Builds, runs the linter, then smoke-tests the three critical pages locally.
---
1. Run `npm run build` — stop and report if it fails.
2. Run `npm run lint` and fix anything auto-fixable.
3. Start the preview server and check /, /archive, and one post page return 200.
4. Summarize what changed since the last git tag, in three bullets.
The clever part is the description line. Claude Code keeps every skill's description in view and pulls in the full recipe card only when the task matches — you ask "let's ship this," it recognizes the situation and follows the checklist. You can also invoke it yourself by typing /skill-name. Either way, a fresh session performs the routine exactly like the session that invented it.
3. Subagents — station cooks with their own prompts
The third layer is for when you want a specialist: a reviewer that only critiques, a test-runner that never touches product code. A subagent is one markdown file in .claude/agents/:
---
name: reviewer
description: Reviews changes for bugs before anything gets committed.
---
You are a picky code reviewer. Look for real bugs, not style nits.
Never edit files — report findings as a numbered list, worst first.
The body is the specialist's standing orders. Claude Code delegates to it automatically when the description matches, and the specialist works in its own context — your main conversation stays clean. My honest advice for beginners: you'll want skills long before you want subagents. Reach for an agent when a job needs different rules (like "never edit files"), not just different steps.
The move that makes this effortless
Here's the part that fits how we actually work: you don't write any of these files by hand. The best CLAUDE.md and the best skills are distilled from a session where things went right — and the agent was there. So at the end of a good session, have it do the distilling.
Paste this into Claude Code at the end of your next productive session:
Look back at everything we did in this session.
1. Create or update CLAUDE.md with what a brand-new session would need
to know about this project: what it is, the commands that work, the
conventions and gotchas you learned today. Keep it under 150 lines.
2. Find the one multi-step procedure we repeated or perfected today and
turn it into a skill at .claude/skills/<short-name>/SKILL.md — with a
description line that tells future-you exactly when to use it.
Show me both files and explain when each one will load.
Then open a brand-new session and ask it to do the thing that used to fumble. That moment — a stranger walking into your kitchen and cooking like they've worked there for months — is when a growing project stops being scary.
Do this at the end of every session where something clicked, and your kitchen compounds: every good session makes the next one smarter.
New here? This builds on the Claude Code setup guide from the Start Cooking series.