Leanpub Header

Skip to main content

Claude Code:从入门到精通

2026年智能体软件开发全指南

This book is 100% completeLast updated on 2026-07-15

软件开发领域正经历着快速变革,而 Claude Code 正处于这一变革的核心。《Mastering Claude Code》一书向开发者展示了如何高效地与 AI 智能体协作,从而编写代码、实现工作流自动化,并充满信心地应对大型项目。本书内容涵盖了从环境搭建、提示词(Prompt)设计到实际工程实践的方方面面,为那些希望了解 2026 年现代软件构建方式的读者提供了一份实用的行动指南。

This book is a translation into Chinese (Simplified) of Claude Code: From Basics to Mastery which was originally written in English

Minimum price

$19.00

$29.00

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
WEB
APP
137
Pages
About

About

About the Book

这是一份关于 Claude Code 的综合指南。Claude Code 是 Anthropic 推出的智能体(agentic)编码系统,它从根本上改变了软件构建的方式。无论你是刚接触 AI 辅助编程的开发者,还是希望掌握多智能体工作流的资深工程师,本书都将带你完成从初次安装到企业级部署的全过程。书中涵盖了 Claude Code 的架构、提示词工程(prompt engineering)技巧、来自 Stripe 和 Wiz 的实际案例研究、CI/CD 自动化、安全最佳实践以及智能体编码的未来展望。每一章都包含实用示例、动手实践项目以及基于数十万次真实 Claude Code 会话研究得出的可操作指导。

This book is a translation into Chinese (Simplified) of Claude Code: From Basics to Mastery which was originally written in English

Author

About the Author

Steve Publications

Steve is a technology professional with more than 20 years of experience in software development, server infrastructure, cybersecurity, vulnerability research and reverse engineering. Throughout his career, he has designed, secured, analyzed and tested complex software and infrastructure, with a particular focus on understanding how systems fail and how they can be made more secure.

Outside of work, Steve enjoys sharing knowledge with the technology community. He collaborates with researchers, industry experts and technology professionals to write practical books covering software development, cybersecurity, cloud computing, networking, DevOps, artificial intelligence and enterprise technologies. His books focus on practical learning through clear explanations, real-world examples and hands-on exercises. With more than two decades of industry experience, his goal is to help IT professionals, students and technology enthusiasts build useful skills and stay current in a rapidly changing industry.

We believe readers deserve to know how our books are created. Most of our authors are not native English speakers, so we use AI to help translate, proofread manuscripts, fix grammar, improve sentence structure and make technical explanations easier to read. AI is used as an editing tool only. It does not replace the research, technical knowledge or hands-on experience behind our books. Some of our authors also prefer to remain anonymous for privacy or professional reasons. In those cases, we publish their work under a different name. The author's name may be different, but the quality of the content and our review process remain the same.

Every book is written, reviewed and maintained by experienced technology professionals, with contributions from our private technical community of more than 400 engineers and researchers from Ukraine, Belarus and Russia. We spend far more time validating technical accuracy and keeping our content up to date than generating text. We are always interested in working with experienced professionals who have deep expertise in a particular technology or domain. If you would like to publish a book with us or help review an existing manuscript, we'd love to hear from you. Send us a message describing your area of expertise. We are especially interested in niche technologies, specialized skills and emerging topics that are underrepresented in existing technical literature.

If you look through the contents of our books, you'll see practical examples, detailed explanations and material that is regularly updated. Our goal is to publish books that professionals can actually rely on, not low-effort AI-generated content. If you ever feel that one of our books does not meet that standard, Leanpub offers a 60-day money-back guarantee. Feel free to request a refund if you are not satisfied with your purchase.

Translations

Translations

Contents

Table of Contents

2026 年智能体软件开发完全指南

  1. 掌握 Claude Code、多智能体工作流与企业级部署的综合手册

引言:不再敲代码的工程师

  1. 本书将教会你什么
  2. 本书适合谁
  3. 如何使用本书
  4. 证据基础
  5. 关于本书不涵盖内容的说明
  6. 核心论点
  7. 2026 年的格局

第 1 章:软件开发中的智能体革命

  1. 从自动补全到智能体:五年的演进
  2. 是什么让 Claude Code 与众不同:以终端为优先的智能体架构
  3. Boris Cherny 的工作流:创建者如何使用 Claude Code
  4. 劳动分工:人类作为编排者,智能体作为构建者
  5. 2026 年 AI 编码智能体格局
  6. 为什么是现在?市场采用与向智能体工作流的转变
  7. 批判性分析:智能体工具的权衡与局限性

第 2 章:Claude Code 的解剖

  1. 智能体循环:收集、行动、验证
  2. 幕后模型:Sonnet、Opus、Fable 与模型选择
  3. Token 管理数学:理解你的支出
  4. 内置工具:文件操作、搜索、执行、网络、代码智能
  5. .claude 目录:配置、CLAUDE.md 与记忆
  6. 上下文窗口:如何填充、自动压缩与 Token 管理

第 3 章:入门与设置

  1. 跨平台安装:macOS、Linux、Windows、WSL、Homebrew、WinGet
  2. 认证与账户设置
  3. 你的第一次会话:从零到代码的演练
  4. 权限模式:默认、自动接受、Plan 与自动模式
  5. IDE 集成:VS Code、JetBrains、远程控制、Web 界面

第 4 章:Claude Code 的提示工程

  1. Claude 提示的艺术:具体性、上下文与验证
  2. CLAUDE.md 作为持久指令层
  3. 少样本示例、XML 结构化与角色分配
  4. “采访我“模式:让 Claude 在编码前提问
  5. 提示链与会话间状态管理
  6. 常见失败模式及如何避免
  7. 对抗测试:压力测试 Claude Code 的输出

第 5 章:真实世界开发工作流

  1. 从零构建全栈应用(动手项目)
  2. 重构遗留代码库:Stripe 的 Scala 到 Java 迁移案例研究
  3. 调试复杂 Bug:逐步演练
  4. 大规模代码迁移:Wiz 的 Python 到 Go 迁移
  5. 入门不熟悉代码库

第 6 章:测试、验证与质量保证

  1. 给 Claude 一个可验证的目标
  2. 测试生成与自我修复测试
  3. Outcomes:自动化量规评分
  4. 使用并行会话的作者/审查者模式
  5. 代码审查技能与对抗审查策略
  6. CI/CD 集成:GitHub Actions、GitLab CI 与自动化 PR

第 7 章:自动化与扩展

  1. 无头模式:用于脚本和流水线的非交互式 Claude Code
  2. 扇出模式:并行处理数千个文件
  3. Claude Code 例程:定时任务和事件驱动工作流
  4. Pre-commit 钩子、Linting 与自动化代码质量门控
  5. 大规模成本管理与时序预算

第 8 章:高级智能体模式

  1. 子智能体:委派调查与验证
  2. 技能:创建可复用的领域知识和工作流
  3. MCP 服务器:连接到外部系统(GitHub、数据库、Jira)
  4. 钩子:跨会话的自动化策略执行
  5. 多智能体编排:主智能体、专业子智能体、共享文件系统
  6. Claude 托管智能体与“ Dreaming“功能

第 9 章:部署与生产就绪

  1. 将 Claude Code 构建的应用部署到云平台
  2. 环境配置与密钥管理
  3. 监控与可观测性:OpenTelemetry、使用分析、Token 跟踪
  4. 性能优化:提示缓存、模型选择、上下文效率
  5. 从原型到生产:Rakuten 的案例研究

第 10 章:团队协作与企业部署

  1. Claude Code 大规模部署:Stripe 的 1,370 名工程师部署
  2. 托管设置、企业安全与合规
  3. 共享 CLAUDE.md、技能库与插件分发
  4. 将 Claude Code 集成到现有团队工作流

第 11 章:安全深入探讨

  1. 已记录的漏洞:CVE-2025-59536 和 CVE-2026-21852
  2. 提示注入与恶意文件内容
  3. 上下文加载中的密钥暴露
  4. —dangerously-skip-permissions 标志:何时以及如何安全使用
  5. 沙盒:Docker、开发容器与 VM 隔离
  6. 企业安全架构:MDM、LLM 网关、智能体监控

第 12 章:智能体编码的未来

  1. Anthropic 路线图:Dreaming、Outcomes、多智能体编排
  2. 关于专业知识的研���:为什么领域知识胜过编码背景
  3. 塑造 2026 年及以后智能体编码的八大趋势
  4. 软件工程师角色的转变
  5. 这对工作和知识经济的未来意味着什么

第 13 章:结论:成为智能体工程师

  1. 综合从新手到大师的旅程
  2. 软件开发的新型思维模型
  3. 构建你的 Claude Code 实践:个人行动计划
  4. 展望未来:未来五年带我们去向

参考文献

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub