An open, general-purpose playbook for building software with AI — from first idea to working product. Every prompt is complete, reusable, and ready to paste. You are the director. The AI is your expert assistant. This guide teaches you how to run that collaboration so it actually works.
Save CLAUDE.md in your project folder. To install the skill: download the file, then double-click it — Claude Code opens and installs it automatically.
Before any AI session begins, spend a few minutes thinking clearly about what you want. The prompt does the coaching — but the raw material is yours. Here is how to think about it.
Most people have never built software before and have no idea how to lay a foundation or frame a structure. That's exactly what the AI is exceptional at — given your clear goals, it will design the right foundation and frame the right structure for what you're trying to build. Your job is to bring the vision and be clear about the finish. The AI does the engineering in between. Every decision about what it does and what it's for is yours. Every decision about how to build it is the AI's. This guide is the process that connects the two.
I want to build something and need help thinking it through before writing any code. My rough idea: [describe your idea in 2–3 sentences] Here is what I already know about it: - The one thing it must do: [your one sentence] - Who uses it: [yourself / a team / customers / the public] - Interface I'm imagining: [dashboard / chat / map / form / report / other] - Data it works with: [what it stores, reads, or connects to — or "not sure yet"] - Core formula or logic (if any): [describe any calculation, scoring, or rule at the center] - Things it must NOT do: [scope limits, complexity to avoid, trust boundaries] Act as a requirements engineer. Use what I've shared as a starting point and interview me to fill in everything else. Ask ONE question at a time and wait for my answer. Cover anything not already addressed: specific features for the first working version; what a successful outcome looks like concretely; data, privacy, and security implications; external services or APIs needed; what "done" looks like for this first version. When the interview is complete, update the Requirements section of CLAUDE.md with everything we established. Note anything I should revisit as the project evolves. Confirm when CLAUDE.md has been updated.
Claude, update CLAUDE.md with the requirements we just established.
The AI reads your requirements from CLAUDE.md, designs the technical structure, explains reasoning behind every choice, and surfaces key tradeoffs for you to consciously approve before building starts.
Read the requirements in CLAUDE.md. Act as a software architect. Design the complete technical architecture for this system. I am not a programmer — explain reasoning in plain language alongside technical terms. Cover: the major components and what each does; how they connect and communicate; where data is stored and why; technology choices with reasoning and alternatives considered; the user's complete journey step by step; security and privacy — where sensitive data lives and how it's protected; the biggest technical risks and how the design handles them; what I will NOT be able to easily change once building starts. At the end, present the 3–5 most significant design tradeoffs. For each: what you chose, what you didn't, and why. I want to consciously agree before we proceed. Then update the Architecture section of CLAUDE.md and confirm.
Claude, update CLAUDE.md with the architecture we just agreed on.
The AI reads requirements and architecture from CLAUDE.md and defines precisely what the first working version includes and excludes. This agreement prevents scope creep before it starts.
Read CLAUDE.md. Based on the requirements and architecture there: Define the MVP — the smallest version that is genuinely useful and worth building first. 1. Propose what the MVP includes: specific features and components for the first version. 2. Propose what the MVP excludes: desirable features that should wait. 3. For anything uncertain, ask me directly — one item at a time. 4. Once we've agreed: update the MVP Scope section of CLAUDE.md with the final list — IN (one-line reason each), OUT (one-line reason each), and one sentence describing exactly what this MVP does. Confirm when done.
Claude, update CLAUDE.md with the MVP scope we just agreed on.
The AI reads everything established so far from CLAUDE.md and creates a phased construction sequence. Each phase produces something demonstrably working. No phase starts until the previous phase's done criteria are met.
Read CLAUDE.md. Based on the requirements, architecture, and MVP scope there: Create a phased Build Plan for implementing this MVP. Each phase must: have a name and single clear goal; list the specific components being built; define concrete done criteria — specific things I can test or observe, not vague descriptions; note what must be true before this phase begins; flag risks specific to this phase. Order phases so Phase 1 is the smallest possible working skeleton; each subsequent phase adds one discrete layer; no phase begins until the previous phase's done criteria are fully met. Note any decisions I must make before each phase begins. Update the Build Plan section of CLAUDE.md with the complete plan. Confirm when done.
Claude, update CLAUDE.md with the build plan we just created.
You now have four documents: Requirements, Architecture, MVP Scope, and Build Plan. This step combines all of them with the CLAUDE.md template from Part 5 into a single, unified project memory file. When this is done, the rocket is ready to launch.
The CLAUDE.md template is in Part 5 of this guide. Copy it in full, paste it along with the four documents below, and Claude will merge everything into a single initialized file — structured, consistent, and ready for the first build session.
Read CLAUDE.md. You have updated it with requirements, architecture, MVP scope, and build plan during Steps 1–4. Now finalize it: 1. Add the Session Protocol section with this exact text: "Before every session: Read this file. Identify the current Build Plan phase. State today's goal in one sentence. Tell me if anything in this file looks wrong or out of date before we begin. During every session: Stay on the current Build Plan phase. Record failures in Debugging History immediately. Update CLAUDE.md directly — do not wait until the end. After every session: Update Current State, Build Plan status, What's Next, and add a Session Log entry." 2. Set the Current State section to reflect that nothing is built yet. 3. Mark Phase 1 of the Build Plan as the active phase. 4. Confirm CLAUDE.md is complete by telling me: — What this project does in one sentence — What Phase 1 is and what its done criteria are — Any sections still containing placeholder text that I need to fill in The project is ready to build.
Open Claude in your project folder — it finds CLAUDE.md automatically. This prompt orients the session, confirms Claude has the right context, and locks in today's goal before any work starts.
cd my-app && claudeRead CLAUDE.md. If you cannot find it, stop and tell me before doing anything else.
Confirm:
1. What this project is in one sentence.
2. Which Build Plan phase we are currently in and its done criteria.
3. Any Critical Constraints relevant to today's work.
4. Today's goal: [YOUR ONE-SENTENCE GOAL FOR THIS SESSION]
Do not begin work until I confirm your understanding is correct.This is where the work happens. One piece at a time — build the next component, verify it works, get the exact commands to run it yourself. Then repeat. Each iteration is small enough that if something goes wrong, you know exactly what changed.
Read CLAUDE.md. We are working on: [current phase name and goal] Build the next component: [describe the specific thing being built this iteration] When done: 1. Tell me what files you created or changed and what each one does. 2. Give me the exact terminal commands to start the app and test this — copy-paste ready, nothing assumed. Include any environment setup needed. 3. Tell me exactly what I should see or do to confirm it's working correctly. 4. Tell me what failure looks like so I know the difference. 5. Update Current State in CLAUDE.md to reflect what now works.
Give me the complete instructions to run and test what we just built. 1. Every command I need to run in order — copy-paste ready for the terminal. Start from scratch as if I've just opened a new terminal window. 2. The URL or interface to open in my browser. 3. The exact steps to test this specific feature — what to click, type, or do. 4. What I should see when it's working correctly. 5. The most likely reason it might not work and what to check first.
Use any time the AI starts working outside today's stated goal or proposes something out of scope.
Stop. Today's goal is: [restate the one-sentence goal] Current Build Plan phase: [phase name] What you just proposed touches [describe what drifted]. That is not in scope today. Either: redo your proposal to achieve today's goal without touching out-of-scope components — or make the case for why these two things genuinely can't be separated so I can decide whether to expand scope deliberately. Do not make the change silently. Present the option and wait.
Use before implementing anything that connects to an external service. The AI's training data has a cutoff date; APIs don't. Forces current documentation before a line is written.
Before writing any code for this integration, go to: [official documentation URL] Read the current implementation guide for [specific feature]. Find and report: current authentication method; exact endpoints needed; required request format and parameters; response format and how to handle it; rate limits or quotas; any recent breaking changes or deprecated patterns. If anything conflicts with what you might assume from older knowledge, flag it. Only write code after I confirm your understanding of the current docs.
The most important step in the guide. Tell Claude to update CLAUDE.md directly — no copying, no pasting. The project documents itself. The next session starts from exactly where this one ended.
This session is ending. Update CLAUDE.md directly with the following: 1. CURRENT STATE — what is now confirmed working; what is broken or newly discovered to be broken; what is still unknown. 2. BUILD PLAN — mark the current phase Complete if done criteria were met and activate the next phase. If not complete, note what remains and any blockers. 3. DEBUGGING HISTORY — add a row for anything that failed this session: what was tried, what happened, root cause if known. 4. LOCKED DESIGN DECISIONS — add any new architectural decisions made today with their reasoning. 5. WHAT'S NEXT — the first thing the next session should do. 6. SESSION LOG — add an entry for today: Phase / Attempted / Succeeded / Failed / New constraints / Plan changes. Write all updates to CLAUDE.md now. Confirm when done.
The build cycle in Part Two is all you need for most sessions. The tools in this section are for when things get harder — something breaks, the session goes sideways, you need to protect your work, or you want to take a hard look at what you've built. Use them as reference. You won't need all of them at once.
When something breaks, your first move is always to give Claude as much information as possible about exactly what you see. The more evidence you provide, the faster the diagnosis. Here are the four most powerful techniques — use them in combination.
Never describe an error when you can copy it. The exact text of an error message — including the line numbers, file paths, and stack trace — contains the precise information Claude needs to diagnose the problem. A paraphrase loses critical detail. Select all the red text in your terminal or browser console, copy it, and paste it in.
Something is broken. Do not propose any fix yet.
Here is the exact error: [paste the complete error message, including any stack trace]
Explain:
1. What this error means in plain language.
2. Which specific file, function, or line is the source of the failure.
3. WHY it happened — what caused the system to reach this state.
4. If there are multiple possible causes, list them in order of likelihood.
I will ask for a fix once I understand the problem.If the problem is visual — a broken layout, an unexpected blank screen, a UI element in the wrong place — take a screenshot and attach it to your message. Claude can read images. Drag the screenshot directly into the chat window alongside your prompt. This is especially useful when the browser console shows no error but something still looks wrong.
Cmd + Shift + 4 — drag to select areaWin + Shift + S — drag to select areaSomething doesn't look right. I've attached a screenshot. Expected: [describe what you expected to see] Actual: [describe what you actually see] Identify what's causing the visual difference and propose a fix.
Every running application writes a log — a record of everything that happened, in order. When something fails silently (no visible error, but wrong behavior), the log usually contains the real story. Claude can read your log files directly from the project folder. If you don't know where your logs are, ask Claude to find them.
Something is failing but I don't have a clear error message. Read the application logs for this project. Look for: 1. Any ERROR or WARNING entries around the time the problem occurred. 2. The last successful operation before things went wrong. 3. Any unexpected values, null responses, or timeout messages. Tell me what the logs reveal. If you can't find the log files, tell me where they should be and how to find them for this stack.
When you can't tell which part of the code is causing a problem, ask Claude to insert debug statements — lines that print the value of key variables at specific points as the code runs. You then run the app, watch what gets printed in the terminal, and see exactly where the expected value turns wrong. Once the problem is isolated, Claude removes the traps and fixes the real issue.
I need to isolate exactly where this problem is occurring. The symptom: [describe what goes wrong and when] The suspected area: [which feature, function, or flow you think is involved] Add debugging statements at key points in the relevant code to print: - The value of important variables as they change - Which functions are being called and in what order - The exact point where the value becomes wrong or the flow goes unexpected Do not fix anything yet — just instrument the code so I can see what's happening. Tell me exactly what to run and what to look for in the output. Once we've identified the problem, remove all debug statements before fixing.
Use when multiple changes have been made, something is broken, and you're not sure what changed or in what order.
Stop all changes. This session has gone off the rails. Without making any further modifications: 1. List every change made to the codebase in this session, in order. 2. Identify what you believe is currently broken and your best theory why. 3. Identify the last point in this session where everything was working. 4. Propose the minimum rollback needed to return to that working state — not to fix everything, just to reach stable ground. Once I confirm the rollback, I'll decide whether to continue or end the session and capture what we learned.
Use when you've lost the thread — unclear on priority, phase, or what to do next.
I'm not sure what to do next. Do not write any code. Read CLAUDE.md and review the current project state. Give me an honest assessment: 1. What is the highest-priority broken thing right now? 2. What is the highest-value next thing to build, assuming nothing is broken? 3. Is there anything I'm ignoring that will become a serious problem later? 4. Is the Build Plan sequence still correct, or should it be reordered? Be direct. If I should slow down or consolidate before building more, say so.
Run every few sessions or whenever the project feels chaotic. You build nothing. You make everything accurate so the next phase starts from solid ground.
This is a consolidation session. We are not building anything. Goal: make CLAUDE.md accurately reflect the current state of the project. Read CLAUDE.md and examine all files in this project folder. 1. ARCHITECTURE AUDIT — does the Architecture Overview match what was actually built, or has it drifted? Identify gaps. 2. BUILD PLAN AUDIT — which phases are genuinely complete? Which are partial? Should the sequence be reordered given what we now know? 3. CONSTRAINTS AUDIT — are there rules in the code not yet documented in Critical Constraints or Locked Decisions? 4. CURRENT STATE — produce an accurate Current State based on reality, not intent. 5. WHAT'S NEXT — propose a clean priority list for the next phase. Output the revised CLAUDE.md sections. I will review and apply them.
| Step | Prompt | When to use |
|---|---|---|
| Part 1 — Starting a New Project | ||
| 01 | Requirements Interview | Starting a new project |
| 02 | Architecture Design | After requirements |
| 03 | MVP Scope | After architecture |
| 04 | Build Plan | After MVP scope |
| 05 | Finalize CLAUDE.md | Once, at end of setup — the launchpad |
| Part 2 — Running Each Session | ||
| 06 | Session Open | Start of every session |
| ● | Build It · Run It · Test It | The core loop — repeat every iteration |
| 07 | Scope Check | When session starts drifting |
| 08 | External API Integration | Before connecting to any service |
| 09 | Session Close / Self-Assessment | End of every session |
| Power Tools — When You Need Them | ||
| 10 | Root Cause Diagnosis | When something breaks |
| 11 | Session Recovery | When changes have piled up wrong |
| 12 | Unstuck Assessment | When you've lost the thread |
| 13 | Consolidation | Every few sessions, or when things feel chaotic |
| 14 | Create CLAUDE.md from Template | Starting any new project |
| 15 | Git Setup | Once per project, before first commit |
| 16 | Git Commit & Push | End of every session |
| 17 | Code Quality Audit | After a working version exists |
CLAUDE.md is the single most important file in your project. It is the living document every AI session reads first and updates last. The template below captures everything your project needs to stay on track — architecture, decisions, constraints, what's working, what's broken, and what's next. You never fill it in from scratch; you use the prompt below to have Claude generate it from your requirements.
Paste this prompt into Claude along with the template below. Claude will create the actual file in your project folder, filled in with your project's specifics. Do this once, before your first working session.
Create a file called CLAUDE.md in this project folder using the template on the following page of the Playbook. Copy the entire template block and include it after this instruction. For every [bracketed section]: leave the placeholder text exactly as written — we will fill it in during Steps 1–4 of the Playbook. Set up the file now. Confirm the path when done.
Keep all projects under one parent folder. Each project gets its own subfolder. Claude Code is started from the project folder — not the parent — so it sees only the relevant code.
~/projects/ ├── my-app/ ← Project A root (start Claude Code here) │ ├── CLAUDE.md ← Project A memory document │ ├── .env ← API keys — never shared or committed │ ├── .gitignore ← Tells git what NOT to track │ ├── backend/ │ └── frontend/ │ ├── second-project/ ← Project B root │ ├── CLAUDE.md │ ├── .env │ └── src/ │ └── experiment/ ← Low-stakes exploration project
When you open Claude Code, navigate into the specific project folder first. Claude will automatically read the CLAUDE.md it finds there — giving it the right memory for that project and nothing else.
When you run a project locally, your computer opens it at an address like http://localhost:3000. The number (3000) is the port — think of it as a door on your computer. Each running project needs its own door, or they collide.
| Port | Typically used for |
|---|---|
| 3000 | React / Vite frontend (default) |
| 5000 | Flask / Python backend (default) |
| 8000 | FastAPI / Django backend |
| 8080 | Alternative frontend or proxy |
| 5432 | PostgreSQL database (default) |
If you run two projects that both try to use port 3000, the second one will fail with a confusing error. Assign each project its own port range and document it in CLAUDE.md under "Running the Project." Tell Claude which port to use and it will configure everything accordingly.
Assign port numbers for this project so they don't conflict with my other projects.
My other projects use these ports: [list ports already in use, or "none yet"]
Pick an available port for:
- The frontend (the UI I open in a browser)
- The backend API server
- Any database, if applicable
Use these ports consistently throughout the project. Update CLAUDE.md under
"Running the Project" with the local URLs. Never change these ports without
updating CLAUDE.md and telling me.An API key is a secret password that lets your app use an external service — an AI model, a payment system, a map provider. These keys must be kept private. If they leak into public code, someone else can use your account and run up your bill.
OPENAI_API_KEY=sk-proj-abc123... GEMINI_API_KEY=AIzaSy... DATABASE_URL=postgresql://user:pass@localhost:5432/mydb STRIPE_SECRET_KEY=sk_live_...
Set up environment variable handling for this project.
1. Create a .env file in the project root with placeholder entries for
every API key or secret this project will need:
[list the services: e.g., OpenAI, Stripe, database, etc.]
2. Create a .env.example file with the same keys but empty values —
this is safe to commit and shows collaborators what keys are needed.
3. Ensure .env is in .gitignore so it can never be accidentally committed.
4. Configure the application to read these values from the environment,
never hardcoded in source files.
5. Add the variable names (not values) to CLAUDE.md under "Running the Project."It's common to have several projects active at once — a main product, an experiment, a tool you built to support the main one. Claude Code handles this cleanly because its memory is entirely in the CLAUDE.md of whichever folder you start it from.
I have multiple projects and need to organize them cleanly. Projects: [list each project and what it does in one line] Parent folder: [e.g., ~/projects/ or ~/Documents/dev/] For each project: 1. Create its folder under the parent if it doesn't exist. 2. Create a minimal CLAUDE.md stub with the project name and a one-sentence description. 3. Create a .env placeholder and .gitignore. 4. Assign a unique port range (frontend + backend) that doesn't conflict across projects. Produce a summary table showing: project name, folder path, frontend port, backend port. I'll refer to this when starting sessions.
Git is a time machine for your code. Every time you make a commit, Git takes a snapshot of your entire project at that moment. If a future session breaks something, you can travel back to any previous snapshot and restore it — or compare what changed between any two points in time.
Set up git version control for this project. 1. Initialize a git repository if one doesn't exist. 2. Create a .gitignore that excludes: node_modules, .env, any file containing API keys or secrets, build output folders (dist/, build/, __pycache__/), log files, and OS files (.DS_Store, Thumbs.db). 3. Make an initial commit of all current project files with the message: "Initial commit — [project name] project scaffold" 4. Confirm the repository is initialized and the first commit is recorded. From this point forward: after every working session, commit all changes with a clear descriptive message summarizing what was built or fixed.
Git lives on your local computer. GitHub is a cloud backup of your git history. If your computer is lost, stolen, or fails, your entire project — every commit, every snapshot — is safe on GitHub. It also makes it easy to share projects or collaborate.
Push this project to GitHub for cloud backup. My GitHub username: [your username] Repository name: [project-name — lowercase, hyphens not spaces] Visibility: [private (recommended) or public] 1. Guide me through creating the repository on github.com if it doesn't exist. 2. Add the GitHub remote to this local repository. 3. Push the current branch and all commits. 4. Confirm the push succeeded. From this point forward: after every local commit, also push to GitHub so the cloud backup stays current.
Commit all changes from this session and push to GitHub. Write a commit message that clearly describes what was built or changed today. Format: "[type]: [description]" Types: feat (new feature), fix (bug fix), refactor (restructure), docs (documentation) Example: "feat: add audio playback controls to interview screen" 1. Stage all changed files. 2. Commit with the descriptive message. 3. Push to GitHub. 4. Confirm the commit hash and what files were included.
When a session breaks something and you can't recover it forward, roll back to the last known-good commit. This is the safety net that makes bold experimentation safe.
Something from this session has broken the project and I want to roll back. 1. Show me the last 10 commits with their messages and dates. 2. Identify which commit is most likely the last working state based on the session log and what we attempted today. 3. Tell me exactly what will be lost if I roll back to that commit. 4. If I confirm, perform the rollback. Do not roll back until I explicitly confirm after seeing what will be lost.
A systematic review of the entire codebase for security vulnerabilities, architectural weaknesses, dead code, and technical debt. The AI reports findings — it does not fix anything until you review and approve.
Perform an objective audit of this codebase. Do not write any code or make any changes.
Examine every file and report findings under four categories:
1. SECURITY
— Hardcoded API keys, passwords, or secrets anywhere in source files
— User inputs that are passed to a database or shell without validation
— Endpoints or routes that are accessible without authentication and shouldn't be
— Sensitive data stored or transmitted without encryption
— Dependencies with known vulnerabilities
2. ARCHITECTURAL WEAKNESSES
— Components that do too many unrelated things (should be split)
— Missing error handling — places where a failure will silently break something
— Assumptions that will fail under real-world conditions (e.g., assumes fast network,
assumes single user, assumes data always exists)
— Circular dependencies or tight coupling that makes future changes risky
3. BLOAT & DEAD CODE
— Functions, files, or routes that are defined but never called
— Duplicate logic that exists in more than one place
— Dependencies installed but not used
— Over-engineered solutions for simple problems
4. TECHNICAL DEBT
— Shortcuts taken that will cause problems at scale or with more users
— Places where error messages are swallowed instead of surfaced
— TODO comments or placeholder logic still in production paths
— Inconsistent patterns that will confuse future development
For each finding: name the file and line, describe the problem, rate severity
(Critical / High / Medium / Low), and recommend the fix.
Order by severity. Be direct and specific. Do not soften findings.Checks what your project is spending — in API calls, compute, and third-party services — and whether any of it can be reduced without sacrificing functionality.
Audit this project for unnecessary cost and dependency risk. Do not make any changes. 1. DEPENDENCIES — list every external library or package installed. For each: what is it used for, is it still actively maintained, could it be replaced with a simpler built-in alternative? 2. API CALL EFFICIENCY — identify every place an external API is called. For each: how often does it get called, could results be cached, is the same data fetched multiple times when once would suffice? 3. ESTIMATED COSTS — for any paid API (AI models, cloud services, payment processors), estimate the cost per user action and per month at 100 users and at 1,000 users. Flag anything that will scale expensively. 4. SINGLE POINTS OF FAILURE — identify any external dependency where if the service goes down, the entire application stops working. Note whether a fallback exists. Report findings with severity and recommended action. Do not fix anything yet.
After reviewing audit findings and deciding which to address, lock the prioritized fixes into the project memory document so they don't get lost.
Based on the audit we just completed, update CLAUDE.md as follows: 1. Add a new section "Known Issues — Audit Findings" listing every issue we decided to fix, with severity and the agreed fix approach. 2. Insert the Critical and High severity fixes as the top items in What's Next, ahead of any feature work. Security issues are never deferred. 3. Add any new Critical Constraints discovered during the audit — things that must never be done in future development. 4. Update the Build Plan to include an "Audit Remediation" phase before the next feature phase, covering the Critical and High items. Output the updated CLAUDE.md sections.