Claude Code 实践教程

通过逐步指南和真实示例掌握 Claude Code 的强大功能。从日常工作流到高级自动化,系统性学习。

快速入门教程

恢复之前的对话

学习如何在中断工作后从停止的地方继续。

继续最新对话

claude --continue

使用对话选择器

claude --resume

💡 技巧: 使用 /memory 命令在恢复前检查对话上下文。

理解新的代码库

学习如何快速理解初次接触项目的结构和架构。

获取整体概览

give me an overview of this codebase

查找特定功能

find the files that handle user authentication

技巧: 从广泛的问题开始,逐渐缩小到具体领域。Claude Opus 4 增强的上下文理解能力实现更准确的分析。

核心工作流教程

高效的错误修复

从错误消息分析到根本原因识别和修复实施的完整过程

I'm seeing an error when I run npm test
suggest a few ways to fix the @ts-ignore

代码重构

如何安全地将遗留代码更新为现代模式

find deprecated API usage in our codebase
refactor utils.js to use ES2024 features

测试工作

添加测试覆盖率、分析失败测试、发现边界情况

add tests for the notification service
explain why this test is failing

PR 创建

从变更摘要到详细 PR 描述创建的自动化

create a pr
enhance the PR description with more context

文档化

代码注释、API 文档和 README 更新的自动化

add JSDoc comments to auth.js
update the README with latest changes

图像工作

使用截图、图表和设计原型进行开发

拖放添加图像
Generate CSS to match this design mockup

现在就开始教程

跟随逐步指南,逐一学习 Claude Code 的强大功能。从基本命令到高级自动化,获得可立即应用于工作的实践知识。