Abie Maxey
Playbook Library
Available Now · Free with Subscription

Master Claude

From first prompt to production agent. The complete system for mastering Claude Code, the Anthropic API, and the Agent SDK ~ by someone who builds with it every day.

15

Lessons

5

Phases

~4.5h

Read Time

Unlock all phases

~ The Problem

Most people use 10% of what Claude can do.

They type messages. They get responses. They copy-paste code. That is not mastery ~ that is a search engine with better grammar. Claude Code is an agent. The API is an integration platform. The Agent SDK is infrastructure. This playbook teaches all three.

By the end, you will not just use Claude. You will build with it, deploy it, and teach others how to do the same.

claude ~ master

$ claude

› Reading CLAUDE.md...

✓ Project context loaded

✓ 3 MCP servers connected

✓ 4 custom skills available

✓ Hooks active (lint, type-check)

› What would you like to build?

~ What's Inside

The 5 phases

PHASE_013 Lessons

Foundation~ From zero to your first real session.

Claude Code is not a chatbot in a terminal. It is an agent with tools ~ it reads files, writes code, runs commands, and thinks before it acts. This phase teaches you what it actually is, how to configure it, and how to run your first productive session.

01

What Claude Code Actually Is

Most people think Claude Code is just Claude in a terminal. It is not. It is an agentic coding system that reads your codebase, understands your architecture, writes code, runs tests, and manages git ~ all in a loop where it decides what tools to use next. Understanding the agentic loop is the first step to using it well. This lesson covers the core architecture: how messages flow, how tools are selected, and why giving Claude Code the right context changes everything.

The Agentic Loop

Claude Code runs in a loop: receive input, think, pick a tool, execute, observe the result, think again. Each iteration it decides whether to read a file, run a command, edit code, or respond to you. The loop continues until the task is done or it needs your input. Understanding this loop is the key to working with it effectively ~ you are not chatting, you are collaborating with a system that acts.

Tools Available

Claude Code has access to: Read (read files), Edit (modify files), Write (create files), Bash (run commands), Glob (find files by pattern), Grep (search file contents), Agent (spawn sub-agents), and any MCP tools you configure. Each tool has specific strengths. Read is cheaper than Bash + cat. Glob is faster than find. Knowing which tool does what helps you prompt more effectively.

What Makes It Different

Unlike a chat interface, Claude Code sees your actual codebase. It can read your files, understand your imports, trace your dependencies, and modify code in place. It also persists state across the session ~ edits build on each other, context accumulates, and the system gets smarter about your project the longer you work together.

Install & First Session

# Install Claude Code globally

npm install -g @anthropic-ai/claude-code

# Start a session in your project

cd your-project

claude

# Or run a one-shot command

claude -p 'explain the authentication flow in this codebase'

02

CLAUDE.md ~ Teaching It Your Codebase

CLAUDE.md is the most powerful feature most people never use. It is a markdown file at the root of your project that tells Claude Code how your codebase works ~ your conventions, your architecture, your commands, your rules. Without it, Claude Code guesses. With it, Claude Code knows. This lesson covers how to write an effective CLAUDE.md, what to include, what to skip, and the interactive generator below helps you build yours from scratch.

What to Include

A good CLAUDE.md has four sections: tech stack and architecture, code conventions and style rules, common commands (dev, build, test, lint), and project-specific rules (never do X, always do Y). Keep it concise ~ Claude Code reads it at the start of every session, so every line costs tokens. The best CLAUDE.md files are under 100 lines and opinionated.

Where It Lives

CLAUDE.md at your project root is the primary file. Claude Code also reads ~/.claude/CLAUDE.md for global preferences that apply to all projects, and .claude/rules/ for additional rule files. Rules in subdirectories apply only when working in those directories. This hierarchy lets you set global defaults and override per-project.

Example CLAUDE.md

# my-saas-app

## Tech Stack

- Next.js 14 App Router with TypeScript strict mode

- Tailwind CSS + shadcn/ui components

- Prisma ORM with PostgreSQL

- NextAuth.js for authentication

## Conventions

- Use kebab-case for file names

- Prefer server components; use 'use client' only when needed

- Never use em dash; use tilde (~) instead

- All API routes return NextResponse.json()

## Commands

- Dev: npm run dev

- Build: npm run build

- Type check: npx tsc --noEmit

- Lint: npm run lint

## Rules

- Never push to main directly

- Always run type check before committing

- Keep components under 200 lines

Build Yours

Use the interactive generator below to build your CLAUDE.md. Pick a template, customize the sections, and copy the output to your project root. A well-written CLAUDE.md is the single highest-leverage thing you can do to improve Claude Code's output quality.

CLAUDE.md Generator
-
-
-
-
-
-
-
-
-
-
CLAUDE.md
# my-project

## Code Style

- Use TypeScript strict mode
- Prefer named exports over default exports
- Use Tailwind CSS for styling

## Conventions

- Use kebab-case for file names
- Use PascalCase for components
- Never use em dash ~ use tilde instead

## Architecture

- Next.js App Router with src/ directory
- API routes in src/app/api/
- Shared components in src/components/

## Testing

- Run npx tsc --noEmit before committing
03

Permission Modes & Safety

Claude Code can run shell commands, edit files, and push to git. That is powerful and dangerous in equal measure. Permission modes control what Claude Code can do without asking. Plan mode is read-only. Default mode asks for each action. Auto mode lets it execute freely. This lesson covers when to use each, how to configure allowlists for trusted commands, and the safety model that prevents Claude Code from running destructive operations without your explicit approval.

The Three Modes

Plan mode: Claude Code can only read files and think. It cannot edit, write, or execute. Use this when you want analysis without risk. Default mode: Claude Code asks permission before each tool use. You approve or deny each action. This is the safe default for new projects. Auto mode: Claude Code executes without asking. Fast but requires trust ~ only use on projects where you have version control and understand the blast radius.

Permission Configuration

# Start in plan mode (read-only)

claude --plan

# Allow specific commands without prompting

# In settings.json or via /permissions

# Allow: npm test, npm run build, npx tsc

# The allowlist approach:

# Trust specific commands, ask for everything else

# This is the sweet spot for most workflows

Safety Model

Claude Code has built-in safety rails. It will not force push to main, delete files without confirmation, or run destructive operations silently. Even in auto mode, certain high-risk actions require explicit approval. The safety model is designed so that the worst case scenario of trusting Claude Code too much is a bad commit you can revert ~ not data loss.

Practical Setup

Start with default mode for a new project. As you build trust, add frequently-used commands to the allowlist. After a week, you will know which commands are safe to auto-approve and which you want to review every time. The goal is a permission setup that matches your comfort level ~ not maximum speed, not maximum caution, but the right balance for you.

PHASE_023 Lessons

Workflows~ The patterns that make you fast.

Knowing the tools is not enough. Knowing when to use which tool, in which order, for which kind of task ~ that is the skill. This phase covers the workflows that turn Claude Code from a helper into a multiplier.

04

The 5 Core Workflows

Every task you do with Claude Code falls into one of five categories: understand code, fix bugs, add features, refactor, and write tests. Each has an optimal approach. Understanding code? Start with a question, not an instruction. Fixing bugs? Paste the error, point to the file. Adding features? Describe the behavior, not the implementation. This lesson maps all five workflows with the exact prompting patterns that produce the best results.

1. Understand Code

Ask questions, not instructions. 'How does the authentication flow work?' is better than 'Read the auth files'. Claude Code will trace imports, read related files, and build a mental model. Follow up with specifics: 'Where does the JWT get validated?' The key is treating it as a pair programmer who has read the entire codebase.

2. Fix Bugs

Paste the error message. Point to the file if you know it. Let Claude Code trace the root cause. The pattern: 'I am getting this error [paste error] when I [describe action]. The relevant code is in src/auth/. Fix it.' Claude Code will read the files, understand the error, propose a fix, and apply it. Always run the failing test after to verify.

3. Add Features

Describe the behavior, not the implementation. 'Add a dark mode toggle to the settings page that persists in localStorage' is better than 'Create a useState for dark mode and add a button'. Let Claude Code decide the implementation details ~ it knows your codebase better than a generic instruction.

4. Refactor

Be specific about what and why. 'Extract the email validation logic from UserForm.tsx into a shared utility ~ it is duplicated in RegisterForm.tsx and ProfileForm.tsx.' Claude Code will read all three files, extract the common logic, and update the imports.

5. Write Tests

Point to the file and say what to test. 'Write unit tests for src/utils/pricing.ts ~ cover edge cases for zero quantities and discount codes.' Claude Code will read the file, understand the functions, and generate tests using your project's testing framework.

05

Context Management ~ The Hidden Skill

Context is tokens. Tokens cost money and fill up the window. The best Claude Code operators actively manage context ~ they know when to use /compact to summarize, when to start a fresh session, and when to let the context grow. They write CLAUDE.md files that front-load the right information. They use sub-agents for research so the main context stays clean. This lesson teaches you to think about context as a resource you manage, not a buffer that fills up.

Context is Money

Every token in the context window costs money. A session that reads 50 files to answer a question costs more than one where you point to the right file upfront. Write better CLAUDE.md files. Give specific file paths when you know them. Use /compact when the context grows large. Start fresh sessions for unrelated tasks.

/compact ~ Your Best Friend

The /compact command summarizes the entire conversation into a compressed form. It preserves the key decisions, file changes, and context while dramatically reducing token count. Use it when you notice the session getting slow, when you are switching to a different part of the codebase, or when Claude Code starts repeating itself.

Context Management Commands

# Compact the conversation

/compact

# Check your session cost

/cost

# Start a fresh session for a new task

# (Cmd+N in VS Code, or exit and re-enter in terminal)

# Use sub-agents for heavy research

# This keeps the main context clean

# Claude Code does this automatically when you ask

# broad questions about the codebase

Sub-Agents for Research

When Claude Code needs to search broadly ~ finding all usages of a function, understanding a module's architecture ~ it spawns sub-agents. These agents do the heavy reading in their own context and report back a summary. The main context stays clean. You can also trigger this explicitly by asking questions that require broad codebase exploration.

06

Git, PRs & Code Review

Claude Code understands git natively. It can create branches, stage changes, write commit messages, create pull requests, and even review PRs by reading diffs and comments. The key is knowing how to ask. This lesson covers the git workflows: from committing with good messages to reviewing someone else's PR to resolving merge conflicts. The goal is a git workflow where Claude Code handles the mechanics and you handle the judgment calls.

Commits That Tell a Story

Claude Code writes excellent commit messages when you let it. After making changes, just say 'commit this'. It will stage the right files, write a message that describes the why (not just the what), and include a Co-Authored-By attribution. If you want a specific style, put your commit conventions in CLAUDE.md.

Git Workflows

# Let Claude Code commit your changes

> commit these changes

# Create a PR with description

> create a PR for this branch

# Review someone else's PR

> review PR #142 on github

# Resolve merge conflicts

> resolve the merge conflicts on this branch

# Interactive rebase (Claude guides you)

> squash the last 3 commits into one

PR Reviews

Claude Code can review PRs by reading the diff, understanding the changes in context, and providing actionable feedback. It checks for bugs, security issues, performance problems, and style violations. The output is a structured review with specific line references. Use this for self-review before requesting human review ~ it catches things you miss after staring at code for hours.

Branch Strategy

Claude Code works best on feature branches. Create a branch, make changes, commit, create a PR. If you are working on multiple features, use separate sessions for each branch. Claude Code tracks the branch context and will not accidentally mix changes across branches.

PHASE_033 LessonsSubscriber Only

Power User~ Hooks, skills, servers, and agents.

The surface area of Claude Code is much larger than most people realize. Hooks automate responses to events. Skills encapsulate reusable prompts. MCP servers connect external tools. Sub-agents parallelize work. This phase unlocks the full system.

This phase is locked

Subscribe to unlock all 3 lessons in this phase plus full progress tracking.

07 ~ Hooks ~ Automating the Loop

18 min

08 ~ Custom Skills & Slash Commands

16 min

09 ~ MCP Servers ~ Connecting Everything

20 min
PHASE_043 LessonsSubscriber Only

Build~ Ship products with the Claude API.

Claude Code is for your workflow. The Claude API is for your products. This phase teaches you to build with the Anthropic SDK ~ from your first API call to tool use, streaming, prompt caching, and production-grade patterns.

This phase is locked

Subscribe to unlock all 3 lessons in this phase plus full progress tracking.

10 ~ Your First API Call

18 min

11 ~ Tool Use & Structured Output

22 min

12 ~ Streaming, Caching & Production Patterns

20 min
PHASE_053 LessonsSubscriber Only

Agents~ Build systems that think for themselves.

The Agent SDK is the frontier. Multi-agent systems where specialized agents delegate to each other, share context, and execute complex workflows autonomously. This phase teaches you to design, build, and deploy agent architectures.

This phase is locked

Subscribe to unlock all 3 lessons in this phase plus full progress tracking.

13 ~ The Agent SDK ~ From Chatbot to System

20 min

14 ~ Multi-Agent Architecture

22 min

15 ~ Deployment & the Long Game

18 min

~ What comes next

The next OS

Weekly Dispatch

The builder's diaries.

What I'm building, breaking, and figuring out ~ from Madrid, with Wi-Fi and too much coffee.

  • AI tools I actually use to build faster
  • Behind-the-scenes of growing a business in Madrid
  • Community plays, client wins, and real revenue breakdowns
  • Grounded dispatches from someone building roots

Growing Community

Drop your email.

Unsubscribe any time. No spam, ever.