╭─── Claude Code v2.1.56 ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ │ Tips for getting started │ │ Welcome back! │ Run /init to create a CLAUDE.md file with instructions for Claude │ │ │ ───────────────────────────────────────────────────────────────── │ │ │ Recent activity │ │ ▐▛███▜▌ │ No recent activity │ │ ▝▜█████▛▘ │ │ │ ▘▘ ▝▝ │ │ │ deepseek-chat · API Usage Billing │ │ │ ~/ocode │ │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
/model to try Opus 4.6
! pwd ⎿ /home/zjykzj/ocode
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ! ls ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ! for bash mode
Claude Code 是一个代理式编码环境。与等待回答问题的聊天机器人不同,Claude Code 可以读取你的文件、运行命令、进行更改,并在你观看、重定向或完全离开的情况下自主解决问题。
这改变了你的工作方式。与其自己编写代码并要求 Claude 审查,不如描述你想要什么,Claude 会想出如何构建它。Claude 会探索、规划和实现。
先探索,再规划,再编码
探索
进入 Plan Mode。Claude 读取文件并回答问题,不进行任何更改。
read /src/auth and understand how we handle sessions and login. also look at how we manage environment variables for secrets.
规划
要求 Claude 创建详细的实现计划。
I want to add Google OAuth. What files need to change? What’s the session flow? Create a plan.
按 Ctrl+G 在文本编辑器中打开计划进行直接编辑,然后 Claude 继续。
实现
切换回 Normal Mode 并让 Claude 编码,根据其计划进行验证。
implement the OAuth flow from your plan. write tests for the callback handler, run the test suite and fix any failures.
提交
要求 Claude 使用描述性消息进行提交并创建 PR。
commit with a descriptive message and open a PR
在提示中提供具体上下文
编写有效的 CLAUDE.md
CLAUDE.md 是一个特殊文件,Claude 在每次对话开始时都会读取。包括 Bash 命令、代码风格和工作流规则。这给 Claude 提供了它无法从代码中推断的持久上下文。
/init 命令分析你的代码库以检测构建系统、测试框架和代码模式,为你提供坚实的基础来精化。
1 2 3 4 5 6 7
# Code style - Use ES modules (import/export) syntax, not CommonJS (require) - Destructure imports when possible (eg. import { foo } from 'bar')
# Workflow - Be sure to typecheck when you're done making a series of code changes - Prefer running single tests, and not the whole test suite, for performance
Quick safety check: Is this a project you created or one you trust? (Like your own code, a well-known open source project, or work from your team). If not, take a moment to review what's in this folder first.
Claude Code'll be able to read, edit, and execute files here.
Security guide
❯ 1. Yes, I trust this folder 2. No, exit
Enter to confirm · Esc to cancel $ claude
╭─── Claude Code v2.1.56 ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ │ Tips for getting started │ │ Welcome back! │ Ask Claude to create a new app or clone a repository │ │ │ ──────────────────────────────────────────────────── │ │ │ Recent activity │ │ ▐▛███▜▌ │ No recent activity │ │ ▝▜█████▛▘ │ │ │ ▘▘ ▝▝ │ │ │ deepseek-chat · API Usage Billing │ │ │ ~/ocode/snack │ │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── Ready to code?
Here is Claude's plan: ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ 贪吃蛇游戏开发计划
Claude has written up a plan and is ready to execute. Would you like to proceed?
1. Yes, clear context (12% used) and auto-accept edits (shift+tab) ❯ 2. Yes, auto-accept edits 3. Yes, manually approve edits 4. Type here to tell Claude what to change
ctrl-g to edit in VS Code · ~/.claude/plans/parallel-mapping-russell.md