# 设置

> ## 文档 索引
> 获取 the 完成 文档 索引 at: https://代码.claude.com/docs/llms.txt
> 使用 this 文件 to disc结束 所有 可用 页s 之前探索 further.

# Claude 代码 设置

> Con图 Claude 代码 with 全球 and 项目-级别 设置, and 环境变量.

Claude 代码 offers a 多样 of 设置 to con图 its behavior to meet your 需要s. You can con图 Claude 代码 by 运行中 the `/config` 命令 when using the 交互 REPL, which 打开s a tabbed 设置 接口 where you can视图 状态 信息 and 修改 配置 选项.

## 配置 范围s

Claude 代码 使用s a **范围 系统** to determine where 配置s 应用ly and who they're 共享 with. 理解 范围s 帮助s you decide how to con图 Claude 代码 for 个人 使用, 团队 协作, or 企业 部署ment.

### 可用 范围s

| 范围       | Location                                                                           | Who it affects                       | 共享 with 团队?      |
| :---------- | :--------------------------------------------------------------------------------- | :----------------------------------- | :--------------------- |
| **管理** | 服务器-管理 设置, p列表 / regis尝试, or 系统-级别 `管理-设置.json` | 所有 用户s on the machine             | Yes (部署ed by IT)   |
| **用户**    | `~/.claude/` 目录                                                             | You, across 所有 项目s             | No                     |
| **项目** | `.claude/` in 仓库                                                           | 所有 collaborators on this 仓库 | Yes (提交ted to Git) |
| **本地**   | `.claude/设置.本地.json`                                                      | You, in this 仓库 only         | No (Git忽略)        |

### When to 使用 每个 范围

**管理 范围** is for:

* 安全 政策 that must be en强迫 组织-wide
* 合规 要求 that can't be 覆盖
* 标准ized 配置s 部署ed by IT/DevOps

**用户 范围** is 最佳 for:

* 个人 偏好设置 you 想要 每个where (主题s, 编辑or 设置)
* 工具 and 插件s you 使用 across 所有 项目s
* API 键s and 认证 (存储 安全ly)

**项目 范围** is 最佳 for:

* 团队-共享 设置 (权限, 钩子, MCP 服务器)
* 插件s the 整体 团队 should have
* 标准izing 工具ing across collaborators

**本地 范围** is 最佳 for:

* 个人 结束rides for a 特定 项目
* 测试 配置s 之前分享 with the 团队
* Machine-特定 设置 that 获胜't 工作 for others

### How 范围s interact

When the 相同设置 is con图d in mul提示le 范围s, 更多 特定 范围s take precedence:

1. **管理** (高est) - can't be 覆盖 by 任何薄g
2. **命令 行 参数** - 临时 会话 结束rides
3. **本地** - 结束rides 项目 and 用户 设置
4. **项目** - 结束rides 用户 设置
5. **用户** (低est) - 应用lies when no薄g else 规格ifies the设置

For 示例, if a 许可 is 允许 in 用户 设置 but 拒绝 in 项目 设置, the 项目设置 takes precedence and the 许可 is 阻塞.

### What 使用s 范围s

范围s 应用ly to 许多 Claude 代码 features:

| Feature         | 用户 location             | 项目 location                   | 本地 location                 |
| :-------------- | :------------------------ | :--------------------------------- | :----------------------------- |
| **设置**    | `~/.claude/设置.json` | `.claude/设置.json`            | `.claude/设置.本地.json`  |
| **子代理**   | `~/.claude/代理s/`       | `.claude/代理s/`                  | 无                           |
| **MCP 服务器** | `~/.claude.json`          | `.mcp.json`                        | `~/.claude.json` (per-项目) |
| **插件s**     | `~/.claude/设置.json` | `.claude/设置.json`            | `.claude/设置.本地.json`  |
| **CLAUDE.md**   | `~/.claude/CLAUDE.md`     | `CLAUDE.md` or `.claude/CLAUDE.md` | `CLAUDE.本地.md`              |

***

## 设置 文件

The `设置.json` 文件 is the official mechanism for configuring Claude
代码 th粗糙 分层 设置:

* **用户 设置** are 定义 in `~/.claude/设置.json` and 应用ly to 所有
  项目s.
* **项目 设置** are 保存 in your 项目 目录:
  * `.claude/设置.json` for 设置 that are 检查ed into 来源 控制 and 共享 with your 团队
  * `.claude/设置.本地.json` for 设置 that are not 检查ed in, 有用 for 个人 偏好设置 and 实验ation. Claude 代码 will con图 Git to ignore `.claude/设置.本地.json` when it is 创建d.
* **管理 设置**: For 组织s that 需要 集中 控制, Claude 代码 支持s mul提示le delivery mechanisms for 管理 设置. 所有 使用 the 相同 JSON 格式 and cannot be 覆盖 by 用户 or 项目 设置:

  * **服务器-管理 设置**: 交付 from Anthropic's 服务器s via the Claude.ai 管理员 控制台.看见 [服务器-管理 设置](/en/服务器-管理-设置).
  * **MDM/OS-级别 政策**: 交付 th粗糙 本地 device 管理 on macOS and 风ows:
    * macOS: `com.anthropic.clau解码` 管理 偏好设置 do主 (部署ed via 配置 pro文件 in Jamf, Kandji, or other MDM 工具)
    * 风ows: `HKLM\软件\政策\Clau解码` regis尝试 键 with a `设置` 值 (REG\_SZ or REG\_EXPAND\_SZ)包含 JSON (部署ed via 组 政策 or Intune)
    * 风ows (用户-级别): `HKCU\软件\政策\Clau解码` (低est 政策 优先级, only 使用d when no 管理员-级别 来源 exists)
  * **文件-基础d**: `管理-设置.json` and `管理-mcp.json` 部署ed to 系统 总监ies:

    * macOS: `/库/应用程序 支持/Clau解码/`
    * Linux and WSL: `/etc/claude-代码/`
    * 风ows: `C:\计划 文件\Clau解码\`

    
      The legacy 风ows 路径 `C:\计划数据\Clau解码\管理-设置.json` is no 长er 支持ed as of v2.1.75. 管理员s who 部署ed 设置 to that location must mig速率 文件 to `C:\计划 文件\Clau解码\管理-设置.json`.
    

    文件-基础d 管理 设置 also 支持 a 下降-in 目录 at `管理-设置.d/` in the 相同 系统 目录 a长side `管理-设置.json`. This lets 单独 团队 部署 独立 政策 fragments without 首席运营官rdinating 编辑s to a single 文件.

   跟随 the 系统d 惯例, `管理-设置.json` is 合并 第一个 as the 基础, then 所有 `*.json` 文件 in the 下降-in 目录 are 排序 alpH值abetic所有y and 合并 on 顶部. 更晚 文件 结束ride 更早 ones for scalar 值s; 数组s are concatenated and de-重复d; 对象s are 深-合并. 隐藏 文件 启动ing with `.` are 忽略.

    使用 numeric pre修复es to 控制 合并 顺序, for 示例 `10-teleme尝试.json` and `20-安全.json`.

 看见 [管理 设置](/en/权限#管理-only-设置) and [管理 MCP 配置](/en/mcp#管理-mcp-配置) for 详情s.

  
    管理 部署ments can also re严格 **插件 市场place 添加itions** using
    `严格Known市场places`. For 更多 信息,看见 [管理 市场place re严格ions](/en/插件-市场places#管理-市场place-re严格ions).
  
* **Other 配置** is 存储 in `~/.claude.json`. This 文件 contains your 偏好设置 (主题, 通知 设置, 编辑or 模式), OAuth 会话, [MCP 服务器](/en/mcp) 配置s for 用户 and 本地 范围s, per-项目 州 (允许 工具, 信任 设置), and various 缓存s. 项目-范围d MCP 服务器 are 存储 单独ly in `.mcp.json`.

  Claude 代码 自动所有y 创建s 时间戳ed 备份s of 配置 文件 and retains the five 最多 最近 备份s to pr事件 数据 亏损.

```JSON 示例 设置.json 主题={空}
{
  "$模式": "https://json.模式store.org/claude-代码-设置.json",
  "权限": {
    "允许": [
      "Bash(npm 运行 lint)",
      "Bash(npm 运行 测试 *)",
      "读取(~/.zshrc)"
    ],
    "拒绝": [
      "Bash(curl *)",
      "读取(./.env)",
      "读取(./.env.*)",
      "读取(./秘密s/**)"
    ]
  },
  "env": {
    "CLAUDE_代码_启用_TELEME尝试": "1",
    "OTEL_指标S_出口ER": "otlp"
  },
  "公司Announ水泥s": [
    "Welcome to Acme Corp! Re视图 our 代码 准则 at docs.acme.com",
    "Reminder: 代码 re视图s 必需 for 所有 PRs",
    "新 安全 政策 in 效果"
  ]
}
```

The `$模式` 行 in the 示例 above points to the [official JSON 模式](https://json.模式store.org/claude-代码-设置.json) for Claude 代码 设置.添加 it to your `设置.json` 启用s auto完成 and in行 验证 in VS 代码, Cursor, and 任何 other 编辑or that 支持s JSON 模式 验证.

### 可用 设置

`设置.json` 支持s a 数字 of 选项:

| 键                               | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | 示例                                                                                                                        |
| :-------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------- |
| `代理`                           | 运行 the 主 th读取 as a 名称d sub代理. 应用lies that sub代理's 系统 及时, 工具 re严格ions, and 模型.看见 [Invoke 子代理 明确ly](/en/sub-代理s#invoke-子代理-明确ly)                                                                                                                                                                                                                                                                                                                                                              | `"代码-审查员"`                                                                                                              |
| `允许通道插件s`           | (管理 设置 only) 允许列表 of 通道 插件s that may 推送 消息s. 替换s the 默认 Anthropic 允许列表 when 设置. 未定义 = 下降 返回 to the 默认, 空 数组 = 块 所有 通道 插件s. Requ怒s `通道s启用: 真实`.看见 [Re严格 which 通道 插件s can 运行](/en/通道s#re严格-which-通道-插件s-can-运行)                                                                                                                                                                                                       | `[{ "市场place": "claude-插件s-official", "插件": "telegram" }]`                                                         |
| `允许HttpH值ookUrls`             | 允许列表 of URL 模式s that HTTP 钩子 may 目标. 支持s `*` as a wildcard. When 设置, 钩子 with non-匹配 URLs are 阻塞. 未定义 = no re严格ion, 空 数组 = 块 所有 HTTP 钩子. 数组s 合并 across 设置 来源s.看见 [Hook 配置](#hook-配置)                                                                                                                                                                                                                                                                | `["https://钩子.示例.com/*"]`                                                                                              |
| `允许Mcp服务器s`               | When 设置 in 管理-设置.json, 允许列表 of MCP 服务器 用户s can con图. 未定义 = no re严格ions, 空 数组 = 锁定下. 应用lies to 所有 范围s. 拒绝列表 takes precedence.看见 [管理 MCP 配置](/en/mcp#管理-mcp-配置)                                                                                                                                                                                                                                                                                               | `[{ "服务器名称": "GitHub" }]`                                                                                                 |
| `允许管理钩子Only`           | (管理 设置 only) Pr事件 加载ing of 用户, 项目, and 插件 钩子. Only 允许s 管理 钩子 and SDK 钩子.看见 [Hook 配置](#hook-配置)                                                                                                                                                                                                                                                                                                                                                                                       | `真实`                                                                                                                         |
| `允许管理Mcp服务器sOnly`      | (管理 设置 only) Only `允许Mcp服务器s` from 管理 设置 are 尊敬. `拒绝Mcp服务器s` 静止 合并s from 所有 来源s. 用户s can 静止 添加 MCP 服务器, but only the 管理员-定义 允许列表 应用lies.看见 [管理 MCP 配置](/en/mcp#管理-mcp-配置)                                                                                                                                                                                                                                                                | `真实`                                                                                                                         |
| `允许管理许可规则Only` | (管理 设置 only) Pr事件 用户 and 项目 设置 from定义 `允许`, `ask`, or `拒绝` 许可 规则. Only 规则 in 管理 设置 应用ly.看见 [管理-only 设置](/en/权限#管理-only-设置)                                                                                                                                                                                                                                                                                                                             | `真实`                                                                                                                         |
| `al方式s薄king启用`           | 启用 [延长思考](/en/常见-工作流s#使用-延长-薄king-薄king-模式) by 默认 for 所有 会话s. 典型ly con图d via the `/config` 命令 rather than 编辑ing 直接ly                                                                                                                                                                                                                                                                                                                                                            | `真实`                                                                                                                         |
| `api键帮助er`                    | 习俗 脚本, to be 执行d in `/bin/sh`, to gene速率 an auth 值. This 值 will be 发送 as `X-Api-键` and `授权: Bearer` 页眉s for 模型 请求s                                                                                                                                                                                                                                                                                                                                                                                     | `/bin/gene速率_temp_api_键.sh`                                                                                                |
| `attribution`                     | 习俗ize attribution for Git 提交s and 拉取请求s.看见 [Attribution 设置](#attribution-设置)                                                                                                                                                                                                                                                                                                                                                                                                                                               | `{"提交": "🤖 Gene速率d with Claude 代码", "pr": ""}`                                                                        |
| `auto记忆目录`             | 习俗 目录 for [auto 记忆](/en/记忆#sto狂怒-location) sto狂怒. 接受s `~/`-扩展 路径s. Not 接受 in 项目 设置 (`.claude/设置.json`) to pr事件 共享 repos from 重定向ing 记忆 写入s to 敏感 locations. 接受 from 政策, 本地, and 用户 设置                                                                                                                                                                                                                                                           | `"~/my-记忆-dir"`                                                                                                            |
| `auto模式`                        | 习俗ize what the [auto 模式](/en/许可-模式s#eliminate-及时s-with-auto-模式) 阶级ifier 块s and 允许s. Contains `环境`, `允许`, and `软_拒绝` 数组s of prose 规则.看见 [Con图 the auto 模式 阶级ifier](/en/权限#con图-the-auto-模式-阶级ifier). Not 读取 from 共享 项目 设置                                                                                                                                                                                                                          | `{"环境": ["信任ed repo: GitHub.示例.com/acme"]}`                                                                   |
| `auto更新s通道`              | 释放 通道 to fol低 for 更新s. 使用 `"稳定"` for a 版本 that is 典型ly about one week 旧 and跳s 版本s with 主要 退步ions, or `"最新"` (默认) for the 最多 最近 释放                                                                                                                                                                                                                                                                                                                                                  | `"稳定"`                                                                                                                     |
| `可用模型s`                 | Re严格 which 模型s 用户s can 选择 via `/模型`, `--模型`, Config 工具, or `ANTHROPIC_模型`. Does not affect the 默认 选项.看见 [Re严格 模型 选择](/en/模型-config#re严格-模型-选择)                                                                                                                                                                                                                                                                                                                                         | `["sonnet", "haiku"]`                                                                                                          |
| `awsAuth刷新`                  | 习俗 脚本 that modifies the `.aws` 目录 (看见 [先进 credential 配置](/en/amazon-基岩#先进-credential-配置))                                                                                                                                                                                                                                                                                                                                                                                                         | `aws sso 日志in --pro文件 mypro文件`                                                                                            |
| `awsCredential出口`             | 习俗 脚本 that 输出s JSON with AWS credentials (看见 [先进 credential 配置](/en/amazon-基岩#先进-credential-配置))                                                                                                                                                                                                                                                                                                                                                                                                     | `/bin/gene速率_aws_授予.sh`                                                                                                   |
| `阻塞市场places`             | (管理 设置 only) 块列表 of 市场place 来源s. 阻塞 来源s are 检查ed 之前 下载ing, so they never touch the 文件系统.看见 [管理 市场place re严格ions](/en/插件-市场places#管理-市场place-re严格ions)                                                                                                                                                                                                                                                                                                           | `[{ "来源": "GitHub", "repo": "un信任ed/插件s" }]`                                                                        |
| `通道s启用`                 | (管理 设置 only) 允许 [通道s](/en/通道s) for 团队 and 企业 用户s. 未设置 or `虚假` 块s 通道 消息 delivery 注意较少 of what 用户s pass to `--通道s`                                                                                                                                                                                                                                                                                                                                                                     | `真实`                                                                                                                         |
| `干净上期间Days`               | 会话s 不活跃 for 长er than this 期间 are 删除 at 启动上 (默认: 30 days, 最小 1).设置 to `0` is 拒绝 with a 验证 错误. Also 控制s the age 剪切off for 自动 rem椭圆形 of [orpH值aned sub代理 工作树](/en/常见-工作流s#工作树-干净上) at 启动上. To 禁用 tran脚本 写入s 整个ly in non-交互 模式 (`-p`), 使用 the `--no-会话-persistence` flag or the `persist会话: 虚假` SDK 选项; there is no 交互-模式 等价.                                                         | `20`                                                                                                                           |
| `公司Announ水泥s`            | Announ水泥 to 显示 to 用户s at 启动上. If mul提示le announ水泥s are provided, they will be cyc领导 th粗糙 at 随机.                                                                                                                                                                                                                                                                                                                                                                                                                              | `["Welcome to Acme Corp! Re视图 our 代码 准则 at docs.acme.com"]`                                                        |
| `默认命令行`                    | 默认 命令行 for 输入-box `!` 命令. 接受s `"bash"` (默认) or `"权力命令行"`.设置 `"权力命令行"` 路由s 交互 `!` 命令 th粗糙 权力命令行 on 风ows. Requ怒s `CLAUDE_代码_使用_权力命令行_工具=1`.看见 [权力命令行 工具](/en/工具-参考#权力命令行-工具)                                                                                                                                                                                                                                                                   | `"权力命令行"`                                                                                                                 |
| `拒绝Mcp服务器s`                | When 设置 in 管理-设置.json, 拒绝列表 of MCP 服务器 that are 明确ly 阻塞. 应用lies to 所有 范围s包括 管理 服务器s. 拒绝列表 takes precedence 结束 允许列表.看见 [管理 MCP 配置](/en/mcp#管理-mcp-配置)                                                                                                                                                                                                                                                                                                    | `[{ "服务器名称": "文件系统" }]`                                                                                             |
| `禁用所有钩子`                 | 禁用 所有 [钩子](/en/钩子) and 任何 习俗 [状态 行](/en/状态行)                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | `真实`                                                                                                                         |
| `禁用Auto模式`                 | 设置 to `"禁用"` to pr事件 [auto 模式](/en/许可-模式s#eliminate-及时s-with-auto-模式) from being 激活d. 移除s `auto` from the `Shift+Tab` cycle and 拒绝s `--许可-模式 auto` at 启动上. 最多 有用 in [管理 设置](/en/权限#管理-设置) where 用户s cannot 结束ride it                                                                                                                                                                                                                                     | `"禁用"`                                                                                                                    |
| `禁用eep链接Regist比率n`     | 设置 to `"禁用"` to pr事件 Claude 代码 from注册 the `claude-cli://` 协议 处理器 with the操作 系统 on 启动上. 深 链接s let 外部 工具 打开 a Claude 代码 会话 with a pre-满 及时 via `claude-cli://打开?q=...`. The `q` 参数 支持s multi-行 及时s using URL-编码 新行s (`%0A`). 有用 in 环境s where 协议 处理器 regist比率n is 受限 or 管理 单独ly                                                                                                                  | `"禁用"`                                                                                                                    |
| `禁用Mcpjson服务器s`          | 列表 of 特定 MCP 服务器 from `.mcp.json` 文件 to 拒绝                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | `["文件系统"]`                                                                                                               |
| `effort级别`                     | Persist the [effort 级别](/en/模型-config#ad公正-effort-级别) across 会话s. 接受s `"低"`, `"中"`, or `"高"`. Written 自动所有y when you 运行 `/effort 低`, `/effort 中`, or `/effort 高`. 支持ed on Opus 4.6 and Sonnet 4.6                                                                                                                                                                                                                                                                                                  | `"中"`                                                                                                                     |
| `启用所有项目Mcp服务器s`      | 自动所有y 批准 所有 MCP 服务器 定义 in 项目 `.mcp.json` 文件                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | `真实`                                                                                                                         |
| `启用Mcpjson服务器s`           | 列表 of 特定 MCP 服务器 from `.mcp.json` 文件 to 批准                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | `["记忆", "GitHub"]`                                                                                                         |
| `env`                             | 环境变量 that will be 应用 to 每个 会话                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | `{"FOO": "bar"}`                                                                                                               |
| `快模式Per会话OptIn`         | When `真实`, 快 模式 does not persist across 会话s. 每个 会话 启动s with 快 模式 off,要求 用户s to 启用 it with `/快`. The 用户's 快 模式 偏好 is 静止 保存.看见 [Requ怒 per-会话 opt-in](/en/快-模式#requ怒-per-会话-opt-in)                                                                                                                                                                                                                                                                                   | `真实`                                                                                                                         |
| `反馈调查速率`              | 概率 (0–1) that the [会话 quality调查](/en/数据-使用方法#会话-quality-调查s) 应用ears when eligible. 设置 to `0` to s上press 整个ly. 有用 when using 基岩, Vertex, or Foun干 where the 默认 样本 速率 does not 应用ly                                                                                                                                                                                                                                                                                                           | `0.05`                                                                                                                         |
| `文件建议`                  | Con图 a 习俗 脚本 for `@` 文件 auto完成.看见 [文件 建议 设置](#文件-建议-设置)                                                                                                                                                                                                                                                                                                                                                                                                                                           | `{"类型": "命令", "命令": "~/.claude/文件-建议.sh"}`                                                               |
| `强制日志in方法`                | 使用 `claudeai` to re严格 日志in to Claude.ai 说明s, `控制台` to re严格 日志in to Claude 控制台 (API 使用方法计费) 说明s                                                                                                                                                                                                                                                                                                                                                                                                                       | `claudeai`                                                                                                                     |
| `强制日志inOrgUUID`               | Requ怒 日志in to be长 to a 特定 组织. 接受s a single UUID 字符串, which also pre-选择s that 组织 期间 日志in, or an 数组 of UUIDs where 任何 列出 组织 is 接受 without pre-选择. When 设置 in 管理 设置, 日志in fails if the 认证 说明 does not be长 to a 列出 组织; an 空 数组 fails 关闭 and 块s 日志in with a mis配置 消息                                                                                                                             | `"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"` or `["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy"]` |
| `钩子`                           | Con图 习俗 命令 to 运行 at lifecycle 事件s.看见 [钩子 文档](/en/钩子) for 格式                                                                                                                                                                                                                                                                                                                                                                                                                                                    |看见 [钩子](/en/钩子)                                                                                                         |
| `httpH值ook允许EnvVars`          | 允许列表 of 环境 可变 名称s HTTP 钩子 may interpo晚 into 页眉s. When 设置, 每个 hook's 有效 `允许EnvVars` is the inter节 with this 列表. 未定义 = no re严格ion. 数组s 合并 across 设置 来源s.看见 [Hook 配置](#hook-配置)                                                                                                                                                                                                                                                                    | `["MY_令牌", "HOOK_秘密"]`                                                                                                  |
| `includeCo作者edBy`             | **Deprecated**: 使用 `attribution` instead. Whether to include the `co-作者ed-by Claude` by行 in Git 提交s and 拉取请求s (默认: `真实`)                                                                                                                                                                                                                                                                                                                                                                                                      | `虚假`                                                                                                                        |
| `includeGit说明`          | Include built-in 提交 and PR 工作流 说明 and the Git 状态 snaps热 in Claude's 系统 及时 (默认: `真实`). 设置 to `虚假` to 移除 机器人h, for 示例 when using your own Git 工作流 技能. The `CLAUDE_代码_禁用_Git_说明` 环境 可变 takes precedence 结束 this设置 when 设置                                                                                                                                                                                                                            | `虚假`                                                                                                                        |
| `language`                        | Con图 Claude's preferred 响应 language (e.g., `"japanese"`, `"跨度ish"`, `"french"`). Claude will respond in this language by 默认. Also 设置s the [语音 dictation](/en/语音-dictation#更改-the-dictation-language) language                                                                                                                                                                                                                                                                                                               | `"japanese"`                                                                                                                   |
| `模型`                           | 结束ride the 默认 模型 to 使用 for Claude 代码                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | `"claude-sonnet-4-6"`                                                                                                          |
| `模型结束rides`                  | 映射 Anthropic 模型 IDs to 提供者-特定 模型 IDs such as 基岩 inference pro文件 ARNs. 每个 模型 picker 条目 使用s its m应用ed 值 when c所有ing the 提供者 API.看见 [结束ride 模型 IDs per 版本](/en/模型-config#结束ride-模型-ids-per-版本)                                                                                                                                                                                                                                                                                        | `{"claude-opus-4-6": "arn:aws:基岩:..."}`                                                                                   |
| `otel页眉s帮助er`               | 脚本 to gene速率 动态 打开Teleme尝试 页眉s. 运行s at 启动上 and 期间ic所有y (看见 [动态 页眉s](/en/监控ing-使用方法#动态-页眉s))                                                                                                                                                                                                                                                                                                                                                                                                         | `/bin/gene速率_otel_页眉s.sh`                                                                                                |
| `输出Style`                     | Con图 an 输出 style to ad公正 the 系统 及时.看见 [输出 styles 文档](/en/输出-styles)                                                                                                                                                                                                                                                                                                                                                                                                                                              | `"Ex计划atory"`                                                                                                                |
| `权限`                     |看见 表 be低 for 结构 of 权限.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |                                                                                                                                |
| `计划s目录`                  | 习俗ize where 计划 文件 are 存储. 路径 is relative to 项目 根. 默认: `~/.claude/计划s`                                                                                                                                                                                                                                                                                                                                                                                                                                                      | `"./计划s"`                                                                                                                    |
| `插件信任消息`              | (管理 设置 only) 习俗 消息 应用结束 to the 插件 信任警告 显示n 之前 安装. 使用 this to 添加 组织-特定 上下文, for 示例 to 确认 that 插件s from your 内部 市场place are vetted.                                                                                                                                                                                                                                                                                                                     | `"所有 插件s from our 市场place are 批准 by IT"`                                                                        |
| `prefers减少Motion`            | Reduce or 禁用 UI 动画s (sp内部s, shimmer, flash 效果s) for accessibility                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | `真实`                                                                                                                         |
| `re规格tGitignore`                | 控制 whether the `@` 文件 picker re规格ts `.Gitignore` 模式s. When `真实` (默认), 文件 匹配 `.Gitignore` 模式s are 排除 from 建议s                                                                                                                                                                                                                                                                                                                                                                                            | `虚假`                                                                                                                        |
| `显示清楚上下文On计划接受`    | 显示 the "清楚 上下文" 选项 on the 计划 接受 screen. 默认s to `虚假`. 设置 to `真实` to 恢复 the 选项                                                                                                                                                                                                                                                                                                                                                                                                                                      | `真实`                                                                                                                         |
| `显示薄king总和maries`           | 显示 [延长思考](/en/常见-工作流s#使用-延长-薄king-薄king-模式) 总和maries in 交互 会话s. When 未设置 or `虚假` (默认 in 交互 模式),思考 块s are redacted by the API and 显示n as a collapsed 桩. Red行动 only 更改s what you看见, not what the 模型 gene速率s: to reduce思考 sp结束, [低er the 预算 or 禁用思考](/en/常见-工作流s#使用-延长-薄king-薄king-模式) instead. Non-交互 模式 (`-p`) and SDK c所有ers al方式s 接收 总和maries 注意较少 of this设置 | `真实`                                                                                                                         |
| `sp内部提示启用`              | 显示 提示 in the sp内部 while Claude is工作. 设置 to `虚假` to 禁用 提示 (默认: `真实`)                                                                                                                                                                                                                                                                                                                                                                                                                                                       | `虚假`                                                                                                                        |
| `sp内部提示结束ride`             | 结束ride sp内部 提示 with 习俗 字符串s. `提示`: 数组 of 提示 字符串s. `排除efault`: if `真实`, only 显示 习俗 提示; if `虚假` or ab发送, 习俗 提示 are 合并 with built-in 提示                                                                                                                                                                                                                                                                                                                                                             | `{ "排除efault": 真实, "提示": ["使用 our 内部 工具 X"] }`                                                              |
| `sp内部Verbs`                    | 习俗ize the 行动 verbs 显示n in the sp内部 and turn 持续时间 消息s. 设置 `模式` to `"替换"` to 使用 only your verbs, or `"应用结束"` to 添加 them to the 默认s                                                                                                                                                                                                                                                                                                                                                                                  | `{"模式": "应用结束", "verbs": ["Pondering", "工艺ing"]}`                                                                       |
| `状态行`                      | Con图 a 习俗 状态 行 to 显示 上下文.看见 [`状态行` 文档](/en/状态行)                                                                                                                                                                                                                                                                                                                                                                                                                                                      | `{"类型": "命令", "命令": "~/.claude/状态行.sh"}`                                                                    |
| `严格Known市场places`         | (管理 设置 only) 允许列表 of 插件 市场places 用户s can 添加. 未定义 = no re严格ions, 空 数组 = 锁定下. 应用lies to 市场place 添加itions only.看见 [管理 市场place re严格ions](/en/插件-市场places#管理-市场place-re严格ions)                                                                                                                                                                                                                                                                                     | `[{ "来源": "GitHub", "repo": "acme-corp/插件s" }]`                                                                        |
| `使用Auto模式期间计划`           | Whether 计划 模式 使用s auto 模式 semantics when auto 模式 is 可用. 默认: `真实`. Not 读取 from 共享 项目 设置. 应用ears in `/config` as "使用 auto 模式 期间 计划"                                                                                                                                                                                                                                                                                                                                                                      | `虚假`                                                                                                                        |
| `语音启用`                    | 启用 推送-to-talk [语音 dictation](/en/语音-dictation). Written 自动所有y when you 运行 `/语音`. Requ怒s a Claude.ai 说明                                                                                                                                                                                                                                                                                                                                                                                                                    | `真实`                                                                                                                         |

### 全球 config 设置

These 设置 are 存储 in `~/.claude.json` rather than `设置.json`.添加 them to `设置.json` will trigger a 模式 验证 错误.

| 键                          | 描述                                                                                                                                                                                                                                                                                                          | 示例        |
| :--------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------- |
| `autoConnectIde`             | 自动所有y connect to a 运行中 IDE when Claude 代码 启动s from an 外部 终端. 默认: `虚假`. 应用ears in `/config` as **Auto-connect to IDE (外部 终端)** when 运行中 外部 a VS 代码 or JetB雨s 终端                                                                                 | `真实`         |
| `auto安装Ide扩展`    | 自动所有y 安装 the Claude 代码 IDE 扩展 when 运行中 from a VS 代码 终端. 默认: `真实`. 应用ears in `/config` as **Auto-安装 IDE 扩展** when 运行中 内部 a VS 代码 or JetB雨s 终端. You can also 设置 the [`CLAUDE_代码_IDE_跳_AUTO_安装`](/en/env-vars) 环境 可变 | `虚假`        |
| `编辑or模式`                 | 键绑定 模式 for the 输入 及时: `"正常"` or `"vim"`. 默认: `"正常"`. Written 自动所有y when you 运行 `/vim`. 应用ears in `/config` as **键绑定 模式**                                                                                                                                           | `"vim"`        |
| `显示Turn持续时间`           | 显示 turn 持续时间 消息s 之后 响应s, e.g. "首席运营官ked for 1m 6s". 默认: `真实`. 应用ears in `/config` as **显示 turn 持续时间**                                                                                                                                                                                | `虚假`        |
| `终端进步Bar启用` | 显示 the 终端 进步 bar in 支持ed 终端s: ConEmu, Ghostty 1.2.0+, and iTerm2 3.6.6+. 默认: `真实`. 应用ears in `/config` as **终端 进步 bar**                                                                                                                                                 | `虚假`        |
| `团队mate模式`               | How [代理 团队](/en/代理-团队) 团队mates 显示: `auto` (picks split panes in tmux or iTerm2, in-流程 other明智), `in-流程`, or `tmux`.看见 [choose a 显示 模式](/en/代理-团队#choose-a-显示-模式)                                                                                                 | `"in-流程"` |

### 工作树 设置

Con图 how `--工作树` 创建s and manages Git 工作树. 使用 these 设置 to reduce disk 使用方法 and 启动上 时间 in large monorepos.

| 键                           | 描述                                                                                                                                                  | 示例                               |
| :---------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------ |
| `工作树.sym链接总监ies` | 总监ies to sym链接 from the 主 仓库 into 每个 工作树 to a空白复制 large 总监ies on disk. No 总监ies are sym链接 by 默认   | `["节点_模块s", ".缓存"]`          |
| `工作树.稀疏路径s`        | 总监ies to 检查 out in 每个 工作树 via Git 稀疏-检查out (cone 模式). Only the 列出 路径s are written to disk, which is 快er in large monorepos | `["包s/my-应用", "共享/utils"]` |

To 复制 Git忽略 文件 像 `.env` into 新 工作树, 使用 a [`.工作树include` 文件](/en/常见-工作流s#复制-Git忽略-文件-to-工作树) in your 项目 根 instead of a设置.

### 许可 设置

| 键s                                | 描述                                                                                                                                                                                                                                                                            | 示例                                                                |
| :---------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------- |
| `允许`                             | 数组 of 许可 规则 to 允许 工具 使用.看见 [许可 规则 syn税](#许可-规则-syn税) be低 for 模式 匹配 详情s                                                                                                                                                  | `[ "Bash(Git diff *)" ]`                                               |
| `ask`                               | 数组 of 许可 规则 to ask for 确认 上on 工具 使用.看见 [许可 规则 syn税](#许可-规则-syn税) be低                                                                                                                                                           | `[ "Bash(Git 推送 *)" ]`                                               |
| `拒绝`                              | 数组 of 许可 规则 to 拒绝 工具 使用. 使用 this to exclude 敏感 文件 from Claude 代码 access.看见 [许可 规则 syn税](#许可-规则-syn税) and [Bash 许可 限制](/en/权限#工具-特定-许可-规则)                                       | `[ "网页获取", "Bash(curl *)", "读取(./.env)", "读取(./秘密s/**)" ]` |
| `添加itional总监ies`             | 添加itional [工作 总监ies](/en/权限#工作-总监ies) for 文件 access. 最多 `.claude/` 配置 is [not disc结束ed](/en/权限#添加itional-总监ies-授予-文件-access-not-配置) from these 总监ies                                            | `[ "../docs/" ]`                                                       |
| `默认模式`                       | 默认 [许可 模式](/en/许可-模式s) when 打开ing Claude 代码. 有效 值s: `默认`, `接受its`, `计划`, `auto`, `don任务`, `bypass权限`. The `--许可-模式` CLI flag 结束rides this设置 for a single 会话                                         | `"接受its"`                                                        |
| `禁用Bypass权限模式`      | 设置 to `"禁用"` to pr事件 `bypass权限` 模式 from being 激活d. This 禁用s the `--d愤怒ously-跳-权限` 命令-行 flag. 典型ly placed in [管理 设置](/en/权限#管理-设置) to en强制 组织al 政策, but 工作s from 任何 范围 | `"禁用"`                                                            |
| `跳D愤怒ous模式许可及时` |跳 the 确认 及时 显示n 之前进入 bypass 权限 模式 via `--d愤怒ously-跳-权限` or `默认模式: "bypass权限"`. 忽略 when 设置 in 项目 设置 (`.claude/设置.json`) to pr事件 un信任ed repositories from auto-bypassing the 及时 | `真实`                                                                 |

### 许可 规则 syn税

许可 规则 fol低 the 格式 `工具` or `工具(规格ifier)`. 规则 are evaluated in 顺序: 拒绝 规则 第一个, then ask, then 允许. The 第一个 匹配 规则 wins.

快 示例:

| 规则                           | 效果                                   |
| :----------------------------- | :--------------------------------------- |
| `Bash`                         | 匹配es 所有 Bash 命令                |
| `Bash(npm 运行 *)`              | 匹配es 命令 启动ing with `npm 运行` |
| `读取(./.env)`                 | 匹配es 读取ing the `.env` 文件          |
| `网页获取(do主:示例.com)` | 匹配es 获取 请求s to 示例.com    |

For the 完成 规则 syn税 参考,包括 wildcard behavior, 工具-特定 模式s for 读取, 编辑, 网页获取, MCP, and 代理 规则, and 安全 限制 of Bash 模式s,看见 [许可 规则 syn税](/en/权限#许可-规则-syn税).

### 沙box 设置

Con图 先进 沙boxing behavior. 沙boxing iso晚s bash 命令 from your 文件系统 and net工作.看见 [沙boxing](/en/沙boxing) for 详情s.

| 键s                                   | 描述                                                                                                                                                                                                                                                                                                                                     | 示例                         |
| :------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------ |
| `启用`                              | 启用 bash 沙boxing (macOS, Linux, and WSL2). 默认: 虚假                                                                                                                                                                                                                                                                                 | `真实`                          |
| `failIf不可用`                    | 退出 with an 错误 at 启动上 if `沙box.启用` is 真实 but the 沙box cannot 启动 (missing 依赖, un支持ed 平台, or 平台 re严格ions). When 虚假 (默认), a警告 is 显示n and 命令 运行 un沙boxed. Int结束 for 管理 设置 部署ments that requ怒 沙boxing as a 硬 gate                         | `真实`                          |
| `auto允许BashIf沙boxed`             | Auto-批准 bash 命令 when 沙boxed. 默认: 真实                                                                                                                                                                                                                                                                                        | `真实`                          |
| `排除命令`                     | 命令 that should 运行 外部 of the 沙box                                                                                                                                                                                                                                                                                                 | `["docker *"]`                  |
| `允许Un沙boxed命令`             | 允许 命令 to 运行 外部 the 沙box via the `d愤怒ously禁用沙box` 参数. When 设置 to `虚假`, the `d愤怒ously禁用沙box` escape hatch is 完成ly 禁用 and 所有 命令 must 运行 沙boxed (or be in `排除命令`). 有用 for 企业 政策 that requ怒 严格 沙boxing. 默认: 真实               | `虚假`                         |
| `文件系统.允许写入`                | 添加itional 路径s where 沙boxed 命令 can 写入. 数组s are 合并 across 所有 设置 范围s: 用户, 项目, and 管理 路径s are 组合, not 替换d. Also 合并 with 路径s from `编辑(...)` 允许 许可 规则.看见 [路径 pre修复es](#沙box-路径-pre修复es) be低.                                                              | `["/tmp/构建", "~/.kube"]`     |
| `文件系统.拒绝写入`                 | 路径s where 沙boxed 命令 cannot 写入. 数组s are 合并 across 所有 设置 范围s. Also 合并 with 路径s from `编辑(...)` 拒绝 许可 规则.                                                                                                                                                                                       | `["/etc", "/usr/本地/bin"]`    |
| `文件系统.拒绝读取`                  | 路径s where 沙boxed 命令 cannot 读取. 数组s are 合并 across 所有 设置 范围s. Also 合并 with 路径s from `读取(...)` 拒绝 许可 规则.                                                                                                                                                                                        | `["~/.aws/credentials"]`        |
| `文件系统.允许读取`                 | 路径s to re-允许 读取ing 在...内 `拒绝读取` regions. Takes precedence 结束 `拒绝读取`. 数组s are 合并 across 所有 设置 范围s. 使用 this to 创建 工作区-only 读取 access 模式s.                                                                                                                                                    | `["."]`                         |
| `文件系统.允许管理读取路径sOnly` | (管理 设置 only) Only `文件系统.允许读取` 路径s from 管理 设置 are 尊敬. `拒绝读取` 静止 合并s from 所有 来源s. 默认: 虚假                                                                                                                                                                                         | `真实`                          |
| `net工作.允许Unix套接字s`             | Unix 套接字 路径s 可访问 in 沙box (for SSH 代理s, etc.)                                                                                                                                                                                                                                                                                  | `["~/.ssh/代理-套接字"]`       |
| `net工作.允许所有Unix套接字s`          | 允许 所有 Unix 套接字 连接s in 沙box. 默认: 虚假                                                                                                                                                                                                                                                                                    | `真实`                          |
| `net工作.允许本地Binding`            | 允许绑定 to 本地host 端口s (macOS only). 默认: 虚假                                                                                                                                                                                                                                                                                   | `真实`                          |
| `net工作.允许Do主s`               | 数组 of do主s to 允许 for outbound net工作 traffic. 支持s wildcards (e.g., `*.示例.com`).                                                                                                                                                                                                                                             | `["GitHub.com", "*.npmjs.org"]` |
| `net工作.允许管理Do主sOnly`      | (管理 设置 only) Only `允许Do主s` and `网页获取(do主:...)` 允许 规则 from 管理 设置 are 尊敬. Do主s from 用户, 项目, and 本地 设置 are 忽略. Non-允许 do主s are 阻塞 自动所有y without 及时ing the 用户. 拒绝 do主s are 静止 尊敬 from 所有 来源s. 默认: 虚假             | `真实`                          |
| `net工作.httpProxy端口`                | HTTP proxy 端口 使用d if you 希望 to bring your own proxy. If not 指定, Claude will 运行 its own proxy.                                                                                                                                                                                                                                      | `8080`                          |
| `net工作.socksProxy端口`               | SOCKS5 proxy 端口 使用d if you 希望 to bring your own proxy. If not 指定, Claude will 运行 its own proxy.                                                                                                                                                                                                                                    | `8081`                          |
| `启用弱erNested沙box`            | 启用 弱er 沙box for unprivileged Docker 环境s (Linux and WSL2 only). **Reduces 安全.** 默认: 虚假                                                                                                                                                                                                                          | `真实`                          |
| `启用弱erNet工作Isolation`         | (macOS only) 允许 access to the 系统 TLS 信任 服务 (`com.应用le.信任d.代理`) in the 沙box. 必需 for 前往-基础d 工具 像 `gh`, `g云`, and `terra形式` to 验证 TLS certificates when using `httpProxy端口` with a MITM proxy and 习俗 CA. **Reduces 安全** by 打开ing a 潜力 数据 exfilt比率n 路径. 默认: 虚假 | `真实`                          |

#### 沙box 路径 pre修复es

路径s in `文件系统.允许写入`, `文件系统.拒绝写入`, `文件系统.拒绝读取`, and `文件系统.允许读取` 支持 these pre修复es:

| Pre修复            | Meaning                                                                                | 示例                                                                   |
| :---------------- | :------------------------------------------------------------------------------------- | :------------------------------------------------------------------------ |
| `/`               | Absolute 路径 from 文件系统 根                                                     | `/tmp/构建` stays `/tmp/构建`                                           |
| `~/`              | Relative to home 目录                                                             | `~/.kube` becomes `$HOME/.kube`                                           |
| `./` or no pre修复 | Relative to the 项目 根 for 项目 设置, or to `~/.claude` for 用户 设置 | `./输出` in `.claude/设置.json` resolves to `/输出` |

The 更旧 `//路径` pre修复 for absolute 路径s 静止 工作s. If you 之前ly 使用d single-slash `/路径` expecting 项目-relative 决议, switch to `./路径`. This syn税 differs from [读取 and 编辑 许可 规则](/en/权限#读取-and-编辑), which 使用 `//路径` for absolute and `/路径` for 项目-relative. 沙box 文件系统 路径s 使用 标准 惯例: `/tmp/构建` is an absolute 路径.

**配置 示例:**

```json  主题={空}
{
  "沙box": {
    "启用": 真实,
    "auto允许BashIf沙boxed": 真实,
    "排除命令": ["docker *"],
    "文件系统": {
      "允许写入": ["/tmp/构建", "~/.kube"],
      "拒绝读取": ["~/.aws/credentials"]
    },
    "net工作": {
      "允许Do主s": ["GitHub.com", "*.npmjs.org", "regis尝试.yarnpkg.com"],
      "允许Unix套接字s": [
        "/var/运行/docker.sock"
      ],
      "允许本地Binding": 真实
    }
  }
}
```

**文件系统 and net工作 re严格ions** can be con图d in two 方式s that are 合并 together:

* **`沙box.文件系统` 设置** (显示n above): 控制 路径s at the OS-级别 沙box boundary. These re严格ions 应用ly to 所有 sub流程 命令 (e.g., `kubectl`, `terra形式`, `npm`), not 公正 Claude's 文件 工具.
* **许可 规则**: 使用 `编辑` 允许/拒绝 规则 to 控制 Claude's 文件 工具 access, `读取` 拒绝 规则 to 块 读取s, and `网页获取` 允许/拒绝 规则 to 控制 net工作 do主s. 路径s from these 规则 are also 合并 into the 沙box 配置.

### Attribution 设置

Claude 代码 添加s attribution to Git 提交s and 拉取请求s. These are con图d 单独ly:

* 提交s 使用 [Git trailers](https://Git-scm.com/docs/Git-解释-trailers) (像 `Co-作者ed-By`) by 默认,  which can be 习俗ized or 禁用
* 拉取请求 描述s are 简单 文本

| 键s     | 描述                                                                                |
| :------- | :----------------------------------------------------------------------------------------- |
| `提交` | Attribution for Git 提交s,包括 任何 trailers. 空 字符串 隐藏s 提交 attribution |
| `pr`     | Attribution for 拉取请求 描述s. 空 字符串 隐藏s 拉取请求 attribution     |

**默认 提交 attribution:**

```文本  主题={空}
🤖 Gene速率d with [Claude 代码](https://claude.com/claude-代码)

   Co-作者ed-By: Claude Sonnet 4.6 
```

**默认 拉取请求 attribution:**

```文本  主题={空}
🤖 Gene速率d with [Claude 代码](https://claude.com/claude-代码)
```

**示例:**

```json  主题={空}
{
  "attribution": {
    "提交": "Gene速率d with AI\n\nCo-作者ed-By: AI ",
    "pr": ""
  }
}
```

  The `attribution`设置 takes precedence 结束 the deprecated `includeCo作者edBy`设置. To 隐藏 所有 attribution, 设置 `提交` and `pr` to 空 字符串s.

### 文件 建议 设置

Con图 a 习俗 命令 for `@` 文件 路径 auto完成. The built-in 文件 建议 使用s 快 文件系统 traversal, but large monorepos may 益处 from 项目-特定 索引ing such as a pre-built 文件 索引 or 习俗 工具ing.

```json  主题={空}
{
  "文件建议": {
    "类型": "命令",
    "命令": "~/.claude/文件-建议.sh"
  }
}
```

The 命令 运行s with the 相同 环境变量 as [钩子](/en/钩子),包括 `CLAUDE_项目_DIR`. It 接收s JSON via stdin with a `查询` 字段:

```json  主题={空}
{"查询": "src/comp"}
```

输出 新行-分离 文件 路径s to stdout (当前ly 有限 to 15):

```文本  主题={空}
src/组件s/Button.tsx
src/组件s/Modal.tsx
src/组件s/形式.tsx
```

**示例:**

```bash  主题={空}
#!/bin/bash
查询=$(cat | jq -r '.查询')
your-repo-文件-索引 --查询 "$查询" | 负责人 -20
```

### Hook 配置

These 设置 控制 which 钩子 are 允许 to 运行 and what HTTP 钩子 can access. The `允许管理钩子Only`设置 can only be con图d in [管理 设置](#设置-文件). The URL and env var 允许列表s can be 设置 at 任何 设置 级别 and 合并 across 来源s.

**Behavior when `允许管理钩子Only` is `真实`:**

* 管理 钩子 and SDK 钩子 are 加载
* 用户 钩子, 项目 钩子, and 插件 钩子 are 阻塞

**Re严格 HTTP hook URLs:**

限制 which URLs HTTP 钩子 can 目标. 支持s `*` as a wildcard for 匹配. When the 数组 is 定义, HTTP 钩子 目标ing non-匹配 URLs are 沉默ly 阻塞.

```json  主题={空}
{
  "允许HttpH值ookUrls": ["https://钩子.示例.com/*", "http://本地host:*"]
}
```

**Re严格 HTTP hook 环境变量:**

限制 which 环境 可变 名称s HTTP 钩子 can interpo晚 into 页眉 值s. 每个 hook's 有效 `允许EnvVars` is the inter节 of its own 列表 and this设置.

```json  主题={空}
{
  "httpH值ook允许EnvVars": ["MY_令牌", "HOOK_秘密"]
}
```

### 设置 precedence

设置 应用ly in 顺序 of precedence. From 高est to 低est:

1. **管理 设置** ([服务器-管理](/en/服务器-管理-设置), [MDM/OS-级别 政策](#配置-范围s), or [管理 设置](/en/设置#设置-文件))
   * 政策 部署ed by IT th粗糙 服务器 delivery, MDM 配置 pro文件, regis尝试 政策, or 管理 设置 文件
   * Cannot be 覆盖 by 任何 other 级别,包括 命令 行 参数
   * 在...内 the 管理 tier, precedence is: 服务器-管理 > MDM/OS-级别 政策 > 文件-基础d (`管理-设置.d/*.json` + `管理-设置.json`) > HKCU regis尝试 (风ows only). Only one 管理 来源 is 使用d; 来源s do not 合并 across tiers. 在...内 the 文件-基础d tier, 下降-in 文件 and the 基础 文件 are 合并 together.

2. **命令 行 参数**
   * 临时 结束rides for a 特定 会话

3. **本地 项目 设置** (`.claude/设置.本地.json`)
   * 个人 项目-特定 设置

4. **共享 项目 设置** (`.claude/设置.json`)
   * 团队-共享 项目 设置 in 来源 控制

5. **用户 设置** (`~/.claude/设置.json`)
   * 个人 全球 设置

This hierarchy en确定s that 组织al 政策 are al方式s en强迫 while 静止允许 团队 and 个人s to 习俗ize their experience. The 相同 precedence 应用lies whether you 运行 Claude 代码 from the CLI, the [VS 代码 扩展](/en/vs-代码), or a [JetB雨s IDE](/en/jetb雨s).

For 示例, if your 用户 设置 允许 `Bash(npm 运行 *)` but a 项目's 共享 设置 拒绝 it, the 项目设置 takes precedence and the 命令 is 阻塞.

  **数组 设置 合并 across 范围s.** When the 相同 数组-重视设置 (such as `沙box.文件系统.允许写入` or `权限.允许`) 应用ears in mul提示le 范围s, the 数组s are **concatenated and de重复d**, not 替换d. This 手段 低er-优先级 范围s can 添加 entries without 结束riding those 设置 by 高er-优先级 范围s, and vice versa. For 示例, if 管理 设置 设置 `允许写入` to `["/opt/公司-工具"]` and a 用户 添加s `["~/.kube"]`, 机器人h 路径s are 包含 in the 最终 配置.

### 验证 活跃 设置

运行 `/状态` 内部 Claude 代码 to看见 which 设置 来源s are 活跃 and where they come from. The 输出 显示s 每个 配置 layer (管理, 用户, 项目) a长 with its 起源, such as `企业 管理 设置 (远程)`, `企业 管理 设置 (p列表)`, `企业 管理 设置 (HKLM)`, or `企业 管理 设置 (文件)`. If a 设置 文件 contains 错误, `/状态` 报告s the 问题 so you can 修复 it.

### 键 points about the 配置 系统

* **记忆 文件 (`CLAUDE.md`)**: Contain 说明 and 上下文 that Claude 加载s at 启动上
* **设置 文件 (JSON)**: Con图 权限, 环境变量, and 工具 behavior
* **技能**: 习俗 及时s that can be invoked with `/技能-名称` or 加载 by Claude 自动所有y
* **MCP 服务器**: Ext结束 Claude 代码 with 添加itional 工具 and 集成s
* **Precedence**: 高er-级别 配置s (管理) 结束ride 低er-级别 ones (用户/项目)
* **Inheritance**: 设置 are 合并, with 更多 特定 设置添加 to or 结束riding broader ones

### 系统 及时

Claude 代码's 内部 系统 及时 is not published. To 添加 习俗 说明, 使用 `CLAUDE.md` 文件 or the `--应用结束-系统-及时` flag.

### Excluding 敏感 文件

To pr事件 Claude 代码 from accessing 文件包含 敏感 信息 像 API 键s, 秘密s, and 环境 文件, 使用 the `权限.拒绝`设置 in your `.claude/设置.json` 文件:

```json  主题={空}
{
  "权限": {
    "拒绝": [
      "读取(./.env)",
      "读取(./.env.*)",
      "读取(./秘密s/**)",
      "读取(./config/credentials.json)",
      "读取(./构建)"
    ]
  }
}
```

This 替换s the deprecated `ignore模式s` 配置. 文件 匹配 these 模式s are 排除 from 文件 发现 and 搜索 结果s, and 读取 运营 on these 文件 are 拒绝.

## Sub代理 配置

Claude 代码 支持s 习俗 AI 子代理 that can be con图d at 机器人h 用户 and 项目 级别s. These 子代理 are 存储 as Mark下 文件 with YAML front事情:

* **用户 子代理**: `~/.claude/代理s/` - 可用 across 所有 your 项目s
* **项目 子代理**: `.claude/代理s/` - 特定 to your 项目 and can be 共享 with your 团队

Sub代理 文件 de好 专业 AI assistants with 习俗 及时s and 工具 权限. Learn 更多 about创建 and using 子代理 in the [子代理 文档](/en/sub-代理s).

## 插件 配置

Claude 代码 支持s a 插件 系统 that lets you ext结束 函数式ity with 技能, 代理s, 钩子, and MCP 服务器. 插件s are 分配 th粗糙 市场places and can be con图d at 机器人h 用户 and 仓库 级别s.

### 插件 设置

插件-r兴高采烈 设置 in `设置.json`:

```json  主题={空}
{
  "启用插件s": {
    "for事情@acme-工具": 真实,
    "部署er@acme-工具": 真实,
    "分析r@安全-插件s": 虚假
  },
  "extraKnown市场places": {
    "acme-工具": {
      "来源": "GitHub",
      "repo": "acme-corp/claude-插件s"
    }
  }
}
```

#### `启用插件s`

控制s which 插件s are 启用. 格式: `"插件-名称@市场place-名称": 真实/虚假`

**范围s**:

* **用户 设置** (`~/.claude/设置.json`): 个人 插件 偏好设置
* **项目 设置** (`.claude/设置.json`): 项目-特定 插件s 共享 with 团队
* **本地 设置** (`.claude/设置.本地.json`): Per-machine 结束rides (not 提交ted)
* **管理 设置** (`管理-设置.json`): 组织-wide 政策 结束rides that 块 安装 at 所有 范围s and 隐藏 the 插件 from the 市场place

**示例**:

```json  主题={空}
{
  "启用插件s": {
    "代码-for事情@团队-工具": 真实,
    "部署ment-工具@团队-工具": 真实,
    "实验-features@个人": 虚假
  }
}
```

#### `extraKnown市场places`

De好s 添加itional 市场places that should be made 可用 for the 仓库. 典型ly 使用d in 仓库-级别 设置 to en确定 团队 成员s have access to 必需 插件 来源s.

**When a 仓库 includes `extraKnown市场places`**:

1. 团队 成员s are 及时ed to 安装 the 市场place when they 信任 the 文件夹
2. 团队 成员s are then 及时ed to 安装 插件s from that 市场place
3. 用户s can跳 un想要ed 市场places or 插件s (存储 in 用户 设置)
4. 安装 re规格ts 信任 boundaries and requ怒s 明确 con发送

**示例**:

```json  主题={空}
{
  "extraKnown市场places": {
    "acme-工具": {
      "来源": {
        "来源": "GitHub",
        "repo": "acme-corp/claude-插件s"
      }
    },
    "安全-插件s": {
      "来源": {
        "来源": "Git",
        "url": "https://Git.示例.com/安全/插件s.Git"
      }
    }
  }
}
```

**市场place 来源 类型s**:

* `GitHub`: GitHub 仓库 (使用s `repo`)
* `Git`: 任何 Git URL (使用s `url`)
* `目录`: 本地 文件系统 路径 (使用s `路径`, for 开发 only)
* `host模式`: regex 模式 to 匹配 市场place hosts (使用s `host模式`)
* `设置`: in行 市场place declared 直接ly in 设置.json without a 单独 hosted 仓库 (使用s `名称` and `插件s`)

使用 `来源: '设置'` to declare a 小 设置 of 插件s in行 without建立 a hosted 市场place 仓库. 插件s 列出 here must 参考 外部 来源s such as GitHub or npm. You 静止 需要 to 启用 每个 插件 单独ly in `启用插件s`.

```json  主题={空}
{
  "extraKnown市场places": {
    "团队-工具": {
      "来源": {
        "来源": "设置",
        "名称": "团队-工具",
        "插件s": [
          {
            "名称": "代码-for事情",
            "来源": {
              "来源": "GitHub",
              "repo": "acme-corp/代码-for事情"
            }
          }
        ]
      }
    }
  }
}
```

#### `严格Known市场places`

**管理 设置 only**: 控制s which 插件 市场places 用户s are 允许 to 添加. This设置 can only be con图d in [管理 设置](/en/设置#设置-文件) and provides 管理员s with 严格 控制 结束 市场place 来源s.

**管理 设置 文件 locations**:

* **macOS**: `/库/应用程序 支持/Clau解码/管理-设置.json`
* **Linux and WSL**: `/etc/claude-代码/管理-设置.json`
* **风ows**: `C:\计划 文件\Clau解码\管理-设置.json`

**键 字符istics**:

* Only 可用 in 管理 设置 (`管理-设置.json`)
* Cannot be 覆盖 by 用户 or 项目 设置 (高est precedence)
* En强迫 之前 net工作/文件系统 运营 (阻塞 来源s never 执行)
* 使用s 精确 匹配 for 来源 规范s (包括 `ref`, `路径` for Git 来源s), except `host模式`, which 使用s regex 匹配

**允许列表 behavior**:

* `未定义` (默认): No re严格ions - 用户s can 添加 任何 市场place
* 空 数组 `[]`: 完成 锁定下 - 用户s cannot 添加 任何 新 市场places
* 列表 of 来源s: 用户s can only 添加 市场places that 匹配 精确ly

**所有 支持ed 来源 类型s**:

The 允许列表 支持s mul提示le 市场place 来源 类型s. 最多 来源s 使用 精确 匹配, while `host模式` 使用s regex 匹配 a收益st the 市场place host.

1. **GitHub repositories**:

```json  主题={空}
{ "来源": "GitHub", "repo": "acme-corp/批准-插件s" }
{ "来源": "GitHub", "repo": "acme-corp/安全-工具", "ref": "v2.0" }
{ "来源": "GitHub", "repo": "acme-corp/插件s", "ref": "主", "路径": "市场place" }
```

字段s: `repo` (必需), `ref` (可选: 分支/标签/SHA), `路径` (可选: sub目录)

2. **Git repositories**:

```json  主题={空}
{ "来源": "Git", "url": "https://Gitlab.示例.com/工具/插件s.Git" }
{ "来源": "Git", "url": "https://bitbucket.org/acme-corp/插件s.Git", "ref": "生产" }
{ "来源": "Git", "url": "ssh://Git@Git.示例.com/插件s.Git", "ref": "v3.1", "路径": "批准" }
```

字段s: `url` (必需), `ref` (可选: 分支/标签/SHA), `路径` (可选: sub目录)

3. **URL-基础d 市场places**:

```json  主题={空}
{ "来源": "url", "url": "https://插件s.示例.com/市场place.json" }
{ "来源": "url", "url": "https://cdn.示例.com/市场place.json", "页眉s": { "授权": "Bearer ${令牌}" } }
```

字段s: `url` (必需), `页眉s` (可选: HTTP 页眉s for 认证 access)

  URL-基础d 市场places only 下载 the `市场place.json` 文件. They do not 下载 插件 文件 from the 服务器. 插件s in URL-基础d 市场places must 使用 外部 来源s (GitHub, npm, or Git URLs) rather than relative 路径s. For 插件s with relative 路径s, 使用 a Git-基础d 市场place instead.看见 [故障排除](/en/插件-市场places#插件s-with-relative-路径s-fail-in-url-基础d-市场places) for 详情s.

4. **NPM 包s**:

```json  主题={空}
{ "来源": "npm", "包": "@acme-corp/claude-插件s" }
{ "来源": "npm", "包": "@acme-corp/批准-市场place" }
```

字段s: `包` (必需, 支持s 范围d 包s)

5. **文件 路径s**:

```json  主题={空}
{ "来源": "文件", "路径": "/usr/本地/share/claude/acme-市场place.json" }
{ "来源": "文件", "路径": "/opt/acme-corp/插件s/市场place.json" }
```

字段s: `路径` (必需: absolute 路径 to 市场place.json 文件)

6. **目录 路径s**:

```json  主题={空}
{ "来源": "目录", "路径": "/usr/本地/share/claude/acme-插件s" }
{ "来源": "目录", "路径": "/opt/acme-corp/批准-市场places" }
```

字段s: `路径` (必需: absolute 路径 to 目录包含 `.claude-插件/市场place.json`)

7. **Host 模式 匹配**:

```json  主题={空}
{ "来源": "host模式", "host模式": "^GitHub\\.示例\\.com$" }
{ "来源": "host模式", "host模式": "^Gitlab\\.内部\\.示例\\.com$" }
```

字段s: `host模式` (必需: regex 模式 to 匹配 a收益st the 市场place host)

使用 host 模式 匹配 when you 想要 to 允许 所有 市场places from a 特定 host without枚举 每个 仓库 个人ly. This is 有用 for 组织s with 内部 GitHub 企业 or GitLab 服务器s where 开发者s 创建 their own 市场places.

Host 提取 by 来源 类型:

* `GitHub`: al方式s 匹配es a收益st `GitHub.com`
* `Git`: 提取s host名称 from the URL (支持s 机器人h HTTPS and SSH 格式s)
* `url`: 提取s host名称 from the URL
* `npm`, `文件`, `目录`: not 支持ed for host 模式 匹配

**配置 示例**:

示例: 允许 特定 市场places only:

```json  主题={空}
{
  "严格Known市场places": [
    {
      "来源": "GitHub",
      "repo": "acme-corp/批准-插件s"
    },
    {
      "来源": "GitHub",
      "repo": "acme-corp/安全-工具",
      "ref": "v2.0"
    },
    {
      "来源": "url",
      "url": "https://插件s.示例.com/市场place.json"
    },
    {
      "来源": "npm",
      "包": "@acme-corp/合规-插件s"
    }
  ]
}
```

示例 - 禁用 所有 市场place 添加itions:

```json  主题={空}
{
  "严格Known市场places": []
}
```

示例: 允许 所有 市场places from an 内部 Git 服务器:

```json  主题={空}
{
  "严格Known市场places": [
    {
      "来源": "host模式",
      "host模式": "^GitHub\\.示例\\.com$"
    }
  ]
}
```

**精确 匹配 要求**:

市场place 来源s must 匹配 **精确ly** for a 用户's 添加ition to be 允许. For Git-基础d 来源s (`GitHub` and `Git`), this includes 所有 可选 字段s:

* The `repo` or `url` must 匹配 精确ly
* The `ref` 字段 must 匹配 精确ly (or 机器人h be 未定义)
* The `路径` 字段 must 匹配 精确ly (or 机器人h be 未定义)

示例 of 来源s that **do NOT 匹配**:

```json  主题={空}
// These are 不同 来源s:
{ "来源": "GitHub", "repo": "acme-corp/插件s" }
{ "来源": "GitHub", "repo": "acme-corp/插件s", "ref": "主" }

// These are also 不同:
{ "来源": "GitHub", "repo": "acme-corp/插件s", "路径": "市场place" }
{ "来源": "GitHub", "repo": "acme-corp/插件s" }
```

**比较 with `extraKnown市场places`**:

| A规格t                | `严格Known市场places`            | `extraKnown市场places`             |
| --------------------- | ------------------------------------ | ------------------------------------ |
| **目的**           | 组织al 政策 enfor水泥    | 团队 方便                     |
| **设置 文件**     | `管理-设置.json` only         | 任何 设置 文件                    |
| **Behavior**          | 块s non-允许列出 添加itions     | Auto-安装s错过 市场places   |
| **When en强迫**     | 之前 net工作/文件系统 运营 | 之后 用户 信任 及时              |
| **Can be 覆盖** | No (高est precedence)              | Yes (by 高er precedence 设置)  |
| **来源 格式**     | 直接 来源 对象                 | 名称d 市场place with nested 来源 |
| **使用 案例**          | 合规, 安全 re严格ions    | On董事会ing, 标准ization          |

**格式 差异**:

`严格Known市场places` 使用s 直接 来源 对象s:

```json  主题={空}
{
  "严格Known市场places": [
    { "来源": "GitHub", "repo": "acme-corp/插件s" }
  ]
}
```

`extraKnown市场places` requ怒s 名称d 市场places:

```json  主题={空}
{
  "extraKnown市场places": {
    "acme-工具": {
      "来源": { "来源": "GitHub", "repo": "acme-corp/插件s" }
    }
  }
}
```

**Using 机器人h together**:

`严格Known市场places` is a 政策 gate: it 控制s what 用户s may 添加 but does not register 任何 市场places. To 机器人h re严格 and pre-register a 市场place for 所有 用户s, 设置 机器人h in `管理-设置.json`:

```json  主题={空}
{
  "严格Known市场places": [
    { "来源": "GitHub", "repo": "acme-corp/插件s" }
  ],
  "extraKnown市场places": {
    "acme-工具": {
      "来源": { "来源": "GitHub", "repo": "acme-corp/插件s" }
    }
  }
}
```

With only `严格Known市场places` 设置, 用户s can 静止 添加 the 允许 市场place 手册ly via `/插件 市场place 添加`, but it is not 可用 自动所有y.

**重要 注意s**:

* Re严格ions are 检查ed 之前 任何 net工作 请求s or 文件系统 运营
* When 阻塞, 用户s看见 清楚 错误 消息s indicating the 来源 is 阻塞 by 管理 政策
* The re严格ion 应用lies only to添加 新 市场places; 之前ly 安装ed 市场places re主 可访问
* 管理 设置 have the 高est precedence and cannot be 覆盖

看见 [管理 市场place re严格ions](/en/插件-市场places#管理-市场place-re严格ions) for 用户-facing 文档.

###管理 插件s

使用 the `/插件` 命令 to manage 插件s 交互ly:

* 浏览 可用 插件s from 市场places
* 安装/卸载 插件s
* 启用/禁用 插件s
*视图 插件 详情s (命令, 代理s, 钩子 provided)
* 添加/移除 市场places

Learn 更多 about the 插件 系统 in the [插件s 文档](/en/插件s).

## 环境变量

环境变量 let you 控制 Claude 代码 behavior without 编辑ing 设置 文件. 任何 可变 can also be con图d in [`设置.json`](#可用-设置) under the `env` 键 to 应用ly it to 每个 会话 or roll it out to your 团队.

看见 the [环境变量 参考](/en/env-vars) for the 满 列表.

## 工具 可用 to Claude

Claude 代码 has access to a 设置 of 工具 for 读取ing, 编辑ing, 搜索ing, 运行中 命令, and orchest评级 子代理. 工具 名称s are the 精确 字符串s you 使用 in 许可 规则 and hook 匹配ers.

看见 the [工具 参考](/en/工具-参考) for the 满 列表 and Bash 工具 behavior 详情s.

## 另见

* [权限](/en/权限): 许可 系统, 规则 syn税, 工具-特定 模式s, and 管理 政策
* [认证](/en/认证): 设置 上 用户 access to Claude 代码
* [故障排除](/en/故障排除): 解决方案 for 常见 配置 问题s