12 prompt-design patterns · 7 agent failure modes · the internal mechanics behind the world's leading agentic coding tool, inferred from how it behaves. 60+ pages.
Everyone is building agents. Almost no one has taken apart one that actually works. Claude Code runs for hours, edits dozens of files, tests its own work, and ships. Underneath it: a prompt layer built as many small, single-purpose units, a precise request pipeline, a context engine that survives long sessions, and guardrails where most of the instructions describe what the agent must not do. This book reverse-engineers that machine into patterns you can paste into your own agent today.
Chapter 6 names all seven and gives each a verified fix.
You've probably met at least three. The fixes are in the book.
60+ pages · ~14,000 words · 10 chapters · a copy-paste toolkit.
| 1 | The Five-Layer Prompt Architecture — why a great agent's prompt is a filesystem, not a string |
| 2 | The Prompt Loading Flow — where the cache boundary stops you re-billing the whole static prompt every turn |
| 3–4 | The Twelve Patterns — constraint-first, cognitive boundaries, delegation, compaction, memory, skillification… |
| 5 | Print Mode & Autonomous Loops — signals, the auto-compaction threshold, headless loops |
| 6 | The Seven Agent Failure Modes — each with its root cause and verified fix |
| 7 | Sub-agents & Layered Delegation — the messaging asymmetry that silently kills multi-agent setups |
| 8 | The Autonomous Development Pipeline — prompt to verified build |
| 9 | Designing Your Own Harness — the whole book as five buildable subsystems |
| 10 | The Checklist & Templates — pre-flight checklist + paste-ready files |
CLAUDE.md.template — a constraint-first operating-rules file for any reposubagent-prompt.template.md — brief sub-agents so they don't silently failcontext-handoff.template.md — survive a context reset without losing the thread💖 Sponsor $25 to unlock all 10 chapters + toolkit
After you sponsor the $25 Inside Claude Code tier, you get a private-repo invite with the full PDF (English + 中文), the Markdown, and the toolkit — usually within a few hours. 赞助后即可解锁中英双语完整版。
Distilled from careful observation of how Claude Code behaves, inference about the request pipeline that behavior implies, and Anthropic's published guidance on long-running agent harnesses. Independent analysis and commentary — it describes patterns in original words and does not reproduce proprietary source code or prompt text. Not affiliated with Anthropic.
The book teaches the patterns; Harness Kit runs them. It's a free Claude Code plugin — five executable skills that turn the book's frameworks into commands you invoke: failure-mode-audit (run the 7 failure modes against any plan), claude-md-architect, subagent-brief, context-handoff, and harness-preflight.
Install free: /plugin marketplace add aimasteracc/harness-kit · see it on GitHub →
Use the kit, feel the difference, then get the full reasoning — all 12 patterns and the complete failure-mode treatment — in the book.