我在使用claude code时,每次对话都需要让我确认下一步是否进行,如何让他默认继续进行下一步 ...

Criado em: 9 de dezembro de 2025

Respondido usando GPT-5.1 Thinking por Chat01

Pergunta

我在使用claude code时,每次对话都需要让我确认下一步是否进行,如何让他默认继续进行下一步 就是yolo模式如何开启

Pensamento

undefined

Pensamento

【turn0calculator0】 1+1 = 2

undefined

Pensamento

undefined

Pensamento

Instructing user on enabling YOLO mode with caution

To enable YOLO mode and skip prompts automatically, use the following setting in the settings.json:

json
{ "defaultMode": "bypassPermissions" }

For CLI, use the flag --dangerously-skip-permissions. I’ll explain this in simplified Chinese, with clear steps and proper warnings about the potential risks of automatic execution, ensuring the user is well-informed while setting up the feature.

Explaining YOLO mode setup in Chinese

The "continue confirmation" prompt you mentioned is part of Claude Code's permission checks. Here’s how to enable YOLO mode:

  1. Temporary YOLO (skip prompts for this session):
bash
claude --dangerously-skip-permissions
  1. Default YOLO (skip prompts every time you start):
    • User-level: /.claude/settings.json
    • Project-level: <project>/ .claude/settings.json

Add the following to your settings:

jsonc
{ "defaultMode": "bypassPermissions" }

If using VS Code extension, note that it doesn’t fully respect bypassPermissions as of late 2025 due to a bug.

Explaining YOLO setup in VS Code with warnings

To set YOLO in VS Code:

  1. Open VS Code > Settings > search for "Claude Code."
  2. Find "Claude Code: Allow Dangerously Skip Permissions" and set it to true.
    However, due to a known issue, this may not work as expected. For guaranteed YOLO, consider running CLI instead.
    Final tip: Only use YOLO in a safe environment, like a Docker container, as recommended by guides.

Mentioning risk and keeping it concise

We’ll mention the risk of using YOLO mode but keep it brief, avoiding extensive disclaimers. A navlist isn’t needed for this answer, though I could provide links to some useful YOLO guides

Thought for 1m 1s

Resposta

简单说:Claude Code 的 “YOLO 模式” 就是 直接跳过所有权限确认。要让它默认这样跑,有两种常用方式:命令行开关 + 配置文件。


1. 临时 YOLO(只对当前这次会话生效)

在终端里不要直接敲 claude,而是:

bash
claude --dangerously-skip-permissions

这个 --dangerously-skip-permissions 官方就说明是跳过所有权限提示,用于全自动执行,也就是大家说的 YOLO 模式。(AI Wiki)

之后这一整次会话里,它就不会再问你 “是否继续下一步”。


2. 默认 YOLO(每次启动都自动跳过确认)

如果你不想每次都加这个参数,可以改 Claude Code 的配置,让它默认用 bypassPermissions 模式

2.1 找到 settings.json

Claude Code 的配置是分层的:(Claude Code)

  • 全局用户设置:~/.claude/settings.json
  • 项目设置:<你的项目根目录>/.claude/settings.json
  • 个人项目设置:<项目根目录>/.claude/settings.local.json(git 会忽略)

一般要默认 YOLO,改 全局 就行,编辑:

bash
nano ~/.claude/settings.json # 或者你喜欢的编辑器,比如 vim / code 等

2.2 设置默认权限模式为 bypassPermissions

settings.json 里加上(或合并进你原来的配置里):

jsonc
{ "defaultMode": "bypassPermissions" }

官方说明里,defaultMode 可以设成:default / acceptEdits / plan / bypassPermissions,其中 bypassPermissions 就是全自动跳过所有提示。(ClaudeLog)

改完之后重启 Claude Code,下次就会直接以 YOLO 模式跑,不再一遍遍问你是否继续。


3. 如果你是在 VS Code 里用 Claude Code 扩展

VS Code 里也有类似选项,但目前(2025 年底)扩展这块有点不稳定,有 issue 提到:即使在 .claude/settings.json 里设了 defaultMode: "bypassPermissions"allow: ["*"],扩展还是会弹权限确认。(GitHub)

你可以尝试:

  1. VS Code → Settings 搜索 Claude Code
  2. 打开类似 Claude Code: Allow Dangerously Skip Permissions 的选项(如果有)
  3. 同时在项目或全局 settings.json 里配置 defaultMode: "bypassPermissions"

但如果你发现无论怎么设 VS Code 还是一直弹框,那不是你姿势不对,是扩展本身的 bug。此时想要真正 YOLO,建议:

  • 在终端里直接跑 claude --dangerously-skip-permissions 来用 CLI 版。(GitHub)

4. 安全小提示(真的很重要)

YOLO 模式 = 不再问你权限 = 它能做任何当前系统用户能做的事。官方和很多教程都强烈建议:(Tenten)

  • 只在沙盒里开 YOLO:比如 Docker / VM 里跑,把代码目录挂进去。
  • 不要在装有各种密钥、生产代码的机器上随便 YOLO。
  • 最少权限:只给必要目录访问、必要的 API Key。

如果你告诉我你现在是用 纯终端版 还是 VS Code 插件,我可以按你的环境写一份完全可复制粘贴的配置示例给你。

Compartilhar esta Q&A