在 macOS、Linux 或 WSL 上原生安装 Claude Code,具有自动后台更新。
从 Windows PowerShell 使用原生安装程序安装 Claude Code,具有自动后台更新。
从 Windows CMD 使用原生安装程序安装 Claude Code,具有自动后台更新。
使用 Homebrew 安装 Claude Code。
Homebrew 安装不会自动更新。运行此命令以获取最新功能和安全修复。
在 Windows 上使用 WinGet 安装 Claude Code。
WinGet 安装不会自动更新。运行此命令以获取最新功能和安全修复。
在当前项目中启动交互式 Claude Code 会话。
显示已安装的 Claude Code 版本。
手动将 Claude Code 更新到最新版本。
运行初始化钩子并启动交互模式。
从终端登录到您的 Claude 帐户。使用 --email 预填电子邮件或 --sso 强制 SSO 身份验证。
将身份验证状态显示为 JSON。使用 --text 获得人类可读的输出。如果已登录,则以代码 0 退出,否则以代码 1 退出。
运行一次性任务并获取响应,而无需启动交互会话。
使用 Claude Code 编写提交消息来创建 Git 提交。
为当前项目初始化项目指导文件。
从会话内部打开 Claude 内存管理。
登录到您的 Anthropic 帐户。
从您的 Anthropic 帐户注销。
显示二维码以下载 Claude 移动应用。
Bring configuration from OpenAI Codex, Google Gemini CLI, or Cursor into Claude Code, including instruction files, MCP servers, commands, subagents, and skills.
在打印模式下运行 Claude 一次,并以单个响应退出。
在默认文本编辑器中打开当前提示。
提出一个侧边问题,而无需将其添加到主对话历史记录中。可以在 Claude 工作时运行。
删除从光标到行尾的内容。
删除整个当前行。
粘贴使用 readline kill 命令删除的文本。
粘贴后循环浏览较早的 kill-ring 条目。
将光标向后移动一个单词。
将光标向前移动一个单词。
从剪贴板粘贴图像。
为多行输入插入换行符。
从提示的开始处打开斜杠命令选择器。
从提示的开始处进入 bash 模式。
触发文件路径自动完成。
接受提示建议以进行编辑。
接受提示建议并立即提交。
当提示为空时退出 bash 模式。
切换推送式语音听写。
关闭 /btw 侧边问题覆盖层并返回主提示。
Set a goal: Claude keeps working across turns until the condition is met. Pass clear to remove an active goal early.
Run a prompt repeatedly while the session stays open, with an interval such as 5m, or let Claude self-pace. Alias: /proactive.
Create, update, list, or run routines, which execute in the cloud on a schedule. Alias: /routines.
Fan out web searches on a question, fetch and cross-check sources, and synthesize a cited report.
Stash the current prompt for later. With text in the input, stashes it and clears the prompt; pressed again on an empty prompt, restores the stashed text.
Move the cursor to the start of the current line. In multiline input, moves to the start of the current logical line.
Move the cursor to the end of the current line. In multiline input, moves to the end of the current logical line.
Delete back to the previous whitespace. One press removes a whole path or --flag=value.
Delete to the end of the current word, or to the end of the next word when the cursor is between words.
Undo the last input edit, restoring the previous input text and cursor position.
Send your queued messages, and your draft with them, right away while Claude is still working.
Get JSON output from print mode for scripts and automation.
Enable automatic fallback to a specified model when the default model is overloaded (print mode only).
Limit agentic turns or set a spending cap for print mode runs.
在当前目录中继续最近的对话。
按 ID 或名称恢复特定会话,或显示交互式选择器以选择会话。
清除当前会话并开始新的对话。
压缩当前对话以仅保留重要上下文。
从当前会话内部恢复另一个对话。
重命名当前对话。
Copy the current conversation into a new background session and keep working here. Pass a prompt to start the copy on it immediately. To switch into a branch yourself, use /branch; to hand a task to a subagent that reports back, use /subtask.
显示当前使用了多少上下文。
Enter plan mode, optionally passing a task description to start planning immediately.
打开当前会话的任务列表。
Copy the last assistant response to the clipboard. Pass a number N to copy the Nth-latest response, or pick individual code blocks from the interactive picker.
将当前响应导出到文件。
将终端会话传输到桌面应用或网络以进行可视差异审查和继续工作。
将新的工作目录添加到当前会话。
在此处创建当前对话的分支。
从 claude.ai 启用对当前会话的远程控制。
从键盘倒回或总结。
Detach the current session to run as a background agent and free your terminal. Pass a prompt to send one more instruction before detaching. Alias: /bg.
Spawn a forked subagent that inherits the full conversation and works on the task while you keep working. Its result returns to this conversation when it finishes.
Move the session to a new working directory while keeping the conversation.
Generate a one-line summary of the current session on demand.
Pull a cloud session from claude.ai into this terminal. Opens a picker, then fetches the branch and conversation. Alias: /tp.
Set the auto-compact window: how full the context window gets before Claude Code compacts automatically. Pass a size such as 500k, or auto for the model-tuned default.
Start Claude in an isolated git worktree at .claude/worktrees/<name> so parallel sessions do not conflict. If no name is given, one is auto-generated.
Set a display name for the session, shown in /resume and the terminal title. Resume it later with claude --resume <name>.
When resuming, create a new session ID instead of reusing the original, keeping the original conversation untouched.
Resume sessions linked to a specific GitHub PR (auto-linked when created via gh pr create).
Resume a web session from claude.ai in your local terminal.
Create a new web session on claude.ai with the provided task description.
Start an interactive session with Remote Control enabled so you can also control it from claude.ai or the Claude app.
取消当前输入或生成。
终止所有后台代理。
退出 Claude Code 会话。
从命令提示符退出 Claude Code。
清除终端屏幕同时保留对话历史。
切换工具执行详细信息的冗长输出。
后台运行任务。Tmux 用户按两次 Ctrl+B。
显示或隐藏任务列表。
在对话框和菜单中循环浏览选项卡。
导航命令历史。
Suspend Claude Code to your shell (Unix only). Run fg to resume.
在 Claude 内显示当前差异。
将对话倒回到较早的检查点。
Run a setup checkup that diagnoses installation, settings, extension, and CLAUDE.md problems and proposes fixes Claude applies after you confirm.
显示当前 Claude 会话和帐户状态。
显示详细的对话和使用统计,包括会话历史和条纹。
生成分析 Claude Code 会话、交互模式和摩擦点的报告。
显示当前使用信息。
显示当前支出和成本信息。
查看当前分支以了解安全问题。
从页脚打开链接的拉取请求。
Review the current diff, or a PR number, branch, or path, for correctness bugs. Pass --fix to apply findings, --comment to post them on the PR, or ultra for a deep multi-agent cloud review. Alias: /review.
Review the changed code for cleanup opportunities and apply the fixes. Four agents run in parallel covering reuse, simplification, efficiency, and abstraction level. Does not look for correctness bugs; use /code-review for those.
Confirm a code change does what it should by building the app, running it, and observing the result, rather than relying on tests or type checks.
Enable debug logging for the current session and troubleshoot issues by reading the session debug log. Optionally describe the issue to focus the analysis.
启动对命令历史的反向搜索或循环已有的匹配项。
接受当前反向搜索匹配以进行编辑。
接受当前反向搜索匹配并执行它。
查询为空时退出反向搜索。
取消反向搜索并恢复原始输入。
Open the Settings interface, or pass key=value pairs to set a setting directly, such as /config thinking=false or /config model=sonnet.
打开主题选择器。
设置界面颜色主题。
打开键绑定配置。
安装特定于终端的绑定,例如 Shift+Enter 支持。
从当前会话内部切换模型。
更改当前推理工作量级别。
在当前会话中切换快速模式。
打开权限设置。
打开沙箱设置。
管理 MCP 服务器集成。
从会话内部管理插件。
重新加载已安装的插件。
将 Claude Code 连接到您的 IDE。
打开代理和队友选项。
查看工具事件和自动化的钩子配置。
Toggle between Vim and Normal editing modes from the Settings interface. Removed as the /vim command in v2.1.92.
在您的 shell 提示符中配置 Claude Code 的状态行显示。
切换权限模式。
在不清除当前提示的情况下切换模型。
切换扩展思维模式。
在主题选择器内切换语法突出显示。
Configure usage credits, or request them from your admin, when you hit a rate limit. Previously /extra-usage.
List output styles or switch to one.
Describe a settings change, such as allowing a command or adding a hook, and Claude edits the matching settings.json file. For theme and model, use /config instead.
Scan your transcripts for common read-only Bash and MCP tool calls, then add a prioritized allowlist to project settings to reduce permission prompts.
Show what each of your skills costs in context and how often it gets used, so you can find skills to turn off.
List the subagents, agent team teammates, and other Claude Code sessions Claude can message, with the name to use for each. Alias: /peers.
Toggle fast mode on or off.
Define custom subagents dynamically at launch via JSON, using the same fields as subagent frontmatter plus a prompt field.
Restrict which built-in tools Claude can use. Use "" to disable all, "default" for all, or list tool names.
Set the effort level for the session at launch: low, medium, high, or max (Opus only, session-scoped).
Add additional working directories for Claude to access at launch.
Begin the session in a specified permission mode, such as plan.
Load MCP servers from JSON files or strings, optionally ignoring all other MCP configuration.
打开内置斜杠命令帮助。
打开可用技能列表。
查看包含最近版本更新的完整更改日志。
提交有关 Claude Code 的反馈或报告错误。
打开当前环境的快捷键图例。