From LLMs, Agents, and Harnesses to Mini Claude Code: System Architecture and Engineering Practice
AI Agent Architecture and Engineering Practice Guide is a technical book focused on the architecture, mechanisms, and engineering practices behind modern AI Agent systems. The book is currently under active development and is planned to contain approximately 630,000 Chinese characters, 54 chapters, and 4 appendices. It is written from an application architecture perspective, with the goal of building a systematic understanding of how AI Agents evolve from simple LLM-based applications into reliable, extensible, production-grade and enterprise-level systems.
The book focuses on a central architectural idea: Agent = LLM + Harness. The LLM provides reasoning and generation capabilities, while the Harness provides the engineering mechanisms required to make an Agent useful and controllableβincluding context management, tool execution, permissions, state and persistence, observability, execution control, extensibility, and multi-agent coordination. Starting from LLM fundamentals and the Agent Loop, the book progressively explores Agent Harness architecture, Claude Code as a representative Coding Agent, the design and implementation of a Mini Claude Code, production-grade Agent systems, and enterprise Agent platforms. The ultimate goal is not simply to understand how a particular Agent product works, but to derive generalizable architectural principles and engineering methods for designing AI Agent systems.
The book is organized into seven parts, following a progressive path from foundational concepts to system architecture and advanced engineering practices:
LLM Fundamentals
β
LLM Application
β
Agent
β
Agent Loop
β
Agent Harness
β
Coding Agent
β
Production Agent
β
Enterprise Agent Platform
β
Next-Generation Agent ArchitectureThe Core Objective
The book ultimately aims to help readers move beyond simply calling an LLM API or using an AI Agent product.
The key question is:
How do we design an AI Agent system that can reason, use tools, manage context and state, operate within controlled boundaries, recover from failures, and reliably execute complex tasks in the real world?
Using Claude Code as one representative engineering case, the book explores the architectural principles behind modern Agent systems and develops a reusable methodology for designing, implementing, evaluating, securing, and operating production-grade AI Agents.
The intended outcome is not merely to understand Claude Code, but to understand the broader architecture behind AI Agent systems as a new class of software applications.
Book Structure and Progress
The following table shows the current structure and writing progress of the book.
Status
- π’ Published β Completed and publicly available
- π‘ In Progress β Currently being written
- βͺ Not Started β Planned but not yet started
Part I β AI Agent Fundamentals
| Chapter | Title | Status |
|---|---|---|
| 1 | Rethinking AI Agents | π’ Published |
| 2 | LLM Application Architecture: Core Components and Engineering | π’ Published |
| 3 | AI Agent Loop: The Core Architecture Behind Modern AI Agents | π’ Published |
Progress: 3 / 3
Part II β Agent Harness
This part introduces the core infrastructure surrounding an Agent and explains how an Agent evolves from a simple loop into a controllable and extensible system.
| Chapter | Key Topic | Status |
|---|---|---|
| 4 | What Is an Agent Harness? | π’ Published |
| 5 | Major AI Agent Architecture Patterns | π’ Published |
| 6 | Context Engineering | π‘ In Progress |
| 7 | Tool System | π‘ In Progress |
| 8 | Command | π‘ In Progress |
| 9 | Skill | βͺ Not Started |
| 10 | MCP | βͺ Not Started |
| 11 | Permission | βͺ Not Started |
| 12 | Hook | βͺ Not Started |
| 13 | Plugin | βͺ Not Started |
| 14 | Storage | βͺ Not Started |
| 15 | Observability | βͺ Not Started |
Progress: 4 / 12 published or in progress
Part III β Claude Code Source Architecture
This part examines Claude Code from an architectural and source-code perspective, using it as a representative example for understanding the internal design of a mature Coding Agent.
| Chapter | Key Topic | Status |
|---|---|---|
| 16 | What is Claude Code? | βͺ Not Started |
| 17 | 2026-03-31 Claude Code Source Leak | βͺ Not Started |
| 18 | Overall Source Architecture | βͺ Not Started |
| 19 | Agent Loop Source | βͺ Not Started |
| 20 | Tool Architecture Source | βͺ Not Started |
| 21 | Context Management Source | βͺ Not Started |
| 22 | Command Source | βͺ Not Started |
| 23 | Skill Source | βͺ Not Started |
| 24 | MCP Source | βͺ Not Started |
| 25 | Permission Source | βͺ Not Started |
| 26 | Hook Source | βͺ Not Started |
| 27 | Plugin Source | βͺ Not Started |
| 28 | Session / Storage Source | βͺ Not Started |
| 29 | Observability Source | βͺ Not Started |
| 30 | Subagent Architecture | βͺ Not Started |
Progress: 0 / 15
Part IV β Building Mini Claude Code
This part moves from architectural understanding to hands-on implementation, progressively building a simplified Coding Agent and implementing the major components of an Agent Harness.
| Chapter | Key Topic | Status |
|---|---|---|
| 31 | Project Architecture | βͺ Not Started |
| 32 | Model Layer | βͺ Not Started |
| 33 | Tool Runtime | βͺ Not Started |
| 34 | Agent Loop | βͺ Not Started |
| 35 | Context Engine | βͺ Not Started |
| 36 | Command | βͺ Not Started |
| 37 | Skill | βͺ Not Started |
| 38 | MCP | βͺ Not Started |
| 39 | Permission Engine | βͺ Not Started |
| 40 | Hook | βͺ Not Started |
| 41 | Plugin | βͺ Not Started |
| 42 | Session / Memory | βͺ Not Started |
| 43 | Storage | βͺ Not Started |
| 44 | Subagent | βͺ Not Started |
| 45 | Observability | βͺ Not Started |
Progress: 0 / 15
Part V β Advanced Coding Agents
This part explores how a basic Coding Agent evolves into a system capable of handling more complex and long-running software engineering tasks.
| Chapter | Key Topic | Status |
|---|---|---|
| 46 | Coding Agent: Code Understanding | βͺ Not Started |
| 47 | Self-Correction | βͺ Not Started |
| 48 | Long-Running Agent | βͺ Not Started |
Progress: 0 / 3
Part VI β Production-Grade AI Agent Architecture
This part focuses on the engineering requirements of production and enterprise environments, including observability, evaluation, security, governance, and platform architecture.
| Chapter | Key Topic | Status |
|---|---|---|
| 49 | Production Agent Observability | βͺ Not Started |
| 50 | Agent Evaluation | βͺ Not Started |
| 51 | Agent Security Architecture | βͺ Not Started |
| 52 | Enterprise Agent Platform | βͺ Not Started |
Progress: 0 / 4
Part VII β Next-Generation Agent Architecture
The final part abstracts the architectural lessons learned throughout the book and explores where AI Agent architectures may evolve next.
| Chapter | Key Topic | Status |
|---|---|---|
| 53 | Claude Code Architecture Design Philosophy | βͺ Not Started |
| 54 | Future AI Agent Architecture | βͺ Not Started |
Progress: 0 / 2
Appendices
| Appendix | Key Topic | Status |
|---|---|---|
| A | Source Code Reading Map | βͺ Not Started |
| B | Source Code Key Module Index | βͺ Not Started |
| C | Complete Mini Claude Code Code | βͺ Not Started |
| D | Agent Architecture Checklist | βͺ Not Started |
Progress: 0 / 4




It may take more than 1 years to finish all these contents.