All 22 chapters
- Part 01 — Your First Day with AI
- Part 02 — The Developer's Toolkit
- Part 03 — Building Your First Project
- Part 04 — Leveling Up
- Part 05 — The Agent Era
- Part 06 — The Big Picture
Claude Code
Your AI engineer lives in the terminal now.
In early 2025, Anthropic released a command-line tool called Claude Code. It was interesting but rough. By mid-2026, it’s responsible for roughly 4% of all public commits on GitHub. That number is climbing every month.
Claude Code is not a chatbot that happens to know about code. It’s an agentic coding tool. It reads your entire codebase, writes and edits files, runs shell commands, manages git, creates pull requests, and debugs issues. You describe what you want in plain English, and it figures out how to build it. Then it builds it. While you watch, redirect, or go make coffee.
I’m not an engineer. I’m a CEO who runs an engineering studio. But Claude Code has changed how I interact with our projects, how I prototype ideas before bringing them to the team, and how I think about what’s possible for a non-developer to build. If you write code at all, even occasionally, this tool changes how you work. And if you don’t, it might make you reconsider that.
What Claude Code is
You install it, navigate to a project directory, type claude, and you’re in an interactive session with an AI that can see your files, run commands, and make changes. This isn’t “paste code into a chat window.” Claude Code operates directly on your filesystem. It reads files, writes files, runs your test suite, commits to git, and pushes to GitHub. It uses the same tools you’d use — bash, git, npm, pip — but operates them autonomously based on your instructions.
Think of it as pair programming, except your partner has read the entire codebase and never gets tired. The tradeoff: it occasionally does something unexpected, and you need to review its work like you’d review any junior developer’s pull request. Last month it renamed a variable across 14 files to improve clarity — thoughtful, except the name it chose was already taken in three of those files. The tests caught it. The tests always need to catch it.
The permission system
By default, Claude Code asks before any action that modifies your system. Three modes: Default asks before every write operation and shell command — safe but verbose. Auto-accept (toggled with Shift+Tab) auto-approves safe operations and still asks about potentially destructive ones — the sweet spot. Fully autonomous runs everything without asking — only use this in sandboxed environments or throwaway branches. The flag name (--dangerously-skip-permissions) is a warning, not a suggestion.
A newer Auto Mode uses a separate classifier to evaluate each action. Safe actions are auto-approved; risky ones (piping to bash, IAM changes) are blocked. The practical middle ground.
CLAUDE.md — the file that changes everything
CLAUDE.md is a markdown file that Claude Code reads at the start of every session. It sits in your project root and tells Claude everything it needs to know about your project, preferences, and workflow. Run /init and Claude Code analyzes your codebase and generates a starter based on what it finds.
What to include: build commands Claude can’t guess, code style rules that differ from defaults, testing preferences, git conventions, architectural decisions, and common gotchas. What NOT to include: anything Claude can figure out by reading the code, or standard conventions it already knows.
A critical insight from Anthropic’s own documentation: if your CLAUDE.md is too long, Claude starts ignoring rules. The file loads as tokens every session, consuming context window space. I went through three rounds of trimming our main project’s CLAUDE.md. The first version was 2,000 words. The current one is 400. It works better.
Essential commands and task scoping
Once you’re in a session, slash commands control the environment. /compact is the most important — when your context fills up, it summarizes the conversation to reclaim space. Run it proactively. /clear wipes everything — use it when switching tasks. /plan toggles Plan Mode where Claude reads and analyzes without making changes. /fast switches to a cheaper model for simple tasks. /cost shows token usage.
The biggest mistake new users make is giving tasks that are too big. “Refactor the entire authentication system” is a recipe for Claude to burn through your context window and produce a mess.
Instead, think in phases. Explore: “Read the auth directory and explain how sessions work.” Plan Mode, no changes. Plan: “I want to add Google OAuth. What files need to change?” Still Plan Mode. Implement: “Implement the OAuth callback handler from your plan. Write tests. Run them and fix any failures.” Specific scope. Commit: “Commit with a descriptive message.”
Size tasks so Claude can finish and verify in a single pass. If you can describe the desired diff in one or two sentences, it’s the right size. “Add a created_at timestamp to the users table migration and update the model” is perfect. “Build the entire user management module” is too big.
Subagents and parallel sessions
When a task would bloat the main conversation’s context, Claude spawns subagents — separate instances that work on focused subtasks and report back. You can trigger this intentionally: ask Claude to review each file in a directory independently and compile results. Each subagent uses its own context window, keeping the main conversation clean. For cost efficiency, subagents typically use a cheaper model.
You can also run multiple sessions simultaneously. Push a long-running task to the background, start something new in the foreground, check back when it finishes. With the Desktop app, you manage sessions visually. With the --worktree flag, Claude creates separate git worktrees for each session, keeping changes isolated.
Skills, hooks, and MCP
Skills are reusable instruction sets that activate on demand based on context. Unlike CLAUDE.md (which loads every session), Skills only activate when relevant. A deployment skill loads when you say “deploy to production.” A code review checklist loads when you say “review this PR.” The more you invest in Skills, the less you repeat yourself. Chapter 13 covers Skills in depth.
Hooks are shell commands that execute at specific points in Claude’s lifecycle, guaranteed. Unlike instructions Claude might interpret loosely, hooks are deterministic. Auto-format every file Claude edits. Block edits to protected files. Run linters after every change. No asking, no hoping, no forgetting.
MCP (Model Context Protocol) gives Claude access to external services — GitHub, databases, Sentry, Figma, Notion. Connect a GitHub MCP server and Claude can read issues, create PRs, and interact with repos directly. Chapter 12 covers MCP in depth.
Cost management
Claude Code can burn through tokens fast. Use /cost regularly. Use the right model for the task: Opus for architecture decisions, Sonnet for everyday work, Haiku for simple tasks. Clear context aggressively. Scope tasks tightly.
Typical costs vary wildly. A simple bug fix might cost $0.10. A large refactoring session might hit $2-5. On focused feature days I spend $3-5. Architecture exploration days can hit $15. The subscription plans smooth this out if you use Claude Code daily.
Common failure patterns
Too-big tasks. Claude loses coherence when asked to do too much. Break it down.
CLAUDE.md too long. Prune aggressively. Each line should be something that, if removed, would cause mistakes.
Not clearing context. Old debugging sessions consume tokens and dilute attention.
No verification criteria. “Make the dashboard look better” gives Claude no feedback loop. “Implement this design, take a screenshot, compare differences” does.
Trusting without verifying. This is the one I still catch myself on. Claude Code is good enough that you start merging without reading the diff. Don’t. I once merged a migration that added a column to the wrong table. The column name was correct, the table name was wrong by one character. It passed the tests because the test was also generated by Claude with the same misunderstanding. Review the diff. Always review the diff.
The bottom line
Claude Code is not a toy. It’s a production tool that professional engineers use to ship real code at scale. 4% of GitHub commits is not a rounding error. It’s a trend line.
But it’s not magic. It’s an agentic system that works within constraints you need to understand: context windows fill up, large tasks need decomposition, and verification criteria matter more than clever prompting.
Set up a CLAUDE.md for one of your projects. Run /init to generate a starter. Add your build commands, code style rules, and git conventions. Then give Claude Code a real task — not a toy example — and see what happens. The first time it reads your codebase, writes a feature, runs the tests, fixes the failures, and commits with a clean message from a single instruction, you’ll understand why this is the future of development tooling.
This is the free web edition of Chapter 6. The full text — with Claude Code session transcripts, CLAUDE.md templates, configuration files, hook examples, and debugging walkthroughs — is available in 42: The AI Builder’s Stack, coming Q3 2026 on Amazon in hardcover, paperback, and digital.