开始使用免费开始使用

Scope it before you run it

You're in the queries project now, and a ticket is waiting in task.md: send a Slack alert when an order has been sitting pending for too long.

A little orientation first, since this is your first time in the code. It's a TypeScript project, and every report is a function living in src/queries/, one file per topic. The one you need is already written: order_queries.ts has a getPendingOrders() function that does most of the lookup. Nothing in the project talks to Slack yet, so that part is genuinely new.

That mix, new code alongside code that already exists, is where an unscoped run tends to go wrong: Claude writes a second version of something that was already there. Plan mode keeps Claude in read-only mode and has it hand you a plan instead of code, so you can catch that before a single file changes. The habit that pays off is what comes next: read the plan, and push back on it.

本练习是课程的一部分

Claude Code in Action

查看课程

练习说明

  • Start Claude Code with claude.
  • Enter plan mode with /plan, then ask Claude to plan the work described in task.md. If there are initial follow-up questions from Claude, answer them any way you wish.
  • Read the plan, then ask Claude to revise it so it reuses the existing getPendingOrders() query instead of writing a new one.
  • Type /exit to exit Claude Code.

动手互动练习

通过我们的互动练习之一,将理论转化为实践

开始练习