Build faster with
Claude Code
Your team's complete reference guide — prompts, commands, checklists, and best practices. All in one place.
Quickstart: Zero → a Live Link
New here? Start on this page. In about 30 minutes you'll go from nothing to a real website live on the internet — a public link like your-project.vercel.app you can open on your phone and send to anyone. You don't need to know how to code: you tell Claude what you want in plain English, and it does the work. Each step below is the short version and links to the full chapter if you want detail.
Words you'll see (in plain English)
| Word | What it really means |
|---|---|
| The Claude Code app | A friendly app (Mac & Windows) where you point Claude at a folder and chat — no terminal needed. |
| Project folder | One folder on your computer that holds your whole project. |
| Claude Code | The AI that builds inside that folder. In the app, it lives under the Code tab. |
| Diff view | The side-by-side preview of every change. You click Accept or Reject — nothing changes until you accept. |
| GitHub | A free cloud backup for your project. |
| Hosting / Vercel | The service that puts your project on the internet and gives you a public link. |
| Deploy | The act of putting your project online. |
| A live link | The prize: a URL anyone can open. |
Step 1 — Get the Claude Code app (once)
One download and you're ready — no terminal, nothing to configure. The full walkthrough with fixes is in Part 1: Setup.
Step 2 — Open your project folder
Step 3 — Build your first page (one prompt)
Now the fun part. Not sure what to build? Pick a starter idea, then paste the prompt and answer Claude's questions in plain English.
| Starter idea | Great for |
|---|---|
| A one-page personal site (your name, what you do, a contact button) | Your first win, fast. |
| A simple tool (e.g. a tip or pricing calculator) | Something useful you'll actually open. |
| A one-page menu or portfolio for your business | Showing real work to clients. |
I'm brand new to coding. Build me a simple one-page website.
Idea: [a personal landing page with my name, what I do, and a contact button]
Requirements:
- one clean, modern page that works well on phones
- no database, no complex setup
- after you build it, show me how to preview it in my browser
Explain each step in plain English, and wait for my OK before big changes.
✅ First win: Claude shows the change in the diff view; click Accept, then open the preview Claude gives you (it can run your page in the app's Browser pane). 🎉
Step 4 — Put it on the internet (one prompt)
Your page works on your computer. Now let's give it a public link. Claude does the GitHub + hosting steps for you — you just approve and log in when asked.
Help me put this project online so I have a public link I can share.
- Create a private GitHub repo and push this project. Show me what will be
committed first, and never commit secrets or passwords.
- Deploy it to Vercel and give me the live URL.
- Explain what you're doing in plain English, and pause whenever I need to
log in or click something.
At the end, give me the public link.
Step 5 — You did it 🎉
When Claude hands you a link like your-project.vercel.app, open it on your phone. That's your project, live on the internet.
Where to go next
| You want to… | Go to |
|---|---|
| Change or add something to your page | Part 3: The Daily Workflow |
| Make Claude remember your project's rules | Part 2: Starting Any Project |
| Follow the full guided path | 10-Day Builder Path |
| Prefer the terminal / command line? | Part 8: Deploying |
Stuck? Your lifeline
If anything breaks — an error, a "command not found", a login loop — don't panic. Copy the red text and paste this to Claude:
I'm a beginner and I'm stuck. Here's exactly what I did and the error I see:
[paste what you did and the full error text]
Explain what went wrong in plain English and give me the simplest fix,
one step at a time.
The three fixes that solve most beginner problems:
- Reject the change and ask Claude to try again, more simply.
- Quit and reopen the Claude Code app.
- Restart your computer, then sign in again.
Glossary — Words to Know
New words show up fast in any building tool. Here is every term used in this guide, in plain English. You don't have to memorize any of it — skim it once now, then come back whenever something doesn't click. Each term is also explained again the first time it matters in a chapter.
1. The basics — your tools & workflow
| Word | What it really means |
|---|---|
| Terminal / CLI | A text box where you type commands instead of clicking menus. Optional — only needed for the Advanced (command-line) path; the Claude Code app doesn't require it. "CLI" = command-line interface. |
| VS Code | Visual Studio Code — the free editor (by Microsoft) used on the Advanced (command-line) path. |
| Project folder / repository (repo) | One folder that holds your whole project. Once Git is tracking it, it's called a "repo." |
| Claude Code | The AI that builds inside your project folder — via the desktop app's Code tab, or by typing claude in a terminal on the Advanced path. |
| Claude Code app | The desktop app (Mac & Windows) where you point Claude at a folder and chat. The beginner-friendly way to use Claude Code — no terminal. |
| Diff view / Accept & Reject | The app's side-by-side preview of each change; you Accept or Reject it. Nothing changes until you Accept. |
| Context window | Claude's short-term memory for one conversation — every message, file, and command it is currently holding. It fills up, and when it is full Claude starts to forget. Start a fresh chat to clear it. |
| Token | The unit AI reads and writes in — roughly ¾ of a word. Usage and plan limits are measured in tokens. |
| npm | Node Package Manager — the "app store" for JavaScript tools. Comes with Node.js. |
| Node.js | A program that lets JavaScript run outside a browser. Claude Code is built on it. |
| PATH | A list your computer checks to find programs you type by name. If a command says "not found," the program usually isn't on your PATH yet — reinstalling and reopening the terminal fixes it. |
2. Saving & shipping — Git and hosting
| Word | What it really means |
|---|---|
| Git | A version-control system that saves a complete history of every change. Think of it as infinite undo for your project. |
| GitHub | The cloud where your Git repositories live — a free backup, and your developer identity for logging into other services. |
| Commit | A saved snapshot of your changes with a short message describing them. |
| Branch | A parallel copy of your project where you can make changes safely. main is the live branch; you work on another and merge it in. |
| Merge | Combining the changes from one branch into another (usually into main). |
| Push / Pull | Push = upload your commits to GitHub. Pull = download the latest from GitHub to your computer. |
| Pull request (PR) | A request to merge one branch into another so the changes can be reviewed before they go live. |
| Deploy | Publishing your code to a live server so anyone can open it at a URL. |
| Vercel | The hosting platform in this stack. Connects to GitHub and auto-deploys when you push to main. |
| A live link / URL | The prize — a public web address anyone can open, like your-project.vercel.app. |
3. Files that steer Claude
| Word | What it really means |
|---|---|
| CLAUDE.md | A file Claude reads at the start of every session — your project's rules, conventions, and context. |
| MASTERPLAN.md | Your project's blueprint: what you're building, for whom, and how. |
| PROJECT_STATE.md | A living "where we are now" file so you (and Claude) don't have to re-explain context each session. |
| Plugin / Skill | An add-on that gives Claude specialized knowledge for a kind of task. A Skill is a folder with a SKILL.md; a Plugin bundles Skills, hooks, and more into one install. |
| Hook | A rule that runs automatically at a set moment (before a push, after an edit). Unlike CLAUDE.md advice, a hook always fires. |
| Subagent | A separate Claude with its own instructions and tools, used for focused jobs (deep file exploration, review) so your main chat stays clean. |
| MCP (Model Context Protocol) | A standard that lets Claude connect to outside services (Stripe, GitHub, Supabase) and take actions on them. |
4. How apps are built — web words
| Word | What it really means |
|---|---|
| Frontend / Backend | Frontend = what users see and click in the browser. Backend = the server logic, database, and APIs behind it. |
| Framework / Next.js | A framework is a ready-made structure for building apps. Next.js is the React framework used in this stack. |
| Database | Where your app stores data — users, orders, posts. Supabase provides one. |
| Supabase | The database platform in this stack: a PostgreSQL database, authentication, and more. |
| Prisma | An ORM (Object-Relational Mapper) — lets you work with your database in TypeScript instead of raw SQL, which also helps prevent SQL injection. |
| Server Component / Client Component | A Next.js idea. Server Components run on the server (default, efficient); Client Components (use client) run in the browser for interactions. |
| API / API key | An API is how programs talk to each other. An API key is a secret password proving a request is allowed — keep it out of your code (see environment variable). |
| Environment variable | A config value (like an API key) stored outside your code, read via process.env.VAR_NAME. Never put these in code files. |
.env.local | The file where you keep environment variables for local development. Never committed to GitHub. |
| Webhook | A notification one service sends another when something happens — e.g. Stripe pings your app when a payment succeeds. |
| Stripe | The payment platform. Handles all money movement. |
| kebab-case | A naming style: lowercase words joined by hyphens, like my-project-name. Common for files, folders, and URLs. |
5. Security & privacy words
| Word | What it really means |
|---|---|
| XSS (Cross-Site Scripting) | An attack that sneaks malicious code into your page so it runs in another user's browser. |
| CSRF (Cross-Site Request Forgery) | An attack that tricks a logged-in user's browser into doing something they didn't intend. |
| SQL injection | An attack that sneaks database commands into a form field to read or destroy data. Safe, parameterized queries (Prisma does this) prevent it. |
| RLS (Row-Level Security) | A Supabase/PostgreSQL feature that controls which users can read or write which database rows. |
| OAuth | The "Sign in with Google/GitHub" standard — it authenticates you without sharing your password. |
| GDPR | Europe's data-privacy law. If you collect personal data from EU users, you must follow it (consent, access, deletion). |
10-Day Builder Course Path
This is the hand-held path for non-technical people. Students should not read 300 lessons before they build. They should install, build something small, publish it, then learn Claude Code's advanced features only when those features solve a real problem.
The promise
10-day build path
| Day | Level | Module | Outcome |
|---|---|---|---|
| 1 | Beginner | Install the app, open a folder | Open a folder, run safe commands, start Claude Code. |
| 2 | Beginner | First Build | Create a simple page, app, or useful internal tool. |
| 3 | Beginner | GitHub + Deploy | Commit, push, and publish a first preview. |
| 4 | Builder | Daily Workflow | Use goals, context, acceptance criteria, and review loops. |
| 5 | Builder | Memory + CLAUDE.md | Add project overview, standards, common commands, and known issues. |
| 6 | Builder | Slash Commands + Checkpoints | Use commands, permissions, and rewind patterns safely. |
| 7 | Power | Skills | Create reusable SKILL.md workflows for repeated work. |
| 8 | Power | MCP + Plugins | Connect external tools and package reusable capabilities. |
| 9 | Advanced | Subagents + Agent Roster | Delegate research, QA, security, and implementation safely. |
| 10 | Advanced | Launch Review | Run checks, legal basics, deploy review, and handoff. |
Beginner to super advanced map
| Level | Teach now | Do not overload them with |
|---|---|---|
| Beginner | Install the app, open a folder, first prompt, first build, GitHub, deploy, checkpoints as undo. | Hooks, MCP architecture, plugin publishing, managed settings. |
| Builder | CLAUDE.md, project overview, development standards, common commands, team contacts, known issues. | Memory hierarchy, excludes, auto memory, settings hierarchy. |
| Power user | Slash commands, skills, MCP servers, plugin marketplace, subagents, checkpoint workflow. | Custom command architecture, MCP server authoring, subagent security policy. |
| Super advanced | Hooks, plugin development, background agents, worktree isolation, headless mode, managed settings, CLI configuration. | Only teach after students have shipped at least one project. |
How the big topics fit
| Topic from the advanced course | Where it belongs | Simple teaching angle |
|---|---|---|
| Slash Commands | Day 6 | Shortcuts inside Claude Code. Type / and pick what you need. |
Memory + CLAUDE.md | Day 5 | Project instructions Claude remembers every session. |
| Skills | Day 7 | Reusable playbooks for repeated tasks like review, SEO, Stripe, or design QA. |
| Subagents | Day 9 | Extra helpers for research, QA, security, and broad audits. |
| MCP Servers | Day 8 | Connect Claude to outside tools, docs, databases, or workspaces. |
| Hooks | Super advanced | Automatic guardrails that run every time. Teach after manual review habits exist. |
| Plugins | Day 8+ | Bundles that package skills, hooks, agents, and MCP tools. |
| Checkpoints | Day 6 | Rewind and recover. Pair with Git commits for safety. |
| Control & Safety | Daily Workflow → Part 10 | Context commands, plan mode, permissions, and remote control — control how much Claude does on its own. |
| CLI and Configuration | Super advanced | Flags, environment variables, managed settings, and repeatable team defaults. |
Prompt: simplify any advanced topic
Act as a course creator for non-technical people learning Claude Code.
Turn this topic into a friendly lesson:
[topic]
Make it:
- beginner-safe
- practical
- copy-paste friendly
- focused on building something real
- no more than 5 steps before the learner gets a visible result
Include:
1. Why this matters
2. What to click
3. What to paste
4. What success looks like
5. What to ignore until later
Part 1: Setup (One-Time)
You only do this once. The easy way is the Claude Code app — download it, sign in, and you're ready. No terminal, no separate tools to install. Pick your computer below so the one OS-specific step (Windows needs Git) shows correctly.
The highlighted tab is the one you're following. Your choice is remembered on this device.
🌐 Browser = a normal web page (Chrome, Safari, or Edge) — used for the steps below. 🖥️ Terminal only shows up inside the Advanced block further down, if you choose the command-line path.
Think of the app as hiring a chef who brings their own kitchen.
Older setups made you build the kitchen first — install an editor, an engine, a history tool, then the AI. The Claude Code app brings all of that inside itself. You just open the door (sign in) and point at the folder you want cooked.
1. Download & install the app
What it is: the Claude Code desktop app — a normal application window with a Code tab where the AI builds inside your project folder. It includes everything it needs: you don't install Node.js or a command line separately.
🌐 Browserhttps://claude.ai/api/desktop/darwin/universal/dmg/latest/redirect?utm_source=claude_code&utm_medium=docsOpen the link, run the downloaded .dmg, and drag Claude to your Applications folder.
https://claude.ai/api/desktop/win32/x64/setup/latest/redirect?utm_source=claude_code&utm_medium=docsOpen the link, run the installer, and launch Claude from the Start menu. (On an ARM/Snapdragon PC? Use the ARM64 installer.)
2. Sign in
What it is: the login that lets Claude Code work. It needs a paid plan.
claude.com/pricing, then reopen the app.3. Install Git (Windows only)
Why: on Windows, Claude needs Git installed for local projects to work (it's how your changes get saved and backed up). Macs already include it, so Mac users skip this.
🌐 Browserhttps://git-scm.com/downloads/winOpen the link, download the installer, and click Next through every screen (the defaults are correct). Then quit and reopen the Claude app.
⌨️ Advanced: prefer the terminal / command line?
Everything above is all a beginner needs. If you'd rather run Claude Code from a terminal inside VS Code (the setup the more advanced Parts of this Bible sometimes assume), install these five pieces instead. This path is optional.
This is setting up a kitchen before you cook: VS Code = the kitchen · Node.js = the oven · Git = a photo at every step · Claude Code = the chef · signing in = the chef's keycard.
| # | Tool | What it's for |
|---|---|---|
| 1 | VS Code | The window where you see your files and open the terminal. |
| 2 | Git | Saves a history of every change and connects to GitHub. |
| 3 | Node.js | The engine that runs the tools many web projects need under the hood. |
| 4 | Claude Code (CLI) | The AI that builds inside your project folder, started by typing claude. |
| 5 | Sign in | Connect Claude Code to your Claude account. |
Install VS Code from code.visualstudio.com. Git: Mac xcode-select --install (or brew install git); Windows https://git-scm.com/downloads/win (or winget install Git.Git). Node.js LTS from nodejs.org (or brew install node / winget install OpenJS.NodeJS.LTS). Claude Code CLI: Mac curl -fsSL https://claude.ai/install.sh | bash; Windows PowerShell irm https://claude.ai/install.ps1 | iex. Then run claude and sign in through the browser.
git --version
node --version
claude --version
claudecommand not found? Close the terminal, open a fresh one, and try again — new tools only appear in terminals opened afterward.SOP: where to click
1. Open the Code tab
The Code tab is the one with access to your files. Chat and Cowork are separate.
2. Select your folder
Open the whole project folder, not one file, so Claude can understand the project.
3. Type a request & review
Nothing changes on disk until you click Accept. Type / for built-in commands.
Quick check — you're ready
First prompt after opening Claude Code
I am new to coding. Please inspect this project before changing anything.
Tell me:
1. What files and folders matter
2. How to run the project locally
3. What commands are safe to run
4. What you recommend as the first small step
Do not edit files until I approve the plan.
GitHub Account
- Create an account at github.com using a personal email
- Choose a professional username — this is your developer identity
- Always use "Sign in with GitHub" when creating accounts at Vercel, Supabase, Railway, etc. This links everything to one identity and removes password management.
Folder Structure (Required)
Never work from your Desktop (iCloud/OneDrive sync breaks code files). Use this structure for every project you ever create:
Documents/
claude-projects/ ← one parent folder for all projects
my-first-project/ ← one folder per project
docs/
MASTERPLAN.md ← your project document (see Part 2)
second-project/
docs/
MASTERPLAN.md
Naming rules — always use these for folder and file names:
- No spaces → use dashes:
my-projectnotmy project - No accents or special characters:
design-webnotdiseño-web - All lowercase:
my-appnotMy-App
Pro tip: Pin the claude-projects folder in Finder (Mac) or Quick Access (Windows) so you can always get there in one click.
Part 2: Starting Any Project
Every project, without exception, needs these three documents before you write a single line of code with Claude.
Claude is a brilliant builder that wakes up with no memory. These three files are how you brief it — and how it remembers.
Picture hiring a contractor who's genuinely amazing… but forgets everything overnight. Before any project, you hand them three documents:
| File | What it is | The analogy — and what happens if you skip it |
|---|---|---|
MASTERPLAN.md | What you're building and why. | The blueprint. Skip it and the contractor builds a house — just not the one in your head. |
CLAUDE.md | How to work here: rules, tools, conventions. | The house rules on the wall, read before every shift. Skip them and it builds its way, not yours. |
PROJECT_STATE.md | What's done, what's next, decisions made. | The site logbook. Since it forgets overnight, this is how tomorrow's session picks up where you stopped. |
Before You Start — the checklist
This is the whole setup at a glance. Tick each box, then follow 2.1–2.4 below for the how-to — each item maps to a section. The first two come from Part 1; the rest you'll do here.
2.1 MASTERPLAN.md — The Blueprint
This is the blueprint. The more detail you put in, the closer the finished build is to what's in your head — a vague blueprint gets you a vague house.
This is the most important file in your project. It's what Claude reads to understand what you're building. The more detail, the better the output.
MASTERPLAN.md is simply the filename you save it as. You ask Claude for a PRD → you save what it gives you as MASTERPLAN.md. One document — not two.How to create it: Open claude.ai and paste this prompt:
I want to create a PRD (Product Requirements Document) for a project I'm going to build in Claude Code. I'm not a developer, so act as an expert product manager and interview me to get this right. Ask me ONE question at a time, wait for my answer, then ask the next — don't ask everything at once, and don't write the document until you've covered everything. Work through: the problem I'm solving, who it's for, the main things a user must be able to do (and what can wait until later), what "done"/success looks like, and anything else you'd need to build it well. If an answer of mine is vague, ask a follow-up before moving on. When you have enough to write a clear, detailed plan, give me the complete document in Markdown (.md) format. My idea is: [describe your idea in as much detail as possible]
Claude will interview you one question at a time — it may ask quite a few, and that's the point. Answer each as fully as you can; the richer your answers, the better your app. When it's done asking, it writes the full MASTERPLAN for you.
Required sections in your MASTERPLAN:
# MASTERPLAN: [Project Name]
## What This Is
A platform for [X] that allows users to [Y].
The problem it solves is [Z].
## Ideal User
- Profile: [who they are]
- Main pain point: [what frustrates them today]
## MVP Features
1. Landing page
2. User registration / login
3. User dashboard
4. Payment with Stripe
5. [add your specifics...]
## User Flow
1. User lands on homepage
2. Signs up with email
3. Accesses their dashboard
4. [continue the journey...]
## Visual References
- I like the design of [url]
- I like the checkout flow of [url]
- [attach screenshots of anything you like]
The longer and more detailed this file, the better your results. Do not skip it.
2.2 CLAUDE.md — Claude's Project Memory
These are the house rules Claude reads before every shift, so it builds your way. Each time you correct a mistake, write it here — so the same mistake never happens twice.
CLAUDE.md is a special file Claude reads at the start of every conversation. It tells Claude the rules, conventions, and context of your project. Without it, Claude works blind.
Step 1: Generate it automatically
Open your project in the Code tab of the Claude Code app (or a terminal, if you're on the Advanced path), then run:
/init
Claude will scan your project and auto-generate a CLAUDE.md with conventions it detects.
Step 2: Enrich it with best practices
After /init runs, give Claude this prompt:
Read https://code.claude.com/docs/en/best-practices and improve the CLAUDE.md we just created following all of Anthropic's official recommendations. Make sure to include code conventions, build/test commands, and workflow rules that apply to our project.
What belongs in CLAUDE.md:
| Include | Do NOT include |
|---|---|
| Build and test commands Claude can't guess | Things Claude can read from the code itself |
| Style rules that differ from defaults | Standard conventions Claude already knows |
| Testing framework and how to run tests | Full API documentation (link to it instead) |
| Repo conventions (branch names, PR rules) | File-by-file descriptions of the codebase |
| Architectural decisions and why | Obvious things like "write clean code" |
| Non-obvious behaviors and gotchas | Information that changes frequently |
Example CLAUDE.md:
# Project: [Name]
## Tech Stack
- Framework: Next.js 15 with App Router
- Database: PostgreSQL via Supabase
- ORM: Prisma
- Styles: Tailwind CSS
- Language: TypeScript
## Commands
- `npm run dev` — local development
- `npm run build` — production build
- `npx prisma db push` — sync schema to DB
## Folder Structure
- /app — Routes and pages
- /components — Reusable components
- /lib — Utilities and configs
- /prisma — Database schema
- /docs — Project documentation
## Conventions
- Strict TypeScript throughout
- Functional components with hooks
- Server Components by default; `use client` only when required
- API routes in /app/api
- File names in kebab-case
- Component names in PascalCase
## Rules
- Do not introduce new libraries without asking me first
- Never hardcode API keys or secrets in code
- Always read MASTERPLAN.md before starting a new feature
Rule: Every time Claude makes a mistake and you correct it, add that correction to CLAUDE.md so it never happens again.
Where your memory lives — and how to add to it:
| File | Who sees it | Applies to |
|---|---|---|
./CLAUDE.md (project) | Your whole team — committed to Git | This one project |
~/.claude/CLAUDE.md (personal) | Just you | Every project on your computer |
CLAUDE.local.md | Just you — Git-ignored | This project only |
Edit any of these without leaving Claude — run /memory to open your memory files:
/memory
Keep CLAUDE.md short by importing other files into it: write an @ path and Claude pulls that file in too.
See @docs/conventions.md for our style rules and @docs/git-workflow.md for branch naming.
~/.claude/CLAUDE.md first, then the project's CLAUDE.md — so project rules layer on top of your personal defaults.2.3 PROJECT_STATE.md — Memory Between Sessions
This is the site logbook. Claude forgets overnight; the logbook is how the next session knows what's finished and what's next — no "where were we?" every morning.
Claude forgets everything when you close a conversation. For projects that last more than a few hours, use a PROJECT_STATE.md file maintained by a subagent (see Part 6). This lets Claude pick up exactly where it left off in every new session.
Once you've created the project-documenter subagent (Part 6), add this to the bottom of your CLAUDE.md:
## Session Rules
- At the start of every session, read PROJECT_STATE.md before doing anything
- Before and after any large task (>3 files or a new feature), invoke the project-documenter subagent
2.4 First Prompt Template
Once your MASTERPLAN.md is in the docs/ folder and CLAUDE.md is in the root, start your first Claude Code session with:
Read docs/MASTERPLAN.md to understand this project.
To start:
1. Create a CLAUDE.md in the root following the best practices at https://code.claude.com/docs/en/best-practices
2. Build the base project structure so we can go section by section
3. Create a basic landing page based on the MASTERPLAN
4. Run `npm run dev` so I can see it in the browser
Do not install unnecessary libraries. Ask me before introducing anything not in the MASTERPLAN.
What Claude will do:
- Read your MASTERPLAN
- Read Anthropic's official best practices
- Create a complete CLAUDE.md
- Set up the file structure
- Install dependencies
- Build a landing page
- Start the dev server so you can see it at
http://localhost:3000
Success criterion: You can see your project in a browser.
2.5 Standard Rules — Paste Before Every Project
Think of this as your standing contract with Claude — the house rules every new "contractor" agrees to before touching the site. Paste it at the start of any project. Even better (see 2.2): drop it into your personal ~/.claude/CLAUDE.md once, and every project follows these automatically — paste once, never again.
STANDARD RULES — follow these for our entire work on this project.
Before you start
1. Read docs/MASTERPLAN.md, CLAUDE.md, and PROJECT_STATE.md (if it exists)
before doing anything. Inspect the project before you change it.
2. For anything bigger than a small edit, show me a short plan and wait for my
OK before you build.
How to work
3. Work in small steps. After each change, tell me in plain language what you
did — assume I'm not technical.
4. Don't ask permission for small, safe, reversible steps — just do them and
keep moving. STOP and explain first ONLY for big or hard-to-undo actions:
deleting files or data, installing a new tool or paid service, changing the
database, pushing to GitHub, deploying, or anything touching secrets, money,
or live users.
5. If a choice is unclear or could break something, ask me instead of guessing.
Safety
6. Never put API keys, passwords, or secrets in the code. Use a .env file, keep
it in .gitignore, and never commit secrets.
7. Don't add any new library, tool, or paid service without asking me first.
Branches & shipping
8. Work on a branch (or "staging"), never directly on main. If this project
isn't set up that way yet, set it up first: create a staging branch, make
main the auto-deployed production branch, and add the "all work on staging,
never main" rule to CLAUDE.md. Test locally — and on a preview/staging URL
if we have one — before merging to main or deploying. Never push to
production without my OK.
9. With Git: small commits, clear messages, stage specific files (never a blind
"git add ."), and ask before pushing.
Keep it handoff-ready
10. Keep CLAUDE.md updated when I correct you. Keep PROJECT_STATE.md and a
HANDOFF.md current (what's done, what's next, how to run/test/continue) and
commit them to Git — so you, I, or another AI can pick up later.
Before going live
11. Before any deploy: check for exposed secrets and security problems, and make
sure the build (and tests, if any) pass. If anything fails, don't deploy —
tell me.
deny/ask list in settings.json (see Part 10.3), so the dangerous stuff always stops even if Claude forgets a rule. Bypass alone removes that safety net.GitHub: First Project Launch Path
Use this when you are taking a first Claude Code project from your computer to the cloud. The goal is simple: a private GitHub repo, clean handoff docs, Vercel hosting, optional Stripe payments, and a design system Claude can keep consistent.
Commit, push, pull request — three steps, not one.
| Step | What it does | Where it happens |
|---|---|---|
| Commit | Saves a snapshot of your changes. | On your computer |
| Push | Uploads your commits to the cloud. | To GitHub |
| Pull request (PR) | Proposes merging your branch in, for review. | On GitHub |
The launch stack
| Layer | Recommended default | Why it matters |
|---|---|---|
| Project brain | MASTERPLAN.md + CLAUDE.md | Claude knows what you are building, how to run it, and what rules to follow. |
| GitHub | Private repository named like your project folder | Stores the project in the cloud and lets another LLM or teammate continue later. |
| Vercel | Import the GitHub repo | Every push can create a preview; production comes from the main branch. |
| Design | Tailwind CSS + shadcn/ui + lucide-react | Gives Claude reusable components instead of random one-off CSS. |
| Payments | Stripe Checkout Sessions | Best beginner default for one-time payments or subscriptions because Stripe hosts the checkout. |
| Launch basics | Privacy, terms, legal notice, cookie banner | Often required before ads, analytics, payments, or API access. |
GitHub Checklist
Prompt: Connect Existing Project to GitHub
I created a private GitHub repository for this project.
Repository URL: [PASTE GITHUB REPO URL HERE]
Please prepare this local project for GitHub and another LLM/agent handoff.
Before pushing:
1. Inspect git status, current branch, changed files, untracked files, and whether a remote already exists.
2. Check for secrets or files that should not be committed: .env, API keys, credentials, node_modules, build outputs, cache folders, and large generated files.
3. Make sure README.md explains what the project does, how to run it locally, and how to test/build it.
4. Make sure CLAUDE.md explains project rules, commands, and the definition of done.
5. Create or update docs/HANDOFF.md with current state, next steps, and what another agent should know.
6. Show me the exact files you plan to commit and wait for my approval before pushing.
After I approve, commit with a clear message, push to GitHub, and give me the repo URL, branch name, commit hash, and next-agent notes.
Commands Claude May Use After Approval
git status
git remote -v
git add README.md CLAUDE.md docs .gitignore src package.json
git commit -m "Prepare first project handoff"
git remote add origin [GITHUB_REPO_URL]
git branch -M main
git push -u origin main
git rev-parse --short HEAD
Rule: do not run git add . blindly on a first project. Ask Claude to show what will be staged first.
Vercel Prompt
Help me deploy this project to Vercel from GitHub.
First verify the repo is pushed and the project has README.md, CLAUDE.md, .gitignore, and documented environment variables.
Then tell me the exact Vercel settings:
- framework preset
- install command
- build command
- output directory
- environment variables for Preview
- environment variables for Production
Explain the difference between Preview and Production in plain English. Do not paste secret values into code.
Stripe Prompt
I want to add Stripe payments to this project safely.
Use Stripe Checkout Sessions unless there is a strong reason not to.
Explain test mode vs live mode.
List the environment variables I need for Preview and Production without secret values.
Create the minimum checkout flow and webhook plan.
Add a launch checklist: privacy policy, terms, cookie banner, test card, webhook test, and Vercel production keys.
Do not use live keys during development.
Design Libraries to Ask For
| Library | Use when | Prompt line |
|---|---|---|
| Tailwind CSS | You want fast, consistent styling. | Use Tailwind and define a small design token system. |
| shadcn/ui | You need polished forms, dialogs, dashboards, tables, and navigation. | Use shadcn/ui components where helpful, but do not install unnecessary components. |
| lucide-react | You need clean icons for buttons, nav, cards, and empty states. | Use lucide-react icons instead of emoji for production UI. |
| Framer Motion | You need subtle product animation. | Add restrained motion only where it helps the user understand state. |
| Magic UI / Aceternity-style components | You want marketing polish after the app works. | Use one or two premium visual sections, not a component dump. |
First Project Audit Prompt
Audit this first project before I share it or deploy it.
Check:
- GitHub readiness
- Vercel deployment readiness
- environment variables and secrets
- mobile, tablet, desktop UX
- SEO basics: title, URL, description, share image
- security basics: exposed routes, auth, API keys
- payments readiness if Stripe is used
- legal basics: privacy, terms, cookie banner
Give me critical, normal, and low-priority issues. Fix only after I approve the plan.
Part 3: The Daily Workflow
3.1 The Two-Branch Rule
main is your live storefront. staging is the workshop out back.
You never rebuild a window display while customers are in the store. You build and test in the workshop (staging), and only when it's right do you move it out front (main).
staging — the workshop | main — the storefront | |
|---|---|---|
| What it is | Where you build and test | The live site, in public |
| Who sees it | Just you (or a private preview link) | Your customers |
| Work here? | Yes — every day | No — only merge in tested work |
| If it breaks | No harm; nobody saw it | Real users hit a broken site |
Push to staging freely. Moving to main is the deliberate "we're live" step.
Never work directly on main. Always use two branches:
main— production code only. What Vercel deploys.staging— where all development happens.
When something is tested and ready: merge staging → main. Vercel auto-deploys.
Ask Claude to set this up:
Set up a two-branch workflow for this project: main (production) and staging (development). Create the staging branch, configure Vercel to deploy main automatically, and add a rule to CLAUDE.md that all development happens on staging — never on main.
3.2 How to Write Good Prompts
Writing a prompt is like briefing a contractor: "make it nice" gets you a guess; a clear brief — what, where, the exact look, and what NOT to touch — gets you what you pictured. That's all the structure below does.
The quality of your output is almost entirely determined by the quality of your input. Use these patterns.
Use Screenshot First
Before describing what you want in words, show Claude an image. Claude understands visuals perfectly.
- Screenshot → paste into Claude → "build something like this"
- Works for layout, colors, UI patterns, checkout flows, dashboards
- Mac shortcut:
Cmd + Ctrl + Shift + 4to copy a screenshot to clipboard - Windows shortcut:
Windows + Shift + S
Then Cmd/Ctrl + V to paste directly into Claude.
Good prompt structure:
Context: [What part of the project this is about]
Goal: [What you want to achieve]
Constraints: [What Claude should NOT do]
Success: [How you'll know it worked]
Examples:
| Bad prompt | Good prompt |
|---|---|
| "Make the homepage better" | "Improve the hero section on the homepage. The headline should be larger, use our blue color (#1a73e8), and add a CTA button that says 'Get Started' linking to /signup. Don't change anything else." |
| "Add payments" | "Implement a Stripe checkout for the $49/month plan. Create an API route at /api/checkout, a button on the /pricing page, and a webhook at /api/webhook that updates the user's is_paid field in Supabase when payment confirms. Keys are already in .env.local." |
| "Fix the bug" | "There's a bug: when a user clicks 'Save', the page reloads but the data doesn't persist. It's in the ProfileForm component at /components/profile-form.tsx. The save function should call POST /api/user/update. Check the network tab — the request returns a 500 error." |
Use @filename references to point Claude at specific files:
Look at @components/header.tsx and @app/globals.css — the header nav links
are not using the correct font weight. Fix them to match the h2 style.
Drag and drop files directly into the Claude Code chat window instead of describing them.
3.3 When to Start a New Conversation
Claude's performance degrades as a conversation gets very long — the context window fills up. (The next section, Staying in Control, shows how to watch and manage it.) Start fresh when:
- You're switching to a completely different part of the project
- Claude starts making mistakes it wasn't making before
- You've been in the same conversation for more than 2–3 hours
Before starting a new session, run:
Invoke the project-documenter subagent to update PROJECT_STATE.md with everything we did today.
Then start the new session with:
Read CLAUDE.md and PROJECT_STATE.md before we begin.
3.4 Keyboard Shortcuts
| Shortcut | Action |
|---|---|
Cmd/Ctrl + L | Open Claude Code quickly from VS Code |
Ctrl + C | Cancel a running command in the terminal |
| Drag file into chat | Add a file to the conversation |
Cmd/Ctrl + V | Paste a screenshot directly into Claude |
3.5 Voice Input with SuperWhisper
Speaking is ~3× faster than typing. SuperWhisper transcribes your voice to text with AI accuracy and pastes it into any app — including Claude.
- Download: superwhisper.com
- Press a hotkey → speak your prompt → it appears as text → paste into Claude
- Especially powerful for long, detailed prompts describing complex features
3.6 Continue from Your Phone: /remote-control
This is one of Claude Code's most underused features. It links your VS Code session to the Claude mobile app, so you can continue working on the same project — with the same context, plugins, and skills — from your phone.
When it's useful:
- You're away from your computer and think of a change
- You want to leave a long task running (refactor, Ralph Loop) without waiting at your desk
- You want to check the status of something Claude is processing
How to activate:
In your Claude Code session in VS Code:
/remote-control
Claude generates a code or QR. Scan or enter it in the Claude iOS/Android app. Your full session is now accessible from your phone.
Staying in Control: Context, Plans & Files
Building is only half the skill. The other half is staying in control of the session — knowing how full Claude's memory is, trimming it, undoing a wrong turn, and making Claude plan before it touches your code. These are the dashboard and the brakes. They're a handful of short commands, and they're what separate a smooth session from one that slows to a crawl or quietly runs up your bill.
A handful of controls keep your session fast, safe, and on course — here's the whole dashboard at a glance.
| Control | What it does | Think of it as… | Reach for it when… |
|---|---|---|---|
/context | Shows how full Claude's memory is | the fuel gauge | it feels slow or forgetful |
/compact | Summarizes the chat, frees space, keeps the gist | tidying a messy desk into neat notes | long chat, but you still need it |
/clear | Wipes the chat, starts fresh | a clean, empty desk | switching to a different task |
/rewind (Esc Esc) | Rolls code + chat back to a checkpoint | the undo button | Claude took a wrong turn |
/resume | Reopens a past session with its history | a bookmark in a book | coming back to a task later |
| Plan Mode (Shift+Tab) | Plans first, edits only after your OK | reading the map before you drive | the start of any big task |
1. Your fuel gauge — /context
The context window is Claude's short-term memory for this one session — everything it's currently "holding in its head." It's measured in tokens (roughly one token per word). Your messages, every file Claude reads, every command result, and your CLAUDE.md all take up space in it.
Type /context to see the breakdown — what's filling the window right now.
/context
Why it matters: as the window fills up, Claude gets slower and starts to drift — forgetting things you said earlier or repeating itself. People call this "context rot." Checking /context tells you when it's time to trim.
/context and trim early; it keeps answers fast and cheaper.2. Trim without starting over — /compact
When the window is getting full but you're mid-task, /compact summarizes the conversation so far into a tight recap and frees up space — without losing the thread.
/compact
Even better, you can tell it what to keep by adding instructions after the command:
/compact keep the database schema and the auth decisions we just made
3. Wipe the slate — /clear
When you switch to a completely unrelated task, don't drag the old conversation along. /clear empties the chat and starts fresh.
/clear
Don't worry — clearing is cheap. Claude re-reads your project files and your CLAUDE.md as it works, so it doesn't forget your project — only the back-and-forth of this one chat. For the "should I keep going or start fresh?" judgment call, see Part 3 → When to Start a New Conversation.
4. Undo a wrong turn — /rewind
Claude went down the wrong path and edited five files? You don't have to undo them by hand. Claude saves a checkpoint every time you send a prompt, and /rewind (or tapping Esc twice) opens a menu to roll your code and the conversation back to an earlier point.
/rewind
5. Pick up where you left off — /resume
Closed your laptop yesterday in the middle of something? /resume reopens a previous session with its history intact, so you continue instead of re-explaining.
/resume
A simple rhythm: /clear when you switch tasks, /resume when you come back to one.
6. Plan before Claude touches anything — Plan Mode
This is the single highest-leverage habit in this whole guide: make Claude plan first, act second. In Plan Mode, Claude reads your code, researches, asks clarifying questions, and proposes a step-by-step plan — but it makes no edits until you approve. You catch a wrong approach before a single line is written.
You switch modes by tapping Shift+Tab to cycle through them:
| Mode | What Claude does | Use it when… |
|---|---|---|
| Ask first (default) | Pauses for your OK before each change. | Your everyday default — you stay in the loop. |
| Auto-accept edits | Makes its edits without stopping to ask. | You've approved the plan and want speed on a clear task. |
| Plan mode | Only reads, researches, and proposes — no edits at all. | The start of any non-trivial task. |
Get in the habit of starting big requests in Plan Mode, reading the plan, and tweaking it before you say go. A minute of planning saves ten minutes of fixing.
7. Show Claude what you mean — files & images
You don't have to describe everything in words. Two moves make Claude far more accurate:
Point at a specific file with @. Type @ and start the filename — Claude reads exactly that file instead of guessing. Perfect for handing it your brand colors, a logo, or one component.
Use the colors and fonts in @brand-guidelines.md for the landing page header.
Paste a screenshot. Claude can see images. Paste a picture of an error message, a layout that looks broken, or a website you want yours to resemble — then ask for the fix. Showing beats describing.
[paste a screenshot] This is what I see when I click "Save." Find the bug and fix it.
Bonus: a live status bar — /statusline
Want your fuel gauge always visible? /statusline sets up a small bar at the bottom of Claude Code that can show your current model, context %, cost, and Git branch — so you don't have to keep running /context.
/statusline
The takeaway: check your fuel (/context), trim it (/compact, /clear), undo safely (/rewind), come back later (/resume), plan before you build, and show Claude with files and screenshots. For the full playbook on spending fewer tokens — and the trade-offs — see the next section, Saving Tokens.
Saving Tokens — Get More From Every Session
Tokens are the fuel Claude runs on — every word it reads and writes. You never have to count them, but a few habits make each session go much further (and cost less). The single biggest idea is the box below; everything after it is just acting on it. The built-in commands are the safe core — most you already met in Staying in Control.
Every message you send, Claude re-reads the entire conversation from the top. A long chat doesn't add cost — it multiplies it.
Picture a contractor who re-reads the whole project binder before every task. On page 2 that's instant; by page 200, even a tiny question costs a full read-through. Your chat history is that binder — the longer it gets, the more every new message costs. This is why most "I hit my limit!" moments aren't a plan problem; they're a tidiness problem.
And some of it reloads every single turn — invisible overhead you pay for on every message:
- your whole conversation so far
- your
CLAUDE.md - every connected MCP server's tool list
- every enabled skill
- every file Claude has already read
One mindset before the how-to: the goal isn't the fewest tokens — it's the most work per token. Sometimes the cheapest move is to spend a little more up front (plan first, give the right context) so you don't pay to redo a wrong build. Spend on clarity; save on clutter.
Part A — The easy wins (do these first)
All built-in, all official. Each links to where it's taught in full.
| Do this | Why it saves | Trade-off | When |
|---|---|---|---|
Start fresh — /clear (Control) | Drops the binder back to page 1 | Loses the thread — paste a 3-line summary if you're continuing | Switching to an unrelated task |
| Plan before you build — Plan Mode / Shift+Tab (Control) | A wrong build is the #1 waste — you pay to build and to redo | A little time up front | Any non-trivial task |
See where tokens go — /context + /usage | Makes the invisible visible (big CLAUDE.md? unused MCPs?) | None | Feels slow; start of a session |
Feed only what's needed — @-mention the file/function; paste the one relevant section | Claude stops reading the whole repo to find one thing | You need to know roughly where it lives | Always |
Keep CLAUDE.md lean (Part 2 · details below) | It loads in full on every message | Move detail into Skills/sub-folders (see below) | Review every few weeks |
| Right model for the job (Models) | Sonnet daily, Haiku simple, Opus hard | A cheaper model = weaker reasoning | Always |
| Trim skills & MCPs (Part 4 · Part 7) | Each enabled one loads every turn | Disable, don't uninstall | Periodic review |
Part B — Level-up moves (when the easy wins aren't enough)
| Move | Why it saves | Trade-off | When |
|---|---|---|---|
Compact on purpose — /compact with keep-instructions (Control) | The automatic compact only fires when you're near the limit — later and blunter | Compacting is lossy; after a few in a row, summarize → /clear → paste the summary | A long single task you must continue |
Back out of a wrong turn — /rewind (Esc Esc) (Control) | A failed attempt left in the chat keeps getting re-read forever | You lose the work after that point | Claude went down the wrong path |
Delegate big reads to a subagent — fresh context, returns a summary; pin model: haiku (Part 6) | Keeps your main chat clean | It spends its own tokens on top of yours — worth it for big reads, wasteful for tiny edits | Large research / exploration |
| Feed text, not formatting — convert big PDF/HTML/DOCX to Markdown first | Layout & metadata are noise the model still pays for | Skip it if you actually need the images/scans | Handing over large documents |
| Turn repeated work into a Skill (Part 4) | You stop re-explaining the same thing every session | A little setup up front | You've explained it 3 times |
Keep CLAUDE.md lean — the details
CLAUDE.md is loaded in full at the start of every session — it is never trimmed. So your standing-orders sheet gets re-read top to bottom before every message. Anthropic's docs warn it backfires twice: "longer files consume more context and reduce adherence." In plain terms: a bloated rules file costs more tokens and gets followed less carefully. Lean isn't tidiness — it's cheaper and more obedient.
- Target under ~200 lines. That's Anthropic's stated ceiling.
- Keep only the every-session essentials: build/test/run commands, code conventions, project layout, and "always do X / never do Y" rules.
- Be specific, not vague — specific rules get followed more reliably: ✅ "Run
npm testbefore committing" (not ❌ "test your changes"); ✅ "API handlers live insrc/api/handlers/" (not ❌ "keep files organized"). - Group with headers and bullets, and kill contradictions — if two rules clash, Claude picks one at random.
- Move the heavy stuff out — to where it loads on demand: a multi-step procedure, or something that only matters in one corner of the project, belongs in a Skill or a sub-folder
CLAUDE.md(those load only when relevant).
@import trick (e.g. @docs/notes.md) keeps your file tidy but does not save tokens — imported files still load at launch. For real savings, move detail into a Skill or a sub-folder CLAUDE.md, not an import.Copy-paste prompt — tune your CLAUDE.md to Anthropic best practice. Safe to run anytime; step 7 makes Claude propose changes and wait before saving:
Audit and improve my CLAUDE.md using Anthropic's own best practices.
1. Read my current CLAUDE.md (plus any CLAUDE.local.md and @-imported files).
2. Remember: CLAUDE.md loads IN FULL at the start of every session, so every
line costs tokens on every message — and Anthropic notes longer files also
get followed LESS reliably. Target: under ~200 lines.
3. Keep ONLY what Claude needs every session: build/test/run commands, code
conventions, project layout, and "always do X / never do Y" rules.
4. Rewrite vague rules as specific, testable ones. For example:
- "Use 2-space indentation" (not "format code properly")
- "Run npm test before committing" (not "test your changes")
- "API handlers live in src/api/handlers/" (not "keep files organized")
5. Group with markdown headers + bullets. Remove anything that contradicts
another rule.
6. For anything that's a multi-step procedure, or only matters in one part of
the project, DON'T leave it inline — move it to a Skill or a sub-folder
CLAUDE.md so it loads only when relevant. (Note: @-imports tidy the file but
do NOT save tokens, since imported files still load at launch.)
7. Show me a before/after line count and a plain-English list of what you
trimmed, rewrote, or moved out — and wait for my OK before saving anything.
Caching is the discount Claude gives you for not changing the past — and you forfeit it the moment you do.
The first time Claude reads something (its system prompt, your CLAUDE.md, the files so far), it's cached — re-reading cached text costs about a tenth as much. You keep that discount as long as the start of the conversation stays the same. Two things throw it away: switching the model mid-task (including the opusplan setting, which swaps Opus→Sonnet) and leaving the session idle too long so the cache expires (about an hour on a Claude subscription; ~5 minutes on the pay-per-token API). You set none of this up — just avoid needless mid-task model swaps.
Safe to know: editing CLAUDE.md mid-session won't break the cache — but it also won't take effect until your next /clear, /compact, or restart.
Part C — Trade-offs & when to use (the honest part)
| Move | Saves | Costs you | Best when |
|---|---|---|---|
| Aggressive compacting / short context | A lot | Lost detail, vaguer answers | Routine work — not deep debugging |
| Cheap model (Haiku) | A lot | Weaker hard reasoning | Simple, repetitive, high-volume |
| Subagents | A clean main chat | They spend their own tokens | Big reads — not tiny edits |
| Third-party "token saver" tools (community) | Can cut tokens sharply | Complexity; can be lossy or go stale; run code on your machine | Advanced users, trusted sources only |
About those third-party tools: the community has built token-savers like CodeGraph, RTK, caveman, and ponytail. They can cut usage sharply, but they add moving parts, can drop information (lossy), can fall out of sync with your code, and run code on your machine. Treat them as an advanced, optional layer — install only from sources you trust, and only once the built-in habits above aren't enough. [Unverified — these are community projects, not official Anthropic tools.]
You already have most of the tools. This chapter just points them at one goal — fewer tokens, better work. The commands live in Staying in Control, model choice in Choosing Your Model, lean memory in Part 2, skills in Part 4, and the crew in Part 6. For Anthropic's own list, see code.claude.com/docs/en/costs ("Reduce token usage").
Part 4: Plugins & Skills
A plugin is a box of ready-made add-ons. Skills, commands, subagents, and MCPs are what's inside — and you can build those yourself too.
Five names that get lumped together. Here's each one, and where it comes from:
| Thing | What it is | Where it comes from |
|---|---|---|
| Plugin | A ready-made bundle of the add-ons below, installed as one package. | From a marketplace — type /plugin (once per machine). |
| Skill | Packaged know-how that loads itself when it's relevant. | Inside a plugin, or build your own in .claude/skills/. |
Slash command /name | A saved prompt you re-run on demand. | Build your own in .claude/commands/, or inside a plugin. |
| Subagent | A separate Claude that goes off and does a job on its own. | Inside a plugin, or build your own in .claude/agents/. |
| MCP | A live connection to an outside tool or data source. | Connect per service, or inside a plugin. |
4.1 Plugins: Superpowers for Claude
A plugin is a shareable bundle of add-ons — most often one or more Skills (the know-how), and sometimes commands, subagents, or MCP setups. Installing one gives Claude pre-loaded expertise for a specific kind of work; it doesn't change the underlying model. (Skills on their own are covered in 4.3.)
How to install the official Anthropic plugin marketplace:
In Claude Code (inside VS Code), type:
/plugin
In the modal that appears, go to the Marketplaces tab and paste:
https://github.com/anthropics/claude-plugins-official
Click Add. You only do this once per machine.
Then go to the Plugins tab to see and activate individual plugins.
When Claude asks scope:
- "Install for you" — active in ALL your projects on this machine (recommended for the plugins below)
- "Install for this project" — active only in this repo
After installing, restart Claude Code (or restart VS Code) for plugins to load.
4.2 The 8 Essential Plugins
Install all of these for every project:
| Plugin | What it does |
|---|---|
security-guidance | Reviews your code for vulnerabilities: SQL injection, XSS, CSRF, exposed secrets |
frontend-design | Makes Claude expert at CSS, layouts, and UI components. Significantly improves visual quality |
feature-dev | Guides Claude to build features step-by-step: explore → design → implement → review |
code-review | Professional code review mode — use before every deploy or PR |
context7 | Lets Claude look up live, up-to-date documentation for libraries (Next.js, Prisma, Stripe, etc.) |
vercel | Expert on Vercel deploys, env vars, domains, edge functions, build debugging |
supabase | Deep knowledge of Supabase: schema, RLS, auth, edge functions, migrations |
playwright | Enables end-to-end tests and automated browser screenshots for UI verification |
Start with security-guidance and frontend-design. Add the rest as you need them.
4.3 Skills: Reusable Knowledge
A Skill is a playbook Claude pulls off the shelf the instant your topic comes up — write it once, and you never re-explain that thing again. The 3-Times Rule tells you when to make one: if you've explained the same thing to Claude three times — a convention, a brand rule, a way you like things done — that's a Skill. Package it once; never explain it again.
Under the hood, a Skill is a folder inside .claude/skills/ with a SKILL.md file. Claude loads it automatically when it applies to what you're working on — so you don't repeat the same context in every prompt.
Let Claude propose your Skills:
Analyze the MASTERPLAN and the code in this project and propose 3–5 Skills that would be useful for me. For each one, tell me:
- Name and short description
- What project knowledge gets repeated and needs to be packaged
- When Claude should activate it
Wait for my confirmation before creating any files. Once I confirm, create them in .claude/skills/ following the best practices at https://code.claude.com/docs/en/skills.
Claude will read your MASTERPLAN, scan the code, and propose concrete Skills for your specific project.
Where to find skills & plugins:
- Anthropic's official marketplace (from 4.1) — trusted and auto-updating.
- The community library
aitmpl.com— 1,000+ Skills, Hooks, Agents, and Plugins by category. Search before building from scratch. - Our Resources page (
/resources, "Tools We Love").
| Install | What you get |
|---|---|
security-guidance | Automatic security review of your code |
commit-commands | Safe Git, as ready-to-run commands |
pr-review-toolkit | PR-review agents (once your project's on GitHub) |
An output style — explanatory / learning | Claude explains as it works — ideal while you're learning |
Plus the 4.2 essentials (frontend-design, feature-dev, code-review); add for your stack as needed (a language server; integrations like GitHub/Vercel/Supabase).
4.4 Starter Skill: deploy-checklist
Activates before every production push. Prevents you from shipping broken code or leaked secrets.
Copy this prompt exactly to Claude:
Create this Skill in my project at .claude/skills/deploy-checklist/SKILL.md. Use this template as a base but ADAPT each step to the actual tools in my project (my framework, database, and hosting). Don't add steps that don't apply.
---
name: deploy-checklist
description: Mandatory checklist before pushing to production. Invoke whenever about to push to the main branch.
---
# Pre-Deploy Checklist
Before pushing to main, verify in this order:
1. The app build passes with no errors or warnings (use this project's build command).
2. No debug logs remain in production-bound code (console.log, print, etc.).
3. No hardcoded credentials in the code. Search for strings like `sk_`, `whsec_`, `pk_live`, `postgres://`, suspicious long tokens.
4. Any new environment variable in the local env file is also set in the hosting platform (Vercel, Railway, etc.).
5. If the database schema changed, the migration has been applied to the production DB.
6. The main user flow has been tested locally — the full path a real user would take.
If any check fails, DO NOT push — fix it first and report.
4.5 Starter Skill: stack-context
Tells Claude exactly what tech is in use so it never suggests libraries or patterns that don't fit your project.
Create this Skill in my project at .claude/skills/stack-context/SKILL.md. Adapt the stack to what's already in my project, but keep this structure:
---
name: stack-context
description: Project tech stack. Load before proposing new libraries, services, or patterns to avoid introducing foreign technology.
---
# Project Stack
- Framework: Next.js (App Router, Server Components by default)
- DB: PostgreSQL on Supabase, ORM: Prisma
- Auth: magic links (do NOT use Auth0, Clerk, or similar)
- Payments: Stripe Checkout, webhook at `/api/webhook`
- Transactional email: Resend
- Hosting: Vercel
- Styles: Tailwind CSS
# Rules
- Do NOT propose new libraries without asking the user first
- Server Components by default; use `use client` only when needed (events, hooks)
- Environment variables always read from `process.env` with documented fallbacks
4.6 Your Own Slash Commands
A slash command is a keyboard shortcut for a whole paragraph — a prompt you keep typing, saved under a short name you fire any time (/ship-check).
If you keep typing the same prompt, save it as a command. Drop a Markdown file into .claude/commands/ and its filename becomes the command — ship-check.md turns into /ship-check, and the file's contents are the prompt Claude runs.
Create .claude/commands/ship-check.md:
---
description: Pre-ship review of the current changes
---
Review the current git diff for bugs, missing error handling, and anything
I forgot. List findings as 🔴 blocker / 🟡 warning / 🟢 nice-to-have, each
with the file and line.
Now typing /ship-check runs that whole prompt. Pass in extra text with $ARGUMENTS:
Explain in plain language, to a non-coder, what the file $ARGUMENTS does.
…then /explain src/auth.ts drops src/auth.ts into $ARGUMENTS. Keep commands in .claude/commands/ to share them with your team (committed to Git), or in ~/.claude/commands/ to keep them personal across every project.
4.7 Keep Your Skills Lean (and Current)
Treat your skills like a toolbox. A few sharp tools you actually reach for beats a drawer crammed with stuff you never use — and Claude has to glance over every installed skill before each job, so clutter quietly slows it down and costs tokens.
Review every few weeks:
- Run
/contextto see what's loaded. /plugin → Installedshows a "Not used recently" group — pressdto disable a skill without uninstalling it.- Fold repeated corrections into
CLAUDE.mdinstead of leaving one-off skills lying around.
Keeping current:
- Plugins: the official marketplace auto-updates by default. To do it by hand, run
/plugin marketplace update <name>then/reload-plugins(toggle auto-update in/plugin → Marketplaces). - A skill you wrote: edit
.claude/skills/<name>/SKILL.md, then/reload-plugins.
Facts docs-verified. [Unverified]: the exact per-skill token cost, a precise "too many" threshold, and wrong-skill activation from overlapping descriptions.
Part 5: Hooks & Automation
5.1 What Hooks Are
Hooks are rules Claude executes automatically, every single time — no prompting required.
A hook is an automatic rule that fires every time — no asking, no forgetting.
Picture the difference between a sign on the wall and an automatic gate. Your CLAUDE.md is the sign — Claude reads it and usually follows it. A hook is the gate — it triggers on its own at a set moment (before a push, after a response), every single time, whether Claude "remembers" or not.
CLAUDE.md | Hook | |
|---|---|---|
| What it is | Written guidance | An automatic action |
| Claude… | should follow it | will run it — every time |
| Driven by | Claude's judgment | A fixed trigger (deterministic) |
| Best for | Conventions & preferences | Hard guarantees (e.g. never push to main unreviewed) |
Hooks fire at lifecycle events: before/after a tool call, before pushing code, after Claude responds, etc. They are deterministic, not AI-driven.
To see your active hooks:
/hooks
main" (5.2) or "never run a destructive command without asking" (5.4) — instead of hoping Claude remembers. They pair naturally with the permission rules in Part 10.5.2 Starter Hook: Pre-Push Review
Claude shows you a summary of every change before it goes to main, and asks for confirmation. You can never accidentally push to production.
Ask Claude to set it up:
I want a hook that activates every time you're about to push to the main branch. Before executing the push, show me in plain language which files changed and a summary of what each change does, then ask me to confirm with "yes" or "no" before continuing. If I say no, cancel the push. The goal is that nothing ever goes to production without me reviewing it first.
5.3 Starter Hook: Sound Notification
Claude plays a system sound when it finishes responding — so you know it's ready even if you've switched to another window.
I want a hook that plays a system sound every time you finish processing my message and are about to respond. Make it a short, pleasant sound. The idea is that if I switch tabs while waiting, I know immediately when you're done. Configure it for my operating system and leave it on by default for this project.
Claude detects your OS (macOS, Windows, Linux) and sets the appropriate sound automatically.
5.4 More Hook Ideas
Once you have the first two, you can add more by asking Claude in plain language. Most fall into three buckets:
Safety
- Block dangerous commands — Claude can't run
rm -rforgit push --forcewithout explicit permission. - Scan for secrets before any commit — block the commit if an API key or password is found.
- Stay off
main— block file edits while you're on the main branch. - Warn before touching
.envfiles — those hold your API keys. - Ask before installing — pause on any new package or dependency.
Quality
- Build or lint must pass before a push — cancel the push if it fails.
- Run tests after code changes — catch breakage early. (💸 only if you have tests — it adds time and tokens each run.)
- Auto-format on save — code stays clean without you asking.
Convenience
- Desktop popup when Claude needs your input — not just when it's finished.
- System notification when a long task finishes — visible even when Claude isn't the active window.
- Keep an audit log — append every command Claude runs to a log file.
CLAUDE.md asks nicely; a hook makes sure.Part 6: Subagents
A Skill is knowledge. A subagent is a worker.
- A Skill is a packaged set of instructions (sometimes with helper scripts) that loads into your current chat when it's relevant — like a playbook you pull off the shelf mid-task. Same Claude, same conversation, just better-informed.
- A subagent is a separate copy of Claude with its own fresh context and its own tool permissions. You hand it a job, it works in its own "room," then reports back — like a contractor you delegate a whole task to.
| Skill | Subagent | |
|---|---|---|
| What it is | Knowledge / instructions | A separate Claude that does work |
| Context | Loads into your current chat | Its own fresh context (can't see your chat unless you brief it) |
| Tools | Uses whatever you have | Can be restricted to specific tools |
| Many at once? | Yes — they stack | One per task (you can run several in parallel) |
| Best for | Giving Claude the right know-how | Big isolated jobs, parallel work, a clean main chat |
6.1 What Subagents Are
Subagents are separate Claude instances that run with their own context and their own tool set. You delegate a specific task to them — they investigate, do the work, and hand you back a summary — without polluting your main conversation with hundreds of lines of file content.
Use subagents when:
- A task requires reading many files across the codebase
- You want a specialist perspective (security auditor, documenter, etc.)
- You don't want the exploration work to eat your conversation context
Subagent files live in .claude/agents/.
How to Create a Subagent — in VS Code
Three ways, easiest first (the Claude Code prompt box is identical in VS Code or a terminal):
- The guided way —
/agents(recommended). Type/agentsin the Claude Code prompt box and create a new agent through guided questions — or just describe what you want and let Claude write it. Edit or remove agents the same way later. - Ask Claude in plain language. e.g. "Create a subagent at
.claude/agents/architect.mdthat plans features but never writes code — give it read-only tools." - Make the file yourself in VS Code's editor — a
.mdfile in.claude/agents/(this project) or~/.claude/agents/(every project), with aname, adescription(what Claude reads to know when to call it), itstools, and an optionalmodel:.
Claude auto-delegates based on each agent's description, or you can call one by name. Set model: per agent (haiku / sonnet / opus / fable or inherit) to control cost.
6.2 Subagent: security-reviewer
Audits your code for vulnerabilities without contaminating your main conversation.
Create it with this prompt:
Create this subagent in my project at .claude/agents/security-reviewer.md. Use the exact content below:
---
name: security-reviewer
description: Reviews code for security vulnerabilities
tools: Read, Grep, Glob, Bash
---
You are a senior security engineer. Review the code looking for:
- Injection vulnerabilities (SQL, XSS, CSRF)
- Authentication and authorization failures
- Hardcoded secrets or credentials in the code
- Insecure data handling (sensitive info in logs, missing sanitization)
Return a summary with severity (high / medium / low) and the exact line number of each finding.
To use it:
Use the security-reviewer subagent to review the authentication module (the /app/api/auth/ folder and /lib/auth.ts). I want a report with high/medium/low severity and exact line references.
6.3 Subagent: project-documenter
Maintains your project's memory between sessions. This is one of the highest-leverage tools in this entire guide.
Every time you open a new Claude conversation, Claude has zero memory of what happened before. This subagent maintains PROJECT_STATE.md — a running log of what's been built, what decisions were made, and what's next.
Create it:
Create this subagent in my project at .claude/agents/project-documenter.md. Use the exact content below:
---
name: project-documenter
description: Keeps PROJECT_STATE.md updated between sessions. Invoke before and after every large task.
tools: Read, Write, Edit, Glob, Grep
---
You are the project documentarian. You NEVER write feature code — you only document.
You are invoked in three cases:
1. Before a large task (>3 files or a new feature): write a clear TODO list of the steps.
2. After completing it: update PROJECT_STATE.md with what was done, what's pending, decisions made, and known issues.
3. When a non-obvious detail appears (workaround, gotcha, convention): add it.
Structure of PROJECT_STATE.md:
# Project State
**Last updated:** [date]
## What this project is
[1–2 paragraphs]
## Current status
- ✅ [completed]
- 🚧 [in progress — what's left]
- 📋 [planned — why it matters]
## Decisions made
- [decision] — [why, alternatives discarded]
## Gotchas / non-obvious things
- [detail that would surprise someone new]
## Immediate next steps
- [what to tackle next time]
Rules:
- English, concise, short bullets
- Do not duplicate information from the code (paths, function names)
- If a decision changes, UPDATE the line — don't add a new one
- If a feature completes, move from 🚧 to ✅ and remove the "what's left" detail
- If PROJECT_STATE.md exceeds 150 lines, compress old entries or archive them in docs/HISTORY.md
After creating the subagent, run this second prompt to wire it into your project:
Add these two rules to the end of my CLAUDE.md, in a section called "Session Rules":
- At the start of every session, read PROJECT_STATE.md for context
- Before and after large tasks, invoke the project-documenter subagent
First use:
Invoke the project-documenter subagent to create an initial PROJECT_STATE.md based on the current state of the project.
Every new session:
Read CLAUDE.md and PROJECT_STATE.md before we start.
If Claude forgets to update it:
Invoke the project-documenter subagent to update PROJECT_STATE.md with what we just did.
6.4 Which Do I Reach For?
Seven tools, seven jobs. Here's the whole toolkit in one glance (for what each one is, see Part 4):
| Reach for… | When you want to… | In a word |
|---|---|---|
CLAUDE.md | Set rules & context for the whole project | the rulebook |
| A Skill | Give Claude packaged know-how that loads when relevant | a playbook |
| A slash command | Re-run a prompt you keep typing | a keyboard shortcut |
| A subagent | Send a whole job off to a separate Claude | a contractor |
| A hook | Make something happen automatically, every time | an automatic gate |
| An MCP | Connect Claude to an outside tool or service | a plug |
| A plugin | Install a ready-made bundle of the above | a toolbox |
6.5 Agent Teams (experimental)
A subagent is one contractor you send off alone. An agent team is a whole crew with a foreman — they share a task list and hand work back and forth.
Subagents work alone and report back to you. Agent Teams go a step further: several Claude sessions work together — they share one task list and can message each other, with a lead agent coordinating. Reach for a team when the steps depend on each other and the agents need to hand work back and forth, not just run in isolation.
It's an experimental feature, off by default. Turn it on in your settings, then ask Claude to "create an agent team" for the job:
{
"env": { "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1" }
}
Choosing Your Model — as you scale
Claude comes in several models. Early on you don't need to think about this — Claude Code ships with a strong default and you just build. But as your projects grow, picking the right model for each task becomes the biggest single lever on speed and cost. The rule is short: use the most capable model for the hard thinking, and send the simple, high-volume work to a cheaper, faster one.
Two places you pick a model
- Inside Claude Code. Your main session runs a model (switch it with the model picker,
/model), and every subagent names its own. You already saw this in Part 6: Subagents — a security reviewer can declaremodel: opusright in its file. - In AI features you build. When your own app calls the Claude API, you pass a model ID (like
claude-opus-4-8) on every request. That is billed per token, separate from your Claude Code subscription — so here, model choice is a real cost decision.
Picking a model is like staffing a team — match the person to the job.
You don't put your priciest senior on every small task, and you don't hand the hardest problem to a junior.
- Opus 4.8 — your senior expert. The hard thinking: architecture, tricky bugs, anything that must be right. (Your default.)
- Sonnet 4.6 — your dependable all-rounder. The daily workhorse for steady, high-volume building.
- Haiku 4.5 — your fast junior. Simple, repetitive, high-volume jobs.
- Fable 5 — the premium specialist for the most demanding, long-running jobs. Not an everyday hire.
The rule is just good management: build with your best, then hand routine work down to stay fast and cheap.
The lineup
| Model | Reach for it when… | Relative cost |
|---|---|---|
Opus 4.8 — the defaultclaude-opus-4-8 | The hard stuff: architecture, agents, multi-step reasoning, tricky debugging. Start here. | ●●● |
Sonnet 4.6claude-sonnet-4-6 | The best balance of speed and intelligence — ideal for high-volume production work. | ●● |
Haiku 4.5claude-haiku-4-5 | Simple, fast, high-volume jobs: classify, label, extract, quick lookups. | ● |
Fable 5claude-fable-5 | The most demanding, long-running agentic work. Premium — not an everyday default. | ●●●● |
The scaling rule
- Build with the most capable model first (Opus). Get it working — don't optimize cost before the thing works at all.
- Then route the easy, repetitive parts down. Once a task is well-defined and runs at volume — tagging records, sorting messages, short replies — move it to Sonnet or Haiku.
- Keep Opus (and Fable) for the hard parts — the planning, the architecture, the gnarly bug. The goal is "right model per task," not one model for everything.
model: opus; let a fast explorer subagent that only reads files run on a cheaper model. In API code, default to claude-opus-4-8 and drop specific high-volume endpoints to claude-sonnet-4-6 or claude-haiku-4-5 once they're proven.Need more thinking power? ultrathink
Sometimes the model is capable enough, but the problem is hard — a subtle bug, a thorny architecture decision. You can ask Claude to reason harder before it answers: just include the word ultrathink anywhere in your prompt, and it spends extra effort thinking on that turn.
There's a race condition somewhere in the checkout flow. ultrathink about what could cause it before you change any code.
It's a one-off nudge for a single message, not a setting. (Only ultrathink is a real keyword — phrases like "think hard" or "think harder" aren't special.)
ultrathink for the genuinely hard problems; sprinkling it on every prompt just burns tokens (and your usage limit) for no real gain.Part 7: MCPs
An MCP is a plug. It connects Claude to an outside tool so it can actually use it — not just talk about it.
A Skill gives Claude know-how. An MCP gives Claude a connection — to your database, your GitHub, a live browser, your CRM. Think of it as handing your contractor the keys and tools to the real building instead of just a manual.
7.1 What MCPs Are
MCP = Model Context Protocol. Think of an MCP as a live connection that gives Claude direct access to an external service.
Without an MCP, Claude can only write code that talks to Stripe — it can't actually reach into your Stripe account. With an MCP installed, Claude acts directly on the service: creates products in Stripe, deploys to Vercel, queries your database, opens a PR on GitHub.
MCP vs API vs CLI vs Webhook — four ways software talks to software. The trick is who starts the conversation.
| Thing | What it is | Who starts it | Like… |
|---|---|---|---|
| API | A service's set of things other programs can ask it to do | your code asks the service | a menu + waiter — you order, the kitchen makes it |
| CLI | Typed commands you run to control a tool | you, by hand | the cockpit — you fly it yourself |
| MCP | A standard "plug" that lets Claude use a tool or data directly | Claude | a universal adapter — the tool in Claude's hands |
| Webhook | The service messages you automatically when something happens | the service | a doorbell — "don't call us, we'll call you" |
They team up: an MCP usually wraps an API so Claude can use it; a CLI is you driving that same tool by hand; a webhook is the only one that reaches out to you first.
7.2 How to Install Any MCP
You never need to figure out the install command. Just ask Claude:
Install the MCP for [service] in Claude Code and get it ready to use. If it needs an API key or authentication, explain step by step where to get it and where to put it.
Replace [service] with the name (Stripe, GitHub, Vercel, Supabase, etc.).
To see your active MCPs:
claude mcp list
To get details on one:
claude mcp get github
To remove one:
claude mcp remove github
Find more MCPs at: aitmpl.com/mcps — filtered by category (databases, APIs, productivity, etc.)
⚠️ Don't install too many MCPs at once. Each one loads context at session start and can slow things down. Install what you need, when you need it — same principle as keeping your skills lean (4.7).
7.3 The Essential MCPs
Ordered by how often you'll use them during development:
1. GitHub — Most Universal
Claude creates issues, opens PRs, reads comments, merges branches, all from the conversation.
Install the GitHub MCP in Claude Code and connect it to my account. Explain what permissions it needs and how to authorize access.
2. Vercel — Deploy Control
Once installed, Claude can deploy, view live logs, check build status, and manage environment variables without you opening the dashboard.
Install the Vercel MCP in Claude Code and authorize it against my account. When done, verify it works by telling me the status of my project's last deploy.
3. Supabase — Direct Database Access
Claude can query tables, run migrations, check rows, and debug issues without you opening the Supabase dashboard.
Install the Supabase MCP in Claude Code connected to my project. Tell me exactly where to find my project URL and service role key, and where to put those values. When ready, list my tables.
4. Stripe — Payment Operations
Claude creates products, views charges, manages subscriptions, processes refunds — all through conversation.
Install the Stripe MCP in Claude Code. It will open an authentication flow with my Stripe account — guide me step by step. When done, list my active products.
5. Resend — Send Test Emails
Claude sends emails directly without you writing a curl command. Useful for testing transactional email templates.
Install the Resend MCP in Claude Code and connect it with my RESEND_API_KEY (it's in .env.local). When done, send me a test email to [your@email.com] with subject "MCP working".
6. Playwright — Claude Sees Your App
Claude opens a real browser, navigates your site, clicks buttons, fills forms, and takes screenshots — all autonomously.
Install the Playwright MCP in Claude Code. When done, open my site at localhost:3000 and take a screenshot of the hero section to confirm it's working.
7. Firebase — Hosting & More (Google)
If your project runs on Firebase (like aicontodo.com does), the official Firebase MCP lets Claude manage Hosting, check deploy status, and work with Firebase services without leaving the chat.
Install the official Firebase MCP (firebase@claude-plugins-official) in Claude Code and connect it to my Firebase project. When done, tell me my Hosting site's current deploy status.
7.4 Two More Worth Adding
Once you're comfortable, two more MCPs pull a lot of weight:
Context7 — current, correct docs
Claude's training has a cutoff date, so for fast-moving libraries it can suggest an old or removed function. Context7 fetches the current, version-specific documentation for what you're using, on demand — far fewer "that doesn't exist anymore" moments.
Install the Context7 MCP in Claude Code so it can pull up-to-date documentation for the libraries in my project.
Chrome DevTools — Claude inspects a real browser
Like Playwright, but deeper: Claude can open Chrome and read the console errors, network requests, and performance — so it debugs a live page the way you would with the browser's developer tools open.
Install the Chrome DevTools MCP in Claude Code, then open my site, check the console for errors, and tell me what's failing.
Part 8: Deploying
Where does your app go live? Deploying just means putting your app on the internet. Pick a host like you'd pick where to open a shop.
| Host | Best for | You deploy with | Claude's helper |
|---|---|---|---|
| Vercel | Frontend apps (Next.js/React), instant previews | vercel CLI or Git auto-deploy | official vercel plugin |
| Firebase Hosting | Static sites & single-page apps (Google) | firebase deploy or a GitHub Action | official firebase plugin |
| Supabase | Not a site host — your database & backend functions | supabase CLI | official supabase plugin |
| Google Cloud | Big, advanced setups — usually overkill | gcloud CLI | no official plugin yet |
Vercel and Firebase are ready-made storefronts — move in and you're live. Supabase is the stockroom (it powers the shop, it isn't the shop). Google Cloud is leasing space in a giant industrial park — powerful, but a lot to manage.
8.1 If You're on Vercel
Vercel's web dashboard is good, but the CLI is faster. Set it up by asking Claude directly — don't go command by command:
Set up the Vercel CLI for this project, step by step:
1. Check if I have Node.js installed. If not, tell me how and stop.
2. Install the Vercel CLI globally with npm.
3. Run `vercel login` and guide me through authentication (it will open a browser).
4. Run `vercel link` and guide me to connect this local project to its Vercel project.
5. At the end, run `vercel --version` and `vercel env ls` to confirm everything works and that I have project variables available.
If You're on Firebase
Firebase Hosting is great for static sites and single-page apps — it's what aicontodo.com itself runs on. Three commands:
firebase login # sign in (opens a browser)
firebase init hosting # one-time: pick your project + the folder to deploy
firebase deploy # push your site live
8.2 The 4 Vercel Commands You'll Use Every Day
vercel env pull — Downloads your Vercel environment variables to your local .env.local. Run this whenever you add a new key to the Vercel dashboard.
vercel env pull .env.local
vercel env add — Adds a new environment variable from the terminal (no dashboard needed).
vercel env add STRIPE_SECRET_KEY production
vercel logs — Live logs from your deployed app. Essential for debugging production errors.
vercel logs
vercel deploy — Deploy to production directly, bypassing GitHub. Use for a quick preview before committing.
vercel deploy --prod
The golden workflow for env variables:
- Add a key in Vercel dashboard
- Run
vercel env pull .env.locallocally - You now have it in both places — no manual copy-paste, ever
8.3 Pre-Deploy Checklist
Before every push to main, Claude should run through this (see Part 4 for the deploy-checklist Skill that automates it):
8.4 Other CLIs Worth Knowing
The same "manage from the terminal" logic applies to other services:
| Service | Install |
|---|---|
| Supabase | npm install -g supabase — manage DB locally, apply migrations, generate TypeScript types |
| Stripe | brew install stripe/stripe-cli/stripe (Mac) — test webhooks locally, simulate events |
| GitHub | brew install gh — manage repos, PRs, issues from the terminal |
Rule: If a service takes you more than 3 repetitive clicks per day, look for its CLI. If you don't know the commands, ask Claude — it knows the documentation for all of them.
Part 9: Payments with Stripe
9.1 The 3 Things You Need from the Dashboard
Stripe's 3 keys — which to hide, which to show.
Stripe gives you three keys. The whole game is knowing which one is safe to show and which one moves money.
| Key | What it does | Safe to show? | Like… |
|---|---|---|---|
Publishable pk_… | Opens the checkout form | ✅ Yes — lives in the frontend | your storefront sign — meant to be seen |
Secret sk_… | Creates charges, moves money | ❌ Never — backend / .env only | the key to the cash register — if it leaks, rotate it immediately |
Webhook secret whsec_… | Confirms a payment alert really came from Stripe | ❌ Keep private | a secret handshake — proves the message isn't an impostor |
Mnemonic: pk = public, sk = secret — it's right there in the name.
You never need to write Stripe code yourself. Claude writes it. But you do need to get 3 values from the Stripe dashboard and put them in the right places.
Where to find them: Stripe Dashboard → Developers → API keys
1. Publishable key (pk_test_... or pk_live_...)
- Goes in your frontend code (safe for users to see)
- Opens the Stripe checkout form
2. Secret key (sk_test_... or sk_live_...)
- Goes only in your backend / environment variables — NEVER in the frontend
- Creates payment sessions, processes charges
- If this leaks: rotate it immediately from the dashboard
3. Webhook secret (whsec_...)
- Verifies that payment notifications actually came from Stripe
- Create it: Stripe Dashboard → Developers → Webhooks → Add endpoint
- Endpoint URL:
https://your-app.vercel.app/api/webhook - Listen to:
checkout.session.completed(minimum) - Copy the Signing secret Stripe shows you
9.2 Environment Variable Naming
In your .env.local (and mirrored in Vercel dashboard):
STRIPE_PUBLISHABLE_KEY=pk_test_xxxxx
STRIPE_SECRET_KEY=sk_test_xxxxx
STRIPE_WEBHOOK_SECRET=whsec_xxxxx
9.3 The One-Prompt Stripe Implementation
Once keys are in .env.local, give Claude this prompt:
Implement the full Stripe checkout flow in this Next.js app:
- An API route that creates a payment session
- A button on the frontend that triggers it
- A webhook that updates the database when payment is confirmed
The keys are already in .env.local.
Claude builds all of it in a few minutes. Your job is to understand what you're asking for and where the keys go.
9.4 Test Mode Rules
- Always develop in test mode first. Test mode keys start with
pk_test_andsk_test_. No real money moves. - Test card:
4242 4242 4242 4242— any future expiry, any CVC - Switch to live mode when you're ready to charge real money. Replace test keys with
pk_live_andsk_live_keys from the Stripe dashboard.
Part 10: Security Rules
These are non-negotiable. Violating them can expose customer data or result in financial loss.
10.1 The Hardcoded Secrets Rule
Never, under any circumstances, paste an API key directly into code.
All secrets belong in environment variables:
- Local dev:
.env.local(never committed to GitHub) - Production: Vercel dashboard → Environment Variables
If a secret is ever committed to GitHub: rotate it immediately from the service's dashboard.
10.2 What Goes Where
| Value | .env.local | Vercel Dashboard | In code |
|---|---|---|---|
| Stripe secret key | ✅ | ✅ | ❌ Never |
| Stripe publishable key | ✅ | ✅ | ✅ Frontend only |
| Supabase service role key | ✅ | ✅ | ❌ Never |
| Supabase public anon key | ✅ | ✅ | ✅ Frontend only |
| Webhook secrets | ✅ | ✅ | ❌ Never |
| Database URLs | ✅ | ✅ | ❌ Never |
10.3 Control What Claude Can Do — Permissions
Permissions = house rules for Claude.
Secrets are about what's in your code. Permissions are about what Claude is allowed to do — like the house rules you'd give a contractor working in your home.
| List | Means | Like telling a contractor… | Example |
|---|---|---|---|
allow | Do it, no need to ask | "paint the rooms we agreed on — go ahead" | Bash(npm run build) |
ask | Check with me first | "knock before you knock down a wall" | Bash(git push *) |
deny | Never — off-limits, period | "the safe and the master bedroom are off-limits" | Bash(rm *), Read(./.env) |
deny beats ask beats allow — your off-limits list always wins.
Secrets are about what lives in your code. Permissions are about what Claude is allowed to do on your computer — which commands it can run and which files it can touch. Claude Code is safe by default: it pauses and asks before anything that could change your system. You decide how much it asks.
How much it asks (modes). You met these in Staying in Control → Plan Mode: tap Shift+Tab to cycle between ask-first (the default), auto-accept edits, and plan (read-only). There's also a bypass mode that asks for nothing — see the warning below.
Decide in advance (rules). Instead of approving the same things over and over, set standing rules in three lists:
allow— runs without asking (e.g.Bash(npm run build), or reading your own source files).ask— always confirm first (e.g.Bash(git push *)).deny— never allowed, period (e.g.Bash(rm *), orRead(./.env)to keep Claude away from your secrets).
The golden rule: deny beats ask beats allow. So you can allow things broadly but carve out hard "never" zones that always win.
Open the rules panel — it lists every rule and which file it came from — with:
/permissions
The rules are stored as plain JSON in your settings file — a small example:
{
"permissions": {
"allow": ["Bash(npm run build)", "Read(./src/**)"],
"ask": ["Bash(git push *)"],
"deny": ["Bash(rm *)", "Read(./.env)"]
}
}
Those settings live in three places, broad to specific:
~/.claude/settings.json— your defaults across every project..claude/settings.json— project rules shared with your team (committed to Git)..claude/settings.local.json— your personal rules for this project (Git-ignored).
deny rules and a few hard circuit breakers, but that's a thin net.) Keep it for throwaway, sandboxed projects. For everyday speed, use the safer recipe below.Recipe: fewer prompts, but still stop on the big stuff
If approving every little edit is slowing you down, here's how to cut the routine prompts without letting Claude run wild — so it stops nagging about safe edits but still pauses for anything that matters:
- Switch to
acceptEditsmode — tapShift+Tabonce. Claude now applies file edits and safe file commands without asking, but still stops to ask before running other shell commands, making network requests, or touching protected files like.git. - Put your "never" commands in
deny(e.g.Bash(git push *),Bash(rm -rf *)). Deny rules always win — they hold even in the most permissive modes — so this is your safety net. - Start big tasks in Plan Mode: Claude lays out a plan and waits for your approval before acting. That's how you make it stop and check with you on the decisions that actually matter.
The blunt version (sandbox only): claude --dangerously-skip-permissions (also written --permission-mode bypassPermissions) skips routine prompts entirely. Even then it still honors your ask and deny rules, still hard-stops on dangerous deletions like rm -rf /, and still asks a clarifying question when one is truly needed — but it strips away nearly all the other guardrails, so only run it in a throwaway container or VM where nothing important can be lost.
The full rule syntax and the complete list of modes are on the official docs: code.claude.com/docs/en/permission-modes.
10.4 The Security Audit Prompt
Run this before every major release using the security-guidance plugin:
Run a full security audit on this project. Check for:
1. Hardcoded secrets or API keys anywhere in the code
2. SQL injection vulnerabilities
3. XSS and CSRF exposure
4. Authentication bypass risks
5. Sensitive data being logged
Give me a report with severity (high / medium / low) and exact file + line number for each finding.
10.5 Pre-Launch Security Checklist
Part 11: Ralph Loop
11.1 What It Is
Ralph Loop is a robot vacuum for a task.
It sets Claude to work the same task over and over, on its own, until it's done — like letting a robot vacuum run while you do something else. Two dials keep it safe:
| Dial | What it does | Like… |
|---|---|---|
--completion-promise "DONE" | The exact word Claude must say to stop (must match letter-for-letter) | the "all clean" signal — it parks itself only when the job's truly done |
--max-iterations N | A hard cap on how many rounds, no matter what | the timer — so it can't run all day and drain the battery |
No stop-word or no timer = it can loop forever and burn tokens while you're away. Always set both.
Ralph Loop is a plugin that makes Claude repeat a prompt iteratively until a task is complete. You define the task, set a completion signal, and let it run — while you do something else.
Philosophy: Iteration > Perfection. Don't aim for perfect on the first try. Let Ralph refine incrementally.
Install it from the plugin marketplace (/plugin) if you haven't already.
--max-iterations, give it an unambiguous --completion-promise so it actually stops, and check your usage before you let it run unattended.11.2 The Two Required Parameters
--completion-promise "WORD"
The exact string Claude must output to stop the loop. It's a literal text match — not semantic. If you set "DONE" and Claude writes "Done!", the loop does NOT stop.
Use clear, unambiguous strings: "DONE", "COMPLETE", "FIXED", "VERIFIED", "READY_FOR_REVIEW"
--max-iterations N
The hard cap on how many cycles run before the loop stops regardless of completion. This is your safety net against infinite loops.
Guidance:
5–10— short, well-scoped tasks15–30— complete features or medium refactors50+— overnight runs where you're away
Rule: If the loop hits max iterations before completion, your prompt or success criteria weren't clear enough. Fix the prompt, don't just raise the number.
11.3 Basic Usage
/ralph-loop:ralph-loop "Your prompt here" --completion-promise "DONE" --max-iterations 10
Stop a running loop:
/ralph-loop:cancel-ralph
11.4 Ready-to-Use Templates
Build a feature:
/ralph-loop:ralph-loop "Implement [FEATURE].
Requirements: [list them]
Success: All requirements met, no linter errors, tests passing.
Output COMPLETE when done." --max-iterations 30 --completion-promise "COMPLETE"
Fix a bug:
/ralph-loop:ralph-loop "Fix this bug: [DESCRIPTION].
Steps: Reproduce → identify root cause → fix → write regression test → verify.
Output FIXED when done." --max-iterations 20 --completion-promise "FIXED"
Verify with Playwright (when you don't have written tests):
/ralph-loop:ralph-loop "Implement [FEATURE].
Verification: Use the Playwright MCP to open the app at localhost:3000, run the user flow manually, and confirm it works as expected (fill the form, click buttons, wait for result).
If something fails, read the browser console error, fix the code, and verify again.
Output VERIFIED when done." --max-iterations 30 --completion-promise "VERIFIED"
More examples — adapt these to your project
⚠️ These are examples, not magic spells. Adapt each to your own project and tools. Every loop needs a clear stop-word and a max-iterations cap, and check your token usage before leaving one running unattended. (Plugin commands change over time — confirm the current Ralph Loop command and flags on the plugin's page.)
1. Bilingual completeness — make sure every page has both languages:
/ralph-loop:ralph-loop "Check every page. Every visible piece of text must have both an English and a Spanish version. Add accurate translations where one is missing. Output BILINGUAL_DONE when no text is left untranslated." --completion-promise "BILINGUAL_DONE" --max-iterations 15
2. SEO pass — every page gets the basics:
/ralph-loop:ralph-loop "For each page, make sure it has a meta description, social-share (Open Graph) tags, a clean title, and one structured-data block — matching that page's real content. Add what's missing. Output SEO_COMPLETE when every page passes." --completion-promise "SEO_COMPLETE" --max-iterations 20
3. Fix until clean — no console errors, no broken links:
/ralph-loop:ralph-loop "Load each page and check for JavaScript console errors and broken internal links. Fix what you find. Output CLEAN when every page loads with zero console errors and no broken links." --completion-promise "CLEAN" --max-iterations 15
4. Brand-voice polish — consistent, accurate copy:
/ralph-loop:ralph-loop "Review each page's copy. Make it match our brand voice (clear, friendly, no hype) and confirm every claim is accurate — fix page by page. Output POLISHED when all pages pass." --completion-promise "POLISHED" --max-iterations 16
Notice the pattern: a clear "go through everything until each item passes" task + an unmistakable stop-word + a cap. That's the sweet spot for a loop.
11.5 When to Use (and Not Use) Ralph Loop
Good for:
- Well-defined tasks with measurable success (build this form, fix this bug)
- New project development you can leave running overnight
- Tasks with automatic verification (tests, linters, Playwright)
- Iterative refinement of something that's mostly working
Not for:
- Tasks that require your judgment or approval at multiple steps
- Vague or subjective goals ("make it better")
- Debugging production issues
- Anything involving real financial transactions or data deletion
11.6 Built-in Loops: /goal and /loop
Ralph Loop is a plugin. Claude Code also has two built-in ways to keep working on their own.
/goal — work until a finish line is met
Give Claude a checkable finish line and it keeps going, turn after turn, until that condition is true. After each turn a lightweight checker (a fast model) decides whether the goal is met — so the finish line has to be something it can actually verify.
/goal Every image in /public is under 200 KB and the build passes with no errors.
A vague goal ("make it good") can never be verified, so the loop never ends — be specific, and add a limit like "stop after 20 turns."
/loop — repeat on a schedule
Runs a prompt again and again on an interval (or lets Claude pace itself) — handy for checking on something periodically while you work.
/loop every 5 minutes, check if the deploy finished and tell me the moment it does
Recurring loops expire automatically after 7 days.
Part 12: Compliance & Legal
12.1 The 3 Required Legal Pages
The paperwork to open your doors.
Like a shop posts a few notices before it opens, a site that collects data or takes payments needs these before launch:
| Page / item | In plain words |
|---|---|
Privacy Policy (/privacy) | what you do with people's information |
Terms & Conditions (/terms) | the rules for using your service |
Legal Notice (/legal) | who you are (your business details) |
| Cookie banner | the "we use cookies" notice at the door |
Every product that collects user data or processes payments needs these three pages before launch. Create them before your cookie banner — the banner links to them.
| Page | Route | What it covers |
|---|---|---|
| Privacy Policy | /privacy | What data you collect and how you use it |
| Terms & Conditions | /terms | Rules of using your service |
| Legal Notice | /legal | Your business information |
Generate all three in one prompt:
Create the 3 legal pages for my project: Privacy Policy, Terms & Conditions, and Legal Notice. Each as its own route (/privacy, /terms, /legal).
You already know the MASTERPLAN and what data the app collects. These are the values you should NOT guess:
- Country where my business operates: [your country]
- Business name and contact email: [your name/company, contact@yourdomain.com]
If there's an important third-party service not already in the code (analytics, email, hosting), ask me before inventing it.
Write in plain, accessible English — not heavy legal jargon. Each page should link to the other two in the footer.
Disclaimer: Claude's draft is a solid starting point, but have a human review it before you rely on it — and a lawyer for anything sensitive (health data, kids' data, or operating across multiple countries).
12.2 Cookie Banner
All websites must inform users about cookies. Create the legal pages first, then the banner.
Create a cookie banner component for my site that:
- Appears the first time a user visits
- Allows accepting all cookies, rejecting all, or customizing (analytics, marketing)
- Saves the preference so it doesn't show again
- Complies with basic GDPR (explicit consent, reject button as prominent as accept)
- Links to /privacy and /cookies (also create /cookies if it doesn't exist)
- Matches the visual style of the rest of the site
12.3 Auth Patterns
Magic link = a one-time pass emailed to you (no password to remember). Password = your own key you keep.
Depending on your use case, implement one of these:
- Magic Link — User enters email → receives a link → clicks to log in. No password to remember. Best for B2B or low-friction products.
- Password — User enters email + password. More familiar for consumers.
Ask Claude which fits your MASTERPLAN and to implement it fully.
Appendix
A. Glossary
The full glossary now lives up front so it is easy to reach any time: see Glossary — Words to Know (second item in the sidebar). It defines every term in this guide — grouped by topic and written in plain English.
B. Common Errors & Fixes
| Error | Cause | Fix |
|---|---|---|
command not found: claude | Claude Code CLI not in PATH | Close and reopen terminal; reinstall if needed |
EACCES permission denied (Mac) | Missing admin permissions | Add sudo before the command |
git not recognized (Windows) | Git not added to PATH | Reinstall from git-scm.com, check "Add to PATH" |
node not recognized | Node.js not in PATH | Reinstall from nodejs.org, check "Add to PATH", restart computer |
| Claude response gets worse over time | Context window filling up | Start a new conversation; run project-documenter first |
| Build fails after plugin install | Plugins not loaded yet | Restart VS Code completely |
vercel env pull returns empty | Project not linked | Run vercel link first |
| Stripe webhook fails | Wrong endpoint URL or missing event type | Verify URL in Stripe dashboard includes /api/webhook; ensure checkout.session.completed is selected |
Permission denied (publickey) on git push | SSH key not configured | Use HTTPS instead: git remote set-url origin https://github.com/user/repo.git |
C. Cost & Token Management
- Claude Pro: Fine for getting started, but you'll hit usage limits on intensive build days.
- Claude Max (5×): Recommended for active development — enough capacity for full-day work sessions.
- Claude Max (20×): For daily power users who run long sessions and many agents.
Plans, tiers, and prices change — always check the current options at claude.com/pricing. Claude Code runs on your Claude subscription (not billed per token like the API). When you start building AI features that call the API directly, see Choosing Your Model for picking the right model per task.
To reduce token waste:
- Start new conversations when switching to a different part of the project
- Use
@filenamereferences instead of pasting large files - Use the
project-documentersubagent to maintain PROJECT_STATE.md so you don't have to re-explain context - Subagents isolate expensive file exploration from your main context
D. Resource Directory
| Resource | URL | What it is |
|---|---|---|
| Anthropic Docs | docs.claude.com | Official Claude Code documentation |
| Best Practices | code.claude.com/docs/en/best-practices | Official CLAUDE.md and workflow best practices |
| Skills Docs | code.claude.com/docs/en/skills | Official Skill creation guide |
| Plugin Marketplace | github.com/anthropics/claude-plugins-official | Official plugins |
| Community Library | aitmpl.com | 1,000+ community Skills, Hooks, Agents, MCPs, Plugins |
| MCP Registry | aitmpl.com/mcps | Browse and install MCPs by category |
| Ralph Loop | claude.com/plugins/ralph-loop | Official iterative-loop plugin (ships in anthropics/claude-code as ralph-wiggum) |
| SuperWhisper | superwhisper.com | Voice-to-text for prompts |
| Vercel | vercel.com | Hosting and deployment |
| Supabase | supabase.com | Database and authentication |
| Stripe | stripe.com | Payments |
| Resend | resend.com | Transactional email |
Part 13: Standard Agent Roster — Best Practices for Every Project
Building solo, you do every job yourself. The pro move is a small crew of specialists — each with one job and the right tools, so no one grades their own homework.
| Agent | Think of it as… | Bring it in when… | Can it change files? |
|---|---|---|---|
| Architect | the architect with the blueprint | you're starting anything new or making a big technical call | ❌ Plans only |
| Builder | the construction crew | there's an approved plan to actually build | ✅ Yes |
| Code reviewer | a second set of eyes / your editor | the builder's done, before anything is pushed | ❌ Reports only |
| QA tester | the building inspector | you need to prove it works, not just that it looks done | ✅ Tests only |
| Debugger | the detective | something's broken and you don't know why | ❌ Finds the cause, hands the fix to the builder |
| Security auditor | the security guard | you're touching logins, payments, or user data — or about to launch | ❌ Reports only |
| Documenter | the scribe with the logbook | before & after any big task, so the next session remembers | ✅ Docs only |
Subagents are separate Claude instances with their own instructions and allowed tools. They keep your main conversation clean, prevent one agent from doing a job it shouldn't do (e.g., a builder reviewing its own code), and make it easy to call a specialist on demand.
These 7 agents should exist in every project. They live in .claude/agents/ and are project-scoped — you need to install them in each new repo.
13.1 The Core 7
| Agent | Can write? | Role | Does NOT do |
|---|---|---|---|
architect | ❌ | Plans features — reviews MASTERPLAN, proposes file structure, flags risks | Write production code |
builder | ✅ | Implements features step by step | Deploy, review its own code |
code-reviewer | ❌ | Reviews changes before merge — bugs, anti-patterns, style | Edit code directly |
qa-tester | ✅ tests | Writes and runs tests, verifies user flows | Write features |
debugger | ❌ | Investigates failures and finds the root cause — reproduces the bug, traces it, explains why | Fix the code (hands the diagnosis to the builder) |
security-auditor | ❌ | Hunts for vulnerabilities and exposed secrets | Fix issues (reports only) |
project-documenter | ✅ docs | Keeps PROJECT_STATE.md current between sessions | Write feature code |
Read the "Can write?" column. Planners, reviewers, the debugger, and the security auditor are deliberately read-only; only the builder, QA, and documenter can change files. That's a safety control, not just tidiness: a reviewer that can edit will quietly "fix" the very bug it should flag, and a read-only auditor has a far smaller blast radius if it's ever fed something malicious. The separation is the point — if one agent builds and reviews its own work, the review is worthless.
13.2 The One-Shot Deploy Prompt
Paste this into Claude Code at the start of any new project. It creates all 7 agents in one shot.
Create the following 7 subagents in .claude/agents/. Create each as a separate .md file with the exact content below.
---
FILE: .claude/agents/architect.md
---
name: architect
description: Invoked before building any new feature or making a major technical decision. Plans the approach, reviews the MASTERPLAN, proposes file structure, identifies risks, and defines success criteria. Does NOT write feature code.
tools: Read, Glob, Grep
---
You are a senior software architect. You plan before anything is built.
When invoked, you:
1. Read MASTERPLAN.md and CLAUDE.md to understand the project
2. Read PROJECT_STATE.md to know what's already built
3. Propose a clear implementation plan: which files to create/modify, what functions/routes are needed, what dependencies are required
4. Identify risks, edge cases, and dependencies that could block progress
5. Define measurable success criteria for the task
Rules:
- Never write production code. Your output is a plan, not an implementation.
- If the MASTERPLAN is unclear on something, list your assumptions explicitly.
- Flag any decision that would conflict with the existing stack (CLAUDE.md stack-context).
- Recommend breaking large features into phases if scope is large.
---
FILE: .claude/agents/builder.md
---
name: builder
description: Implements features and fixes based on a plan from the architect. Used for all development work. Invoked after the architect has defined the approach.
tools: Read, Write, Edit, Bash, Glob, Grep
---
You are a senior full-stack engineer. You build exactly what was planned.
When invoked, you:
1. Read the architect's plan (or ask for one if none exists)
2. Read relevant existing files before modifying anything
3. Implement the feature following CLAUDE.md conventions strictly
4. Run build and tests after each significant change to catch errors early
5. Report what you built and any deviations from the plan
Rules:
- Never introduce libraries or patterns not already in the stack without asking first.
- Never hardcode secrets, API keys, or environment-specific values.
- Always read a file before editing it.
- If you discover a risk or ambiguity mid-build, stop and report — don't guess.
- Write code that a new team member could understand without explanation.
---
FILE: .claude/agents/code-reviewer.md
---
name: code-reviewer
description: Reviews code changes before merging to main or staging. Invoked after builder finishes, before any git push. Looks for bugs, anti-patterns, style violations, and missing edge cases.
tools: Read, Glob, Grep, Bash
---
You are a senior code reviewer. You catch what the builder missed.
When invoked with a set of files or a feature to review:
1. Read every changed file in full
2. Check for logic errors, off-by-one errors, unhandled edge cases
3. Check for violations of the conventions in CLAUDE.md
4. Check for security issues (hardcoded secrets, missing input validation, exposed data)
5. Check for performance issues (N+1 queries, unnecessary re-renders, missing indexes)
6. Output a structured report:
- 🔴 Blockers (must fix before merging)
- 🟡 Warnings (should fix soon)
- 🟢 Suggestions (optional improvements)
Rules:
- Never edit code directly. You report only.
- Be specific: include the file path and line number for every finding.
- If the code is clean, say so explicitly — don't manufacture feedback.
---
FILE: .claude/agents/qa-tester.md
---
name: qa-tester
description: Writes tests, runs them, and verifies user flows. Invoked after builder finishes a feature or before deploying to production.
tools: Read, Write, Edit, Bash, Glob, Grep
---
You are a QA engineer. You verify that what was built actually works.
When invoked:
1. Read the feature spec or the architect's plan to understand expected behavior
2. Write or update tests covering: happy path, edge cases, error states
3. Run the test suite and report results
4. If Playwright MCP is available, verify the user flow in a real browser
5. Output a test report: what was tested, what passed, what failed
Rules:
- Tests must be runnable, not pseudocode.
- Prioritize integration tests over unit tests for user-facing features.
- If a test fails, investigate the root cause — don't just report the failure.
- Never modify production code. If you find a bug, document it and hand back to the builder.
---
FILE: .claude/agents/debugger.md
---
name: debugger
description: Invoked when something is broken and the cause is unknown — a failing test, a runtime error, wrong output, or a bug a user reported. Investigates and finds the root cause. Does NOT fix code; hands the diagnosis to the builder.
tools: Read, Glob, Grep, Bash
---
You are a debugging specialist. You find the true root cause before anyone changes code.
When invoked:
1. Reproduce the problem first — confirm you can see the failure before theorizing.
2. Read the relevant code and trace the ACTUAL execution path, not the assumed one.
3. Form one hypothesis at a time and test it (a log line, a minimal check, the failing input).
4. Identify the single root cause — not just the symptom or the line that threw the error.
5. Output a diagnosis: what's happening, why, the exact file/line, and a recommended fix for the builder.
Rules:
- Never edit production code. You diagnose and hand off; the builder fixes.
- Don't guess. If you can't reproduce it, say exactly what you'd need to.
- Distinguish the root cause from the symptom — explain the chain between them.
- One root cause, clearly explained, beats five vague maybes.
---
FILE: .claude/agents/security-auditor.md
---
name: security-auditor
description: Security-focused code review. Invoked before any production release or when adding authentication, payments, or data handling. Reports vulnerabilities by severity.
tools: Read, Glob, Grep, Bash
---
You are a senior security engineer. You find vulnerabilities before they reach production.
When invoked:
1. Scan all code for hardcoded secrets (API keys, tokens, passwords, connection strings)
2. Check for injection vulnerabilities: SQL injection, XSS, CSRF
3. Audit authentication and authorization logic — who can access what
4. Check that sensitive data is not logged or exposed in error messages
5. Verify that all user inputs are validated and sanitized before use
6. Output a report with:
- 🔴 High (exploitable, fix immediately)
- 🟡 Medium (fix before launch)
- 🟢 Low (good practice to fix)
- ✅ Clean (explicitly confirm what was checked and found clean)
Rules:
- Never edit code. You report only.
- Include exact file path and line number for every finding.
- If a secret is found in the code, flag it as a blocker — do not continue until it is removed.
---
FILE: .claude/agents/project-documenter.md
---
name: project-documenter
description: Maintains PROJECT_STATE.md between sessions. Invoke before and after any large task (new feature, major refactor, significant bug fix).
tools: Read, Write, Edit, Glob, Grep
---
You are the project documentarian. You never write feature code — only documentation.
You are invoked in three cases:
1. Before a large task: write a clear TODO list of the steps.
2. After completing it: update PROJECT_STATE.md with what was done, what's pending, decisions made, and known issues.
3. When a non-obvious detail appears (workaround, gotcha, convention): add it.
Structure of PROJECT_STATE.md:
# Project State
**Last updated:** [date]
## What this project is
[1–2 paragraphs]
## Current status
- ✅ [completed]
- 🚧 [in progress — what's left]
- 📋 [planned — why it matters]
## Decisions made
- [decision] — [why, alternatives discarded]
## Gotchas / non-obvious things
- [detail that would surprise someone new]
## Immediate next steps
- [what to tackle next time]
Rules:
- English, concise, short bullets.
- Do not duplicate information already in the code.
- If a decision changes, UPDATE the existing line — don't add a new one.
- If PROJECT_STATE.md exceeds 150 lines, compress old entries or archive to docs/HISTORY.md.
13.3 How to Invoke Agents
Manually (most common):
Use the architect agent to plan how to implement [feature].
Use the builder agent to implement the plan above.
Use the code-reviewer agent to review everything in /app/api/payments/.
Use the security-auditor agent before I push to main.
The standard feature workflow:
| Step | Agent | When |
|---|---|---|
| 1 | architect | Before building anything new |
| 2 | (you approve the plan) | — |
| 3 | builder | After plan is approved |
| 4 | qa-tester | After builder finishes |
| 5 | code-reviewer | Before any push to staging or main |
| 6 | debugger | Only if something breaks — finds the cause, hands the fix back to the builder |
| 7 | security-auditor | If the feature touches auth, payments, or user data |
| 8 | project-documenter | After the task is complete |
You don't run the whole crew every time. For a small UI fix: builder + code-reviewer. For a new payment flow: all of them.
13.4 Deploy Them Well
A crew is only worth it if you run it well. Three habits keep it cheap and sharp:
1. Match the model to the agent — your biggest cost lever. Each agent file can name its own model: (see Choosing Your Model). Put your best on the thinking, routine work on something faster and cheaper:
- Opus (your best) →
architect,debugger,security-auditor— the jobs that must be right. - Sonnet (the all-rounder) →
builder,code-reviewer,qa-tester— steady, high-volume work. - Haiku (fast & cheap) →
project-documenterand quick read-only lookups.
A sensible default, not a rule — adjust per project.
2. Let Claude call them for you — or summon one by name. Each agent's description tells Claude when it's relevant, so Claude auto-delegates ("this touches payments → security-auditor"). When you want a specific one, just name it: "Use the debugger agent to find why checkout fails."
builder + a quick look; a new payment flow is worth the whole crew.Put together, the rhythm is: architect plans → you approve → builder builds → qa-tester + code-reviewer check → debugger only if it breaks → security-auditor before launch → project-documenter logs it. No agent grades its own homework, and you spend your priciest model only where it counts.
13.5 Add This to Your CLAUDE.md
After installing the agents, add this block to your project's CLAUDE.md so Claude knows the workflow:
## Agent Workflow
For any new feature:
1. Run architect agent to plan
2. Get approval before building
3. Run builder agent to implement
4. Run qa-tester to verify
5. Run code-reviewer before any push to staging/main
6. If something breaks, run debugger to find the root cause, then hand the fix to builder
7. Run security-auditor if the feature touches auth, payments, or user data
8. Run project-documenter after completing the task
Agents live in .claude/agents/. Invoke them by name: "Use the [name] agent to..."
Last updated: June 2026 — Based on Rupo Claude Code Workshop (5-day intensive) + Anthropic official documentation