VideCoding - Claude Code 核心工作流 (Core Workflow)
欢迎关注我的CSDNhttps://spike.blog.csdn.net/本文地址https://spike.blog.csdn.net/article/details/159921522免责声明本文来源于个人知识与公开资料仅用于学术交流欢迎讨论不支持转载。Claude Code 作为 Anthropic 推出的 CLI 编程助手经过不断迭代已经形成了一套成熟高效的工作流程。详细介绍 Claude Code 的核心工作流帮助开发者更好地利用这款工具提升编程效率。1. Plan 模式shift tab - plan mode on切换 Plan 模式Plan 模式 Claude 只规划不执行读取文件、理解代码、不修改给出详尽的方案改哪些文件、怎么改反复讨论、修改方案Ctrl G 使用编辑器输入完整的项目计划切换 accept edits on 模式完整执行 plan 规划需要解释才能执行的任务使用 Plan 模式一句话说清的任务直接执行。Plan 模式2. Auto 模式根据统计 93% 的需求被直接批准了auto 模式一阶段Prompt Injection Detector 搜索内容避免 Claude 被劫持增加警告auto 模式二阶段Transcript Classifier在操作执行前评估操作的风险第一阶段快速判断误报8.5%第二阶段深度推理误报0.4%claude --permission-mode auto 开启 auto 模式位置位于 ~/.claude/settings.json更加危险且自有模型claude --dangerously-skip-permissions/permissions预授权安全命令写入本地项目的 .claude/settings.local.json 用于管理项目其中claude --permission-mode autoauto 模式的提示选择即───────────────────────────────────────────────────────────────────────────────────────────────────────────────────── Enable auto mode? Auto mode lets Claude handle permission prompts automatically — Claude checks each tool callforrisky actions and prompt injection before executing. Actions Claude identifies as safe are executed,whileactions Claude identifies as risky are blocked and Claude may try a different approach. Idealforlong-running tasks. Sessions are slightlymoreexpensive. Claude canmakemistakes that allow harmful commands to run, its recommended to only useinisolated environments. ShiftTab to change mode. https://code.claude.com/docs/en/security ❯1. Yes, andmakeit my default mode2. Yes,enableauto mode3. No,exit如果选择【1】是默认auto模式如果选择【2】是启用auto模式。模式【1】修改如下cat~/.claude/settings.json{env:{ANTHROPIC_AUTH_TOKEN:[your token],ANTHROPIC_BASE_URL:https://ark.cn-beijing.volces.com/api/coding,ANTHROPIC_MODEL:ark-code-latest},skipAutoPermissionPrompt:true,permissions:{defaultMode:auto}}其中claude --dangerously-skip-permissions高风险跳过权限提示───────────────────────────────────────────────────────────────────────────────────────────────────────────────────── WARNING: Claude Code runninginBypass Permissions mode In Bypass Permissions mode, Claude Code will not askforyour approval before running potentially dangerous commands. This mode should only be usedina sandboxed container/VM that has restricted internet access and can easily be restoredifdamaged. By proceeding, you accept all responsibilityforactions takenwhilerunninginBypass Permissions mode. https://code.claude.com/docs/en/security ❯1. No,exit2. Yes, I accept高风险模式3. Git常见 Commit 与 PR 操作git add git commitclaude --worktree工作空间互不干扰相当于在项目的 .claude/worktrees 中建立独立分支4. Computer Use使用 Ctrl V 复制图像到 Claude Code注意不是 Command V自动识别图像内容Voice Mode 使用 /voice 模式进入在claude --worktree模式即 在项目中构建.claude/worktrees/fluttering-bubbling-knuth其中worktrees/fluttering-bubbling-knuth是分支名称。5. Session 管理/clear 清空当前会话/compact 压缩上下文摘要避免遗忘Esc 停止当前操作Rewind 回滚代码claude --continue 接着上次会话claude --resume 恢复历史会话/btw 不污染上下文不相关问题6. 踩坑一个会话聚焦一个任务做完 /clear反复纠错越改越偏使用 /clear 重来每次改动都要运行一次验证工作不要过度微操需求越具体输出越接近预期项目根目录要包含 CLAUDE.md
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2494455.html
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!