Mental Models & Continuous Evolution

Beginner-Friendly Teaching Edition  ·  Ways of thinking that outlast features
What you will learn
The ideas the book considers more important than any specific technique: the three-layer model (Prompt / Context / Harness) and where to invest your time, a practical path to building your own Harness, a look under the hood (the agent loop, the tech stack, primitives, compression, permissions, memory), how the developer's identity is shifting, and how to keep up with a fast-moving tool.
Prompt layerContext layerHarness layerTAOR loopFrom "how" to "what"

The Big Idea

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.

Easy way to remember:
If you take one thing from the whole book: invest your time in building Context and Harness, not in optimizing Prompts.

Why This Topic Matters

  • Beginners pour all their energy into phrasing prompts — a layer with a low ceiling.
  • Understanding the internals explains "puzzling" behaviour (taking the long way, forgetting after /compact, Auto mode's varying prompts) — none of it is random.
  • The valuable skills are shifting from "how to write it" to "what to write"; knowing this tells you what to practise.

Core Concept: The Three-Layer Model

Prompt Layer
What you say — every line you type. "Add a login page." "Fix this bug." Most beginners never leave this layer.
Context Layer
What the AI can see before it responds — CLAUDE.md, file structure, git history, package.json. Read automatically; you don't repeat it. (Chapter 5 is about optimizing this layer.)
Harness Layer
The automation environment you build — Skills, Hooks, MCP, Agent Teams. Once built, it keeps working with no manual triggering.

The analogy

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.

Where the time should go

LayerHow you investReturn profile
PromptRe-invest every conversationOne-time return
ContextWrite CLAUDE.md once, it keeps workingCompounding return
HarnessBuild an automation once, it runs foreverExponential 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.

Step-by-Step: Building Your Own Harness (from nothing)

Step 1 — Start with CLAUDE.md (Context Layer)

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.

Step 2 — Turn repetitive actions into Skills (Harness Layer, beginner)

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.

Step 3 — Add Hooks for guaranteed consistency

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.

Step 4 — Connect to the outside world with MCP

MCPWhat it gives Claude
Browser MCPControl Chrome directly: take screenshots, fill forms, read web content
Feishu MCPCreate documents, send messages, manage knowledge bases
Filesystem MCPOperate on local files; useful for cross-project workflows

What a complete Harness looks like

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.

Remember: the point is not scale. It is that every time you meet something repetitive, forgotten, or broken, you lock the solution into the Context or Harness layer. Over six months this becomes a collaborator that understands you and makes fewer mistakes.

Under the Hood: How Claude Code Works

Understanding the mechanics makes previously puzzling behaviour make sense.

The core loop: Think → Act → Observe → Repeat (TAOR)

Think: analyze state, decide next step Act: call a tool, execute Observe: read result, assess completion Repeat: if unfinished, loop

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."

Why success criteria matter: the loop needs a stopping condition. Vague requirements mean Claude does not know when "done" is, so it keeps cycling. "Stop when tests pass" or "stop once the file is generated" makes it converge much faster.

The tech stack: React in your terminal

  • The terminal UI is rendered by React components (via React's Ink framework).
  • Runs on Bun (not Node.js), written in strict-mode TypeScript, with Zod for schema validation.
  • The entry file is ~785KB compressed — substantial, reflecting feature density.

This is why permission dialogs, multi-line syntax highlighting, and progress indicators feel smooth: React's component model makes them natural.

40+ tools, 4 capability primitives

PrimitiveWhat it doesTypical tools
ReadRead files, read code, search contentRead, Grep, Glob
WriteWrite files, edit codeWrite, Edit
ExecuteRun commands, execute scriptsBash
ConnectConnect to external servicesMCP 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.

Context compression: why long conversations "forget"

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."

Practical tip: put important constraints in 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.)

The permission system: more than yes/no

  • Auto mode is not blanket approval. A classifier rates each operation LOW / MEDIUM / HIGH risk. Reading a file is usually LOW (auto-approved); writing a config file is MEDIUM/HIGH (you confirm).
  • Some files are hardcoded as protected.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.
  • The explanation text in each permission dialog is generated in real time (a separate LLM call), so wording varies slightly each time — intentional, not instability.

Automatic memory maintenance

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."

A Shifting Identity: From Writing Code to Building Products

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 fluencyRequirement decomposition
Framework API memorizationArchitectural judgment
Manual debugging techniquesOutput quality review
Accumulating code templatesProduct 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.

If you're anxious about "will AI replace me": shift the frame — focus on learning to define requirements, design interactions, and review quality. These abilities won't lose value as AI gets stronger.

Real-World Timeline: Claude Code's Feature Pace

2024.11
MCP protocol launches — ability to connect to external services
2025.02
Public beta — from internal tool to public product
2025.05
GA release — significant stability improvements
2025.07
SubAgents — sub-processes for parallel work
2025.09
Hooks — event-driven automation
2025.10
Skills system — community can share and reuse capability packages
2026.02
Agent Teams officially launched — multi-agent collaboration in practical use
2026.03
Computer Use (control the screen) and Voice Mode (speak to the terminal); source code also accidentally made public

Roughly one major feature every two months — some specific steps in the book may need updating within three months of publication.

How to Keep Up

Primary official sources
• Claude Code official changelog
• Anthropic official blog
• Anthropic Academy (a dozen+ free courses)
From the creator and team
• Boris Cherny's X account (@bcherny)
• howborisusesclaudecode.com
• "How Anthropic Teams Use Claude Code" whitepaper
Podcasts for design philosophy
Lenny's Podcast (Boris on product design), Pragmatic Engineer (technical deep dive), YC Lightcone (founder perspective).
Don't track every minor update. Your time should go toward building things, not studying the tool. About 30 minutes browsing the changelog once a month is enough.

What actually deserves attention: the direction, not the features

Three threads have stayed constant for a year and a half:

  1. Autonomy keeps increasing — from step-by-step instructions to independent planning and execution.
  2. Context windows keep growing — 8K → 200K → 1M.
  3. Collaboration patterns keep evolving — single agent → SubAgents → Agent Teams.

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.

Recommended Resources

TierResourceWhy
EssentialClaude Code Best Practices (official docs)Authoritative source for all techniques, regularly updated
EssentialDeepLearning.AI × Anthropic course seriesCo-produced by Andrew Ng's team and Anthropic — systematic
EssentialAnthropic Academy (free courses)Prompt engineering through agent development
Essential"How Anthropic Teams Use Claude Code" whitepaperReal workflows, not theory
Going deeperawesome-claude-code (GitHub)Community-curated plugins, Skills, best practices
Going deeperClaude Code Ultimate Guide (community docs)Edge cases the official docs don't reach
Going deeperhowborisusesclaudecode.comBoris's complete workflow, continuously updated
Going deeperBoris on Lenny's Podcast / Pragmatic Engineer"What happens after coding is solved"; how Claude Code evolved

Visual Mental Model: Investment vs. Return

PROMPT   |###                      | one-time     (re-say it every session)
CONTEXT  |###############          | compounding  (write CLAUDE.md once)
HARNESS  |#########################| exponential  (build once, runs forever)

               ^ put your time here ─────────────┘

Important Comparisons

Prompt LayerContext LayerHarness Layer
Example"Fix this bug"CLAUDE.md, file tree, git historySkills, Hooks, MCP, Agent Teams
TriggeringManual, every timeAutomatic (read on start)Automatic (fires on events)
ReturnOne-timeCompoundingExponential
Old developer identityNew developer identity
80% time on "how to implement"80% time on "what to build"
Write a complete app from scratchJudge whether an app is well built
Syntax, APIs, manual debuggingRequirement decomposition, architecture, review, taste

Common Beginner Mistakes

  • Living entirely in the Prompt Layer — obsessing over phrasing, never building Context or Harness.
  • Re-explaining project rules every session instead of writing them into CLAUDE.md.
  • Giving vague tasks with no stopping condition, so the TAOR loop never converges.
  • Being surprised by "forgetting" after long sessions or /compact.
  • Reading Auto mode's varying dialog wording as instability.
  • Trying to track every changelog entry instead of building things.
  • Focusing on which command changed rather than the direction (autonomy, context size, collaboration).

Best Practices

  • Invest in Context and Harness, not Prompts.
  • Day one: create CLAUDE.md with Tech Stack, Conventions, Known Gotchas.
  • After a week or two: write your first Skill from the sentence you repeat most.
  • Use Hooks for anything that must never be forgotten (type-check on edit, re-inject rules after compaction).
  • Connect MCP only when the project needs external services.
  • Give clear success criteria so the agent loop knows when to stop.
  • Put constraints in CLAUDE.md, since conversation is lossy under compression.
  • Practise the new skills: requirement decomposition, architectural judgment, output review, product taste.
  • Spend ~30 minutes/month on the changelog; spend the rest building.

Interview / Revision Questions

  1. Name the three layers and give an example of each.
  2. What is the return profile of each layer, and where should your time go?
  3. Walk through the four steps of building a Harness from nothing.
  4. Why is the "Known Gotchas" section of CLAUDE.md so important?
  5. What does the root CLAUDE.md do in the author's mature Harness?
  6. What is the TAOR loop, and why does Claude sometimes "take the long way"?
  7. Why do clear success criteria make the loop converge faster?
  8. What are the four capability primitives, and why is the Bash tool "elegant"?
  9. Explain, mechanically, why long conversations "forget."
  10. How does Auto mode classify operations, and which files are hardcoded as protected?
  11. What four steps does the automatic memory sub-agent run, and what size does it target?
  12. What are the old vs. new skills, and what is the core shift in one phrase?
  13. Name the three constant directional threads over the last year and a half.

Practice Exercises

Exercise 1: For a real project, write a 3-section CLAUDE.md (Tech Stack, Conventions, Known Gotchas) with at least two real gotchas.
Exercise 2: Write a /ship Skill that runs tests, lints, commits, and pushes.
Exercise 3: Add a PostToolUse hook for type-checking and observe it firing after an edit.
Exercise 4: Take a task you gave Claude recently and rewrite it with an explicit stopping condition.
Exercise 5: Run /compact in a long session, then check which detail it lost — and move that detail into CLAUDE.md.
Exercise 6: List your own "old skills" and "new skills," and pick one new skill to deliberately practise this month.

Quick Memory Map

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

Complete Chapter Revision

  1. Ways of thinking outlast features; the key model is the three layers: Prompt, Context, Harness.
  2. Returns rise from one-time (Prompt) to compounding (Context) to exponential (Harness) — invest accordingly.
  3. Build a Harness in four steps: CLAUDE.md → Skills → Hooks → MCP; mature Harnesses use the root CLAUDE.md as a router.
  4. Lock every repetitive, forgotten, or broken thing into the Context or Harness layer.
  5. The engine is the TAOR loop (Think–Act–Observe–Repeat); it needs a clear stopping condition.
  6. Claude Code is React (Ink) on Bun; 40+ tools reduce to Read / Write / Execute / Connect, with Bash as a universal adapter.
  7. Context compression is lossy and cumulative — hence "forgetting"; put constraints in CLAUDE.md.
  8. The permission system uses a risk classifier, hardcoded protected files, and live-generated dialog text.
  9. A background sub-agent maintains your memory files (~200 lines), which is why Claude "understands you" more over time.
  10. The developer's identity shifts from "how to write it" to "what to write"; new skills are requirement decomposition, architecture judgment, review, and taste.
  11. Keep up by watching the direction (autonomy, context size, collaboration), not every feature; ~30 minutes/month is enough.
  12. The describe → review → iterate loop is the durable skill.

Final Takeaway

The chapter's central lesson:

Don't spend too much time studying the tool. Sink your knowledge into Context, automate with a Harness, and reserve the Prompt for real judgment. The distance from idea to product is now short — find a problem you genuinely want to solve, open a terminal, and start talking to Claude. When you get stuck, flip through the book. Then keep going.

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.