Summary

A practitioner’s deep dive into Claude Code’s architecture after six months of intensive use, covering six layers: context management, concept boundaries (MCP/Plugin/Tools/Skills/Hooks/Subagents), context engineering, skill/hook design, subagent patterns, and CLAUDE.md best practices. The author reframes Claude Code not as a chatbot but as a repeating agent loop (collect context → take action → verify result), and shows how understanding each layer prevents common failure modes.

作者基於六個月密集使用 Claude Code 的實踐,深度剖析其架構的六個層次:上下文管理、概念邊界、上下文工程、Skills/Hooks 設計、Subagents 用法和 CLAUDE.md 撰寫。核心觀點:Claude Code 不是聊天機器人,而是一個反覆循環的代理過程,理解每個層次才能避免常見失敗。

Key Points

  • Claude Code is an agent loop: collect context → take action → verify result → repeat; not a chatbot
  • 200K context is not fully available: CLAUDE.md, tools, memory all consume tokens; effective context is smaller
  • Concept clarity: Tools/MCP add new capabilities; Skills define workflows; Subagents isolate execution; Hooks enforce constraints; Plugins distribute across projects
  • Context problems are usually “too noisy” not “too short” — useful signal drowned by irrelevant content
  • Unstable results → check context loading order; runaway automation → check control layer design; long session degradation → start fresh session
  • CLAUDE.md too long pollutes the context it’s meant to help

Insights

The six-layer mental model is a useful diagnostic framework: most Claude Code failures can be traced to a specific layer being misconfigured. The insight that context anxiety (prematurely ending long tasks) is a model-capability issue that progressed across Claude versions (Sonnet 4.5 had it, Opus 4.5 doesn’t) is valuable for understanding when to upgrade vs. when to architect around it. The warning against over-tooling — “more tools = worse selection” — directly contradicts the intuition to add more capabilities.

Connections

Raw Excerpt

只强化其中一层,系统就会失衡:CLAUDE.md 写太长,上下文先污染自己了;工具堆太多了,选择就搞不清楚了;subagents 开得到处都是,状态就漂移了。