Tools go obsolete and features get updated, but good ways of thinking never lose their value. This final teaching chapter steps back from specific operations to the models that stay useful.
/compact, Auto mode's varying prompts) — none of it is random.CLAUDE.md, file structure, git history, package.json. Read automatically; you don't repeat it. (Chapter 5 is about optimizing this layer.)The Prompt is you speaking. The Context is the presentation you prepared in advance. The Harness is the entire stage you built. The audience (Claude) performs according to the combined quality of all three.
| Layer | How you invest | Return profile |
|---|---|---|
| Prompt | Re-invest every conversation | One-time return |
| Context | Write CLAUDE.md once, it keeps working | Compounding return |
| Harness | Build an automation once, it runs forever | Exponential return |
Experts sink information into the Context Layer, hand off repetitive work to the Harness Layer, and use the Prompt Layer only for decisions that genuinely require in-the-moment judgment.
On day one of a new project, create CLAUDE.md with just three sections:
# Project Name
## Tech Stack
- Next.js 15 + TypeScript + Tailwind CSS
- PostgreSQL + Drizzle ORM
## Conventions
- Components go in src/components/, organized into feature subdirectories
- API routes go in src/app/api/
- Commit messages in English, format: type: description
## Known Gotchas
- Drizzle's migrate command requires DATABASE_URL to be exported first
- When deploying to Vercel, env variable names cannot start with an underscore
The "Known Gotchas" section is especially important. Every time you hit a snag, tell Claude
"remember this" and it writes it into CLAUDE.md; next time it proactively avoids the trap. This is
the "mistake → document → iterate" flywheel.
After a week or two you will notice yourself saying the same things — e.g. "run the tests, lint it, then
commit." That is your first Skill. In .claude/skills/ship/SKILL.md:
---
description: Standard workflow for shipping code
---
1. Run all tests and confirm they pass
2. Run eslint --fix to format the code
3. git add changed files (do not add .env or other sensitive files)
4. Generate a concise commit message and commit
5. If a remote branch exists, push to remote
From then on, type /ship and all five steps run automatically.
Skills are suggestions Claude can forget. For things that absolutely cannot be forgotten, use Hooks. The
author has a PostToolUse hook that runs type-checking on every TypeScript edit, and a
PostCompact hook that re-injects three core rules after context compression.
| MCP | What it gives Claude |
|---|---|
| Browser MCP | Control Chrome directly: take screenshots, fill forms, read web content |
| Feishu MCP | Create documents, send messages, manage knowledge bases |
| Filesystem MCP | Operate on local files; useful for cross-project workflows |
CLAUDE.md <- Router: dispatches by task keyword (kept under 8KB)
01-WeChat-Writing/
CLAUDE.md <- Writing style, editing rules, publishing workflow
Projects/2026.03-SomeProject/
README.md <- Project status and file descriptions
.claude/
skills/
huashu-proofreading/ <- Three-pass editing
huashu-research/ <- Structured research
huashu-image-upload/ <- Image generation + upload
huashu-feishu/ <- Feishu document operations
... (60+ skills)
settings.json <- Hooks configuration
.mcp.json <- MCP server configuration
The root CLAUDE.md's only job is routing: keyword "write article" → read the
WeChat writing CLAUDE.md; "make video" → the video production one. Each workspace has its
own rules and they do not interfere.
Understanding the mechanics makes previously puzzling behaviour make sense.
It does not generate one block of code and hand it over. It cycles — sometimes dozens of times — making each step a decision on fresh observations. Sometimes it tries an approach, finds it fails, backtracks, and tries another path. That is by design, not a bug — and it explains why Claude sometimes "takes the long way."
This is why permission dialogs, multi-line syntax highlighting, and progress indicators feel smooth: React's component model makes them natural.
| Primitive | What it does | Typical tools |
|---|---|---|
| Read | Read files, read code, search content | Read, Grep, Glob |
| Write | Write files, edit code | Write, Edit |
| Execute | Run commands, execute scripts | Bash |
| Connect | Connect to external services | MCP tools, WebFetch |
The elegant part is the Bash tool — a universal adapter that lets Claude use every
command-line tool developers rely on (npm install, python test.py, git push).
No per-language integrations or per-framework plugins. This is why Claude Code works across virtually any
tech stack, unlike language-specific IDE plugins.
When the context window nears capacity, the system compresses the whole conversation history into a summary. That summary becomes the next round's starting point; the original is discarded. Compression is lossy — core information survives, but specific wording, edge-case details, and tone tend to get lost. In long sessions with multiple compressions, loss accumulates; your earliest context may survive only as a "vague shadow."
CLAUDE.md, not in
a one-off conversation line. Conversations get compressed; CLAUDE.md gets re-read every time.
(Same conclusion as the three-layer model: sink information into the Context Layer.).gitconfig, .bashrc, .zshrc and other system configs — handled with extra caution regardless of mode. There is even a defence against path-traversal attacks via unicode or mixed case.A background sub-agent periodically organizes your memory files in four steps: review existing content, extract new useful information, consolidate duplicates, trim overgrown sections — keeping memory around 200 lines. This is why Claude Code feels like it "understands you better" over time: your preferences and project context are being slowly accumulated and maintained.
The book's framing: you do not need engine mechanics to drive a car — but once you know how the loop turns, how context compresses, and how permissions are evaluated, you know "when to shift gears."
Boris Cherny (creator of Claude Code) has said over 90% of his code is generated by Claude Code; his work now looks like describing requirements, reviewing output, making architectural decisions — "a product manager with strong technical judgment." The author has never written code by hand, including for Kitty Light (#1 App Store paid chart).
| Old skills (declining importance) | New skills (rising importance) |
|---|---|
| Syntax fluency | Requirement decomposition |
| Framework API memorization | Architectural judgment |
| Manual debugging techniques | Output quality review |
| Accumulating code templates | Product taste |
"Declining importance," not "useless" — understanding code still helps you describe requirements precisely and evaluate output accurately. But you no longer need to write a complete application from scratch; you need to judge whether an application is well built. The core shift: from "how to write it" to "what to write" — the old 80/20 (how/what) ratio reverses.
Roughly one major feature every two months — some specific steps in the book may need updating within three months of publication.
Three threads have stayed constant for a year and a half:
So "how to collaborate with AI" won't go stale. Specific commands may change, but the core loop describe requirements → review output → iterate is not going anywhere soon.
| Tier | Resource | Why |
|---|---|---|
| Essential | Claude Code Best Practices (official docs) | Authoritative source for all techniques, regularly updated |
| Essential | DeepLearning.AI × Anthropic course series | Co-produced by Andrew Ng's team and Anthropic — systematic |
| Essential | Anthropic Academy (free courses) | Prompt engineering through agent development |
| Essential | "How Anthropic Teams Use Claude Code" whitepaper | Real workflows, not theory |
| Going deeper | awesome-claude-code (GitHub) | Community-curated plugins, Skills, best practices |
| Going deeper | Claude Code Ultimate Guide (community docs) | Edge cases the official docs don't reach |
| Going deeper | howborisusesclaudecode.com | Boris's complete workflow, continuously updated |
| Going deeper | Boris on Lenny's Podcast / Pragmatic Engineer | "What happens after coding is solved"; how Claude Code evolved |
PROMPT |### | one-time (re-say it every session)
CONTEXT |############### | compounding (write CLAUDE.md once)
HARNESS |#########################| exponential (build once, runs forever)
^ put your time here ─────────────┘
| Prompt Layer | Context Layer | Harness Layer | |
|---|---|---|---|
| Example | "Fix this bug" | CLAUDE.md, file tree, git history | Skills, Hooks, MCP, Agent Teams |
| Triggering | Manual, every time | Automatic (read on start) | Automatic (fires on events) |
| Return | One-time | Compounding | Exponential |
| Old developer identity | New developer identity |
|---|---|
| 80% time on "how to implement" | 80% time on "what to build" |
| Write a complete app from scratch | Judge whether an app is well built |
| Syntax, APIs, manual debugging | Requirement decomposition, architecture, review, taste |
CLAUDE.md./compact.CLAUDE.md with Tech Stack, Conventions, Known Gotchas.CLAUDE.md, since conversation is lossy under compression.CLAUDE.md so important?CLAUDE.md do in the author's mature Harness?CLAUDE.md (Tech Stack, Conventions, Known Gotchas) with at least two real gotchas./ship Skill that runs tests, lints, commits, and pushes.PostToolUse hook for type-checking and observe it firing after an edit./compact in a long session, then check which detail it lost — and move that detail into CLAUDE.md.Mental Models & Continuous Evolution
│
├── Three-Layer Model
│ ├── Prompt = what you say -> one-time
│ ├── Context = what AI can see -> compounding (CLAUDE.md)
│ └── Harness = automation you build -> exponential (Skills/Hooks/MCP/Teams)
│ RULE: invest in Context + Harness
│
├── Build a Harness
│ 1 CLAUDE.md (Tech Stack / Conventions / Known Gotchas)
│ 2 Skills (/ship = test, lint, commit, push)
│ 3 Hooks (PostToolUse type-check, PostCompact re-inject)
│ 4 MCP (Browser / Feishu / Filesystem)
│ -> mature: root CLAUDE.md as keyword router
│
├── Under the hood
│ ├── TAOR loop: Think -> Act -> Observe -> Repeat (needs a stop condition)
│ ├── React (Ink) on Bun, TypeScript + Zod
│ ├── 4 primitives: Read / Write / Execute / Connect (Bash = universal adapter)
│ ├── Compression is lossy + cumulative -> forgetting
│ ├── Permissions: LOW/MED/HIGH classifier; protected dotfiles; live-generated text
│ └── Background sub-agent maintains memory (~200 lines)
│
├── Identity shift: "how to write" -> "what to write"
│ new skills: requirement decomposition, architecture, review, taste
│
└── Keeping up
├── ~30 min/month on the changelog; build the rest of the time
└── Direction (constant): autonomy up, context up, collaboration evolving
Core loop stays: describe -> review -> iterate
CLAUDE.md → Skills → Hooks → MCP; mature Harnesses use the root CLAUDE.md as a router.CLAUDE.md.This teaching edition is based on the supplied April 2026, 2nd edition of Claude Code: The Complete Guide (§10, "Mental Models & Continuous Evolution"). Internal architecture details (Bun, Ink, Zod, tool counts, entry-file size), the feature timeline, and resource lists reflect that edition and may change over time.