{/* TRANSLATED — 已翻译为中文 */}

> ## 文档索引
> 在此获取完整文档索引：https://code.claude.com/docs/llms.txt
> 使用此文件发现所有可用页面，然后再进一步探索。

# 探索 .claude 目录

> Claude Code 读取 CLAUDE.md、settings.json、hooks、skills、commands、subagents、rules 和自动记忆的位置。探索项目中的 .claude 目录和主目录中的 ~/.claude。

export const ClaudeExplorer = () => {
  const A = useMemo(() => ({href, children}) => <a href={href} style={{
    color: 'var(--ce-accent)',
    textDecoration: 'none',
    borderBottom: '1px dotted var(--ce-accent)'
  }}>{children}</a>, []);
  const C = useMemo(() => ({children}) => <code style={{
    fontFamily: 'var(--ce-mono)',
    fontSize: '0.92em',
    padding: '1px 4px',
    borderRadius: '3px',
    background: 'var(--ce-surface)',
    border: '0.5px solid var(--ce-border-subtle)'
  }}>{children}</code>, []);
  const commandsNote = useMemo(() => <>Commands 和 skills 现在是相同的机制。对于新的工作流，请使用 <A href="/en/skills">skills/</A>：相同的 <C>/name</C> 调用，另外你可以捆绑支持文件。</>, []);
  const FILE_TREE = useMemo(() => ({
    project: {
      label: 'your-project/',
      children: [{
        id: 'claude-md',
        label: 'CLAUDE.md',
        type: 'file',
        icon: 'md',
        color: '#6A9BCC',
        badge: 'committed',
        oneLiner: 'Claude 每次会话读取的项目指令',
        when: '在每次会话开始时加载到上下文中',
        description: '项目特定的指令，决定 Claude 在此仓库中的工作方式。将你的约定、常用命令和架构上下文放在这里，使 Claude 以你的团队相同的假设进行操作。',
        tips: ['目标保持在 200 行以内。更长的文件仍会完整加载但可能降低遵守度', <>CLAUDE.md 加载到每次会话中。如果某些内容仅对特定任务重要，请将其移到 <A href="/en/skills">skill</A> 或路径限定的 <A href="/en/memory#organize-rules-with-claude/rules/">rule</A> 中，以便仅在需要时加载</>, '列出你最常运行的命令，如 build、test 和 format，这样 Claude 无需你每次都详细说明', <>运行 <C>/memory</C> 在会话中打开和编辑 CLAUDE.md</>, <>也适用于 <C>.claude/CLAUDE.md</C>，如果你更喜欢保持项目根目录整洁</>],
        exampleIntro: '此示例适用于 TypeScript 和 React 项目。它列出了构建和测试命令、Claude 应遵循的框架约定，以及项目特定的规则（如导出风格和文件布局）。',
        example: `# Project conventions

## Commands
- Build: \`npm run build\`
- Test: \`npm test\`
- Lint: \`npm run lint\`

## Stack
- TypeScript with strict mode
- React 19, functional components only

## Rules
- Named exports, never default exports
- Tests live next to source: \`foo.ts\` -> \`foo.test.ts\`
- All API routes return \`{ data, error }\` shape`,
        docsLink: '/en/memory'
      }, {
        id: 'mcp-json',
        label: '.mcp.json',
        type: 'file',
        icon: 'json',
        color: '#9B7BC4',
        badge: 'committed',
        oneLiner: '项目范围的 MCP 服务器，与团队共享',
        when: <>服务器在会话开始时连接。工具 schema 默认延迟加载，通过 <A href="/en/mcp#scale-with-mcp-tool-search">tool search</A> 按需加载</>,
        description: <>配置模型上下文协议 (MCP) 服务器，使 Claude 能够访问外部工具：数据库、API、浏览器等。此文件保存整个团队使用的项目范围服务器。你想保留给自己使用的个人服务器放在 <C>~/.claude.json</C> 中。</>,
        tips: [<>使用环境变量引用密钥：<C>{'${GITHUB_TOKEN}'}</C></>, <>位于项目根目录，不在 <C>.claude/</C> 内</>, <>对于仅你需要的服务器，运行 <C>claude mcp add --scope user</C>。这会写入 <C>~/.claude.json</C> 而不是 <C>.mcp.json</C></>],
        exampleIntro: <>此示例配置 GitHub MCP 服务器，使 Claude 可以读取问题和打开拉取请求。<C>{'${GITHUB_TOKEN}'}</C> 引用在 Claude Code 启动服务器时从你的 shell 环境读取，因此 token 永远不会出现在文件中。</>,
        example: `{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_TOKEN": "\${GITHUB_TOKEN}"
      }
    }
  }
}`,
        docsLink: '/en/mcp'
      }, {
        id: 'worktreeinclude',
        label: '.worktreeinclude',
        type: 'file',
        icon: 'md',
        color: '#8FA876',
        badge: 'committed',
        oneLiner: '要复制到新工作树中的 gitignore 文件',
        when: <>当 Claude 通过 <C>--worktree</C>、<C>EnterWorktree</C> 工具或子智能体 <C>isolation: worktree</C> 创建 git 工作树时读取</>,
        description: <>列出要从主仓库复制到每个新工作树的 gitignore 文件。工作树是全新的检出，因此像 <C>.env</C> 这样的未跟踪文件默认缺失。此处的模式使用 <C>.gitignore</C> 语法。只有匹配模式且被 gitignore 的文件才会被复制，因此已跟踪的文件永远不会被重复。</>,
        tips: [<>位于项目根目录，不在 <C>.claude/</C> 内</>, <>仅限 Git：如果你为不同的 VCS 配置了 <A href="/en/hooks#worktreecreate">WorktreeCreate hook</A>，则不会读取此文件。改为在你的 hook 脚本中复制文件</>, <>也适用于 <A href="/en/desktop#work-in-parallel-with-sessions">桌面应用</A> 中的并行会话</>],
        exampleIntro: '此示例将你的本地环境文件和密钥配置复制到 Claude 创建的每个工作树中。注释以 # 开头，空行被忽略，与 .gitignore 相同。',
        example: `# Local environment
.env
.env.local

# API credentials
config/secrets.json`,
        docsLink: '/en/worktrees#copy-gitignored-files-into-worktrees'
      }, {
        id: 'dot-claude',
        label: '.claude/',
        type: 'folder',
        icon: 'folder',
        color: 'var(--ce-accent)',
        oneLiner: '项目级配置、规则和扩展',
        description: 'Claude Code 读取的所有项目特定内容。如果你使用 git，请将此处的大多数文件提交以便团队共享；少数文件（如 settings.local.json）会自动被 gitignore。每个文件的标记显示了这一点。',
        children: [{
          id: 'settings-json',
          label: 'settings.json',
          type: 'file',
          icon: 'json',
          color: 'var(--ce-text-3)',
          badge: 'committed',
          oneLiner: '权限、钩子和配置',
          when: <>覆盖全局 <C>~/.claude/settings.json</C>。本地设置、CLI 标志和托管设置覆盖此设置</>,
          description: 'Claude Code 直接应用的设置。权限控制 Claude 可以使用哪些命令和工具；钩子在会话中的特定点运行你的脚本。与 Claude 作为指导读取的 CLAUDE.md 不同，这些是强制执行的，无论 Claude 是否遵循。',
          contains: [<><A href="/en/permissions">permissions</A>：在 Claude 使用特定工具或命令之前允许、拒绝或提示</>, <><A href="/en/hooks">hooks</A>：在工具调用之前或文件编辑之后等事件上运行你自己的脚本</>, <><A href="/en/statusline">statusLine</A>：自定义 Claude 工作时底部显示的行</>, <><A href="/en/settings#available-settings">model</A>：为此项目选择默认模型</>, <><A href="/en/settings#environment-variables">env</A>：在每次会话中设置的环境变量</>, <><A href="/en/output-styles">outputStyle</A>：从 output-styles/ 选择自定义系统提示样式</>],
          tips: [<>Bash 权限模式支持通配符：<C>Bash(npm test *)</C> 匹配以 <C>npm test</C> 开头的任何命令</>, <>数组设置（如 <C>permissions.allow</C>）跨所有范围合并；标量设置（如 <C>model</C>）使用最具体的值</>],
          exampleIntro: <>此示例允许 <C>npm test</C> 和 <C>npm run</C> 命令无需提示，阻止 <C>rm -rf</C>，并在 Claude 编辑或写入文件后对文件运行 Prettier。</>,
          example: `{
  "permissions": {
    "allow": [
      "Bash(npm test *)",
      "Bash(npm run *)"
    ],
    "deny": [
      "Bash(rm -rf *)"
    ]
  },
  "hooks": {
    "PostToolUse": [{
      "matcher": "Edit|Write",
      "hooks": [{
        "type": "command",
        "command": "jq -r '.tool_input.file_path' | xargs npx prettier --write"
      }]
    }]
  }
}`,
          docsLink: '/en/settings'
        }, {
          id: 'settings-local-json',
          label: 'settings.local.json',
          type: 'file',
          icon: 'json',
          color: 'var(--ce-text-3)',
          badge: 'gitignored',
          oneLiner: '你对此项目的个人设置覆盖',
          when: '用户可编辑设置文件中的最高优先级；CLI 标志和托管设置仍然优先',
          description: '优先于项目默认值的个人设置。与 settings.json 相同的 JSON 格式，但不提交。当你需要与团队配置不同的权限或默认值时使用。',
          tips: [<>与 settings.json 相同的 schema。数组设置（如 <C>permissions.allow</C>）跨范围合并；标量设置（如 <C>model</C>）使用本地值</>, <>Claude Code 在首次写入时将此文件添加到 <C>~/.config/git/ignore</C>。如果你使用自定义 <C>core.excludesFile</C>，也在那里添加模式。要与团队共享忽略规则，也将其添加到项目 <C>.gitignore</C></>],
          exampleIntro: '此示例在团队 settings.json 允许的基础上添加 Docker 权限。',
          example: `{
  "permissions": {
    "allow": [
      "Bash(docker *)"
    ]
  }
}`,
          docsLink: '/en/settings'
        }, {
          id: 'rules',
          label: 'rules/',
          type: 'folder',
          icon: 'folder',
          color: '#9B7BC4',
          oneLiner: '主题限定的指令，可选择按文件路径门控',
          when: <>没有 <C>paths:</C> 的规则在会话开始时加载。有 <C>paths:</C> 的规则在匹配文件进入上下文时加载</>,
          description: [<>项目指令拆分为主题文件，可以根据文件路径有条件地加载。没有 <C>paths:</C> frontmatter 的规则在会话开始时像 CLAUDE.md 一样加载；有 <C>paths:</C> 的规则仅在 Claude 读取匹配文件时加载。</>, <>与 CLAUDE.md 一样，规则是 Claude 读取的指导，而不是 Claude Code 强制执行的配置。要保证行为，请使用 <A href="/en/hooks">hooks</A> 或 <A href="/en/permissions">permissions</A>。</>],
          tips: [<>使用带 glob 的 <C>paths:</C> frontmatter 将规则限定到目录或文件类型</>, <>子目录有效：<C>.claude/rules/frontend/react.md</C> 会被自动发现</>, '当 CLAUDE.md 接近 200 行时，开始拆分为规则'],
          docsLink: '/en/memory#organize-rules-with-claude/rules/',
          children: [{
            id: 'rule-testing',
            label: 'testing.md',
            type: 'file',
            icon: 'md',
            color: '#9B7BC4',
            badge: 'committed',
            oneLiner: '限定到测试文件的测试约定',
            when: <>当 Claude 读取匹配以下 <C>paths:</C> glob 的文件时加载</>,
            description: <>一个仅在 Claude 处理测试文件时加载的示例规则。frontmatter 中的 <C>paths:</C> glob 定义了哪些文件触发它；这里是任何以 .test.ts 或 .test.tsx 结尾的文件。对于其他文件，此规则不会加载到上下文中。</>,
            example: `---
paths:
  - "**/*.test.ts"
  - "**/*.test.tsx"
---

# Testing Rules

- Use descriptive test names: "should [expected] when [condition]"
- Mock external dependencies, not internal modules
- Clean up side effects in afterEach`
          }, {
            id: 'rule-api',
            label: 'api-design.md',
            type: 'file',
            icon: 'md',
            color: '#9B7BC4',
            badge: 'committed',
            oneLiner: '限定到后端代码的 API 约定',
            when: <>当 Claude 读取匹配以下 <C>paths:</C> glob 的文件时加载</>,
            description: <>第二个示例展示限定到后端代码的规则。<C>paths:</C> glob 匹配 src/api/ 下的文件，因此这些约定仅在 Claude 编辑 API 路由时加载。</>,
            example: `---
paths:
  - "src/api/**/*.ts"
---

# API Design Rules

- All endpoints must validate input with Zod schemas
- Return shape: { data: T } | { error: string }
- Rate limit all public endpoints`
          }]
        }, {
          id: 'skills',
          label: 'skills/',
          type: 'folder',
          icon: 'folder',
          color: '#D4A843',
          oneLiner: '你或 Claude 按名称调用的可重用提示',
          when: <>使用 <C>/skill-name</C> 调用，或当 Claude 将任务匹配到技能时</>,
          description: <>每个技能是一个包含 SKILL.md 文件及其所需支持文件的文件夹。默认情况下，你和 Claude 都可以调用技能。使用 frontmatter 控制：<C>disable-model-invocation: true</C> 用于仅用户的工作流如 <C>/deploy</C>，或 <C>user-invocable: false</C> 从 <C>/</C> 菜单中隐藏，同时 Claude 仍可调用。</>,
          tips: [<>技能接受参数：<C>/deploy staging</C> 将 "staging" 作为 <C>$ARGUMENTS</C> 传递。使用 <C>$0</C>、<C>$1</C> 等进行位置访问</>, <>description</> frontmatter 决定 Claude 何时自动调用技能</>, '将参考文档与 SKILL.md 一起捆绑。Claude 知道技能目录路径，可以在你提及时读取支持文件'],
          docsLink: '/en/skills',
          children: [{
            id: 'skill-review',
            label: 'security-review/',
            type: 'folder',
            icon: 'folder',
            color: '#D4A843',
            oneLiner: '将 SKILL.md 与支持文件捆绑的技能',
            children: [{
              id: 'skill-review-md',
              label: 'SKILL.md',
              type: 'file',
              icon: 'md',
              color: '#D4A843',
              badge: 'committed',
              oneLiner: '入口点：触发器、可调用性、指令',
              when: <>用户输入 <C>/security-review &lt;target&gt;</C>；Claude 无法自动调用此技能</>,
              description: [<>此技能使用 <C>disable-model-invocation: true</C>，因此只有你可以触发它；Claude 永远不会自行调用。</>, <>C>!`...`</C> 行运行 shell 命令并将其输出注入提示。<C>$ARGUMENTS</C> 替换你在技能名称后输入的内容。Claude 看到技能目录路径，因此提及捆绑的文件如 checklist.md 可以让 Claude 读取它。</>],
              example: `---
description: Reviews code changes for security vulnerabilities, authentication gaps, and injection risks
disable-model-invocation: true
argument-hint: <branch-or-path>
---

## Diff to review

!\`git diff $ARGUMENTS\`

Audit the changes above for:

1. Injection vulnerabilities (SQL, XSS, command)
2. Authentication and authorization gaps
3. Hardcoded secrets or credentials

Use checklist.md in this skill directory for the full review checklist.

Report findings with severity ratings and remediation steps.`
            }, {
              id: 'skill-checklist',
              label: 'checklist.md',
              type: 'file',
              icon: 'md',
              color: '#D4A843',
              badge: 'committed',
              oneLiner: '与技能捆绑的支持文件',
              when: 'Claude 在运行技能时按需读取',
              description: <>技能可以捆绑任何支持文件：参考文档、模板、脚本。技能目录路径被添加到 SKILL.md 前面，因此 Claude 可以按名称读取捆绑的文件。对于 bash 注入命令中的脚本，使用 <C>{'${CLAUDE_SKILL_DIR}'}</C> 占位符。</>,
              example: `# Security Review Checklist

## Input Validation
- [ ] All user input sanitized before DB queries
- [ ] File upload MIME types validated
- [ ] Path traversal prevented on file operations

## Authentication
- [ ] JWT tokens expire after 24 hours
- [ ] API keys stored in environment variables
- [ ] Passwords hashed with bcrypt or argon2`
            }]
          }]
        }, {
          id: 'commands',
          label: 'commands/',
          type: 'folder',
          icon: 'folder',
          color: '#788C5D',
          oneLiner: <>使用 <C>/name</C> 调用的单文件提示</>,
          note: commandsNote,
          when: <>用户输入 <C>/command-name</C></>,
          description: <>C>commands/deploy.md</C> 处的文件创建 <C>/deploy</C>，与 <C>skills/deploy/SKILL.md</C> 处的技能相同，两者都可以被 Claude 自动调用。技能使用包含 SKILL.md 的目录，让你可以将参考文档、模板或脚本与提示一起捆绑。</>,
          tips: [<>在文件中使用 <C>$ARGUMENTS</C> 接受参数：<C>/fix-issue 123</C></>, '如果技能和命令同名，技能优先', '新命令通常应该是技能；命令仍然受支持'],
          docsLink: '/en/skills',
          children: [{
            id: 'cmd-example',
            label: 'fix-issue.md',
            type: 'file',
            icon: 'md',
            color: '#788C5D',
            badge: 'committed',
            oneLiner: <>作为 <C>/fix-issue &lt;number&gt;</C> 调用</>,
            note: commandsNote,
            description: [<>用于修复 GitHub 问题的示例命令。输入 <C>/fix-issue 123</C>，<C>!`...`</C> 行在你的 shell 中运行 <C>gh issue view 123</C>，在 Claude 看到之前将输出注入提示。</>, <>C>$ARGUMENTS</C> 替换你在命令名称后输入的内容。对于位置访问，使用 <C>$0</C> <C>$1</C> 等。</>],
            example: `---
argument-hint: <issue-number>
---

!\`gh issue view $ARGUMENTS\`

Investigate and fix the issue above.

1. Trace the bug to its root cause
2. Implement the fix
3. Write or update tests
4. Summarize what you changed and why`
          }]
        }, {
          id: 'output-styles',
          label: 'output-styles/',
          type: 'folder',
          icon: 'folder',
          color: '#5AA7A7',
          oneLiner: '项目范围的输出样式，如果你的团队共享',
          when: '在会话开始时通过 outputStyle 设置选择时应用',
          description: <>输出样式通常是个人的，因此大多数在 <C>~/.claude/output-styles/</C> 中。如果你的团队共享样式（如每个人都使用的审查模式），请在此处放置一个。参见 <A href="#ce-global-output-styles">全局标签页</A> 了解完整说明和示例。</>,
          docsLink: '/en/output-styles',
          children: []
        }, {
          id: 'agents',
          label: 'agents/',
          type: 'folder',
          icon: 'folder',
          color: '#C46686',
          oneLiner: '拥有自己上下文窗口的专门子智能体',
          when: '在你或 Claude 调用时在自己的上下文窗口中运行',
          description: '每个 markdown 文件定义一个拥有自己系统提示、工具访问和可选模型的子智能体。子智能体在全新的上下文窗口中运行，保持主对话干净。适用于并行工作或隔离任务。',
          tips: ['每个智能体获得全新的上下文窗口，与主会话分离', <>使用 <C>tools:</C> frontmatter 字段限制每个智能体的工具访问</>, '输入 @ 并从自动完成中选择智能体直接委派'],
          docsLink: '/en/sub-agents',
          children: [{
            id: 'agent-reviewer',
            label: 'code-reviewer.md',
            type: 'file',
            icon: 'md',
            color: '#C46686',
            badge: 'committed',
            oneLiner: '用于隔离代码审查的子智能体',
            when: 'Claude 为审查任务生成它，或你从自动完成中 @提及它',
            description: <>一个限制为只读工具的示例子智能体。<C>description</C> frontmatter 告诉 Claude 何时自动委派给它；<C>tools:</C> 将其限制为 Read、Grep 和 Glob，以便它可以检查代码但永远不能编辑。正文成为子智能体的系统提示。</>,
            example: `---
name: code-reviewer
description: Reviews code for correctness, security, and maintainability
tools: Read, Grep, Glob
---

You are a senior code reviewer. Review for:

1. Correctness: logic errors, edge cases, null handling
2. Security: injection, auth bypass, data exposure
3. Maintainability: naming, complexity, duplication

Every finding must include a concrete fix.`
          }]
        }, {
          id: 'agent-memory',
          label: 'agent-memory/',
          type: 'folder',
          icon: 'folder',
          color: '#C46686',
          badge: 'committed',
          autogen: true,
          oneLiner: '子智能体持久记忆，与主会话自动记忆分离',
          when: 'MEMORY.md 的前 200 行（上限 25KB）在子智能体运行时加载到系统提示中',
          description: <>frontmatter 中有 <C>memory: project</C> 的子智能体会在此处获得专用记忆目录。这与 <C>~/.claude/projects/</C> 处的 <A href="/en/memory#auto-memory">主会话自动记忆</A> 不同：每个子智能体读写自己的 MEMORY.md，而不是你的。</>,
          tips: [<>仅为设置了 <C>memory:</C> frontmatter 字段的子智能体创建</>, <>此目录保存项目范围的子智能体记忆，旨在与团队共享。要将记忆排除在版本控制之外，使用 <C>memory: local</C>，它会改为写入 <C>.claude/agent-memory-local/</C>。对于跨项目记忆，使用 <C>memory: user</C>，它会写入 <C>~/.claude/agent-memory/</C></>, <>主会话自动记忆是不同的功能；参见全局标签页中的 <C>~/.claude/projects/</C></>],
          docsLink: '/en/sub-agents#enable-persistent-memory',
          children: [{
            id: 'agent-memory-sub',
            label: '<agent-name>/',
            type: 'folder',
            icon: 'folder',
            color: '#C46686',
            autogen: true,
            children: [{
              id: 'agent-memory-md',
              label: 'MEMORY.md',
              type: 'file',
              icon: 'md',
              color: '#C46686',
              badge: 'committed',
              autogen: true,
              oneLiner: '子智能体自动写入和维护此文件',
              when: '子智能体启动时加载到子智能体系统提示中',
              description: <>与你的 <A href="/en/memory#auto-memory">主自动记忆</A> 工作方式相同：子智能体自行创建和更新此文件。你不写它。子智能体在每次任务开始时读取它，并写回它学到的内容。</>,
              example: `# code-reviewer memory

## Patterns seen
- Project uses custom Result<T, E> type, not exceptions
- Auth middleware expects Bearer token in Authorization header
- Tests use factory functions in test/factories/

## Recurring issues
- Missing null checks on API responses (src/api/*)
- Unhandled promise rejections in background jobs`
            }]
          }]
        }]
      }]
    },
    global: {
      label: '~/',
      children: [{
        id: 'claude-json',
        label: '.claude.json',
        type: 'file',
        icon: 'json',
        color: 'var(--ce-text-3)',
        badge: 'local',
        oneLiner: '应用状态和 UI 偏好',
        when: <>在会话开始时读取你的偏好和 MCP 服务器。当你在 <C>/config</C> 中更改设置或批准信任提示时，Claude Code 会写回它</>,
        description: <>保存不属于 settings.json 的状态：主题、OAuth 会话、每个项目的信任决策、你的个人 MCP 服务器和 UI 开关。主要通过 <C>/config</C> 管理，而不是直接编辑。</>,
        tips: [<>IDE 开关如 <C>autoConnectIde</C> 和 <C>externalEditorContext</C> 位于此处，不在 settings.json 中</>, <>C>projects</C> 键跟踪每个项目的状态，如信任对话接受和上次会话指标。你在会话中批准的权限规则改到 <C>.claude/settings.local.json</C></>, <>此处的 MCP 服务器仅属于你：用户范围适用于所有项目，本地范围是每个项目但不提交。团队共享的服务器改在项目根目录的 <C>.mcp.json</C> 中</>],
        example: `{
  "autoConnectIde": true,
  "externalEditorContext": true,
  "mcpServers": {
    "my-tools": {
      "command": "npx",
      "args": ["-y", "@example/mcp-server"]
    }
  }
}`,
        docsLink: '/en/settings#global-config-settings'
      }, {
        id: 'global-dot-claude',
        label: '.claude/',
        type: 'folder',
        icon: 'folder',
        color: 'var(--ce-accent)',
        oneLiner: '你跨所有项目的个人配置',
        description: '项目 .claude/ 目录的全局对应物。此处的文件适用于你工作的每个项目，永远不会提交到任何仓库。',
        children: [{
          id: 'global-claude-md',
          label: 'CLAUDE.md',
          type: 'file',
          icon: 'md',
          color: '#6A9BCC',
          badge: 'local',
          oneLiner: '跨每个项目的个人偏好',
          when: '在每次会话开始时加载，在每个项目中',
          description: '你的全局指令文件。在会话开始时与项目 CLAUDE.md 一起加载，因此两者同时在上下文中。当指令冲突时，项目级指令优先。保持此处为适用于所有地方的偏好：响应风格、提交格式、个人约定。',
          tips: ['保持简短，因为它为每个项目加载到上下文中，与该项目自己的 CLAUDE.md 一起', '适合响应风格、提交格式和个人约定'],
          example: `# Global preferences

- Keep explanations concise
- Use conventional commit format
- Show the terminal command to verify changes
- Prefer composition over inheritance`,
          docsLink: '/en/memory'
        }, {
          id: 'global-settings',
          label: 'settings.json',
          type: 'file',
          icon: 'json',
          color: 'var(--ce-text-3)',
          badge: 'local',
          oneLiner: '所有项目的默认设置',
          when: '你的默认值。项目和本地 settings.json 覆盖你在此处设置的任何相同键',
          description: [<>与项目 <C>settings.json</C> 相同的键：权限、钩子、模型、环境变量等。将你想在每个项目中使用的设置放在此处，如你始终允许的权限、首选模型或无论你在哪个项目中都运行的通知钩子。</>, <>设置遵循优先级顺序：项目 <C>settings.json</C> 覆盖你在此处设置的任何匹配键。这与 CLAUDE.md 不同，全局和项目文件都加载到上下文中，而不是按键合并。</>],
          example: `{
  "permissions": {
    "allow": [
      "Bash(git log *)",
      "Bash(git diff *)"
    ]
  }
}`,
          docsLink: '/en/settings'
        }, {
          id: 'keybindings',
          label: 'keybindings.json',
          type: 'file',
          icon: 'json',
          color: 'var(--ce-text-3)',
          badge: 'local',
          oneLiner: '自定义键盘快捷键',
          when: '在会话开始时读取，编辑文件时热重载',
          description: <>在交互式 CLI 中重新绑定键盘快捷键。运行 <C>/keybindings</C> 创建或打开此文件并带有 schema 参考。Ctrl+C、Ctrl+D、Ctrl+M 和 Caps Lock 是保留的，无法重新绑定。</>,
          exampleIntro: <>此示例将 <C>Ctrl+E</C> 绑定到打开外部编辑器，并通过设置为 <C>null</C> 解除 <C>Ctrl+U</C> 绑定。<C>context</C> 字段将绑定限定到 CLI 的特定部分，这里是主聊天输入。</>,
          example: `{
  "$schema": "https://www.schemastore.org/claude-code-keybindings.json",
  "$docs": "https://code.claude.com/docs/en/keybindings",
  "bindings": [
    {
      "context": "Chat",
      "bindings": {
        "ctrl+e": "chat:externalEditor",
        "ctrl+u": null
      }
    }
  ]
}`,
          docsLink: '/en/keybindings'
        }, {
          id: 'themes',
          label: 'themes/',
          type: 'folder',
          icon: 'folder',
          color: '#5AA7A7',
          oneLiner: '自定义颜色主题',
          when: <>在会话开始时读取，文件更改时热重载。在 <C>/theme</C> 中列出</>,
          description: <>每个 <C>.json</C> 文件定义一个自定义颜色主题：内置的 <C>base</C> 预设加上颜色 token 的 <C>overrides</C> 映射。使用 <C>/theme</C> 交互式创建或手动编写 JSON。选择自定义主题会将 <C>custom:&lt;slug&gt;</C> 存储为你的主题偏好。</>,
          example: `{
  "name": "Dracula",
  "base": "dark",
  "overrides": {
    "claude": "#bd93f9",
    "error": "#ff5555",
    "success": "#50fa7b"
  }
}`,
          docsLink: '/en/terminal-config#create-a-custom-theme',
          children: []
        }, {
          id: 'global-projects',
          label: 'projects/',
          type: 'folder',
          icon: 'folder',
          color: '#E8A45C',
          autogen: true,
          oneLiner: '自动记忆：Claude 给自己的笔记，按项目',
          when: 'MEMORY.md 在会话开始时加载；主题文件按需读取',
          description: '自动记忆让 Claude 无需你编写任何内容即可跨会话积累知识。Claude 在工作时保存笔记：构建命令、调试见解、架构笔记。每个项目获得自己的记忆目录，按仓库路径索引。',
          tips: [<>默认开启。使用 <C>/memory</C> 或设置中的 <C>autoMemoryEnabled</C> 切换</>, 'MEMORY.md 是每次会话加载的索引。前 200 行或 25KB（以先到者为准）会被读取', '主题文件如 debugging.md 按需读取，不在启动时', '这些是纯 markdown。随时编辑或删除它们'],
          docsLink: '/en/memory#auto-memory',
          children: [{
            id: 'memory-dir',
            label: '<project>/memory/',
            type: 'folder',
            icon: 'folder',
            color: '#E8A45C',
            autogen: true,
            oneLiner: 'Claude 为一个项目积累的知识',
            children: [{
              id: 'memory-md',
              label: 'MEMORY.md',
              type: 'file',
              icon: 'md',
              color: '#E8A45C',
              badge: 'local',
              autogen: true,
              oneLiner: 'Claude 自动写入和维护此文件',
              when: '前 200 行（上限 25KB）在会话开始时加载',
              description: 'Claude 在工作时创建和更新此文件；你不自己写它。它作为 Claude 在每次会话开始时读取的索引，指向主题文件以获取详细信息。你可以编辑或删除它，但 Claude 会继续更新它。',
              example: `# Memory Index

## Project
- [build-and-test.md](build-and-test.md): npm run build (~45s), Vitest, dev server on 3001
- [architecture.md](architecture.md): API client singleton, refresh-token auth

## Reference
- [debugging.md](debugging.md): auth token rotation and DB connection troubleshooting`,
              docsLink: '/en/memory'
            }, {
              id: 'memory-topic',
              label: 'debugging.md',
              type: 'file',
              icon: 'md',
              color: '#E8A45C',
              badge: 'local',
              autogen: true,
              oneLiner: '当 MEMORY.md 变长时 Claude 写入的主题笔记',
              when: '当相关任务出现时 Claude 读取此文件',
              description: '当 MEMORY.md 增长过长时 Claude 创建的主题文件示例。Claude 根据拆分的内容选择文件名：debugging.md、architecture.md、build-commands.md 等。你永远不会自己创建这些。Claude 仅在当前任务相关时才读取主题文件。',
              example: `---
name: Debugging patterns
description: Auth token rotation and database connection troubleshooting for this project
type: reference
---

## Auth Token Issues
- Refresh token rotation: old token invalidated immediately
- If 401 after refresh: check clock skew between client and server

## Database Connection Drops
- Connection pool: max 10 in dev, 50 in prod
- Always check \`docker compose ps\` first`
            }]
          }]
        }, {
          id: 'global-rules',
          label: 'rules/',
          type: 'folder',
          icon: 'folder',
          color: '#9B7BC4',
          oneLiner: '适用于每个项目的用户级规则',
          when: <>没有 <C>paths:</C> 的规则在会话开始时加载。有 <C>paths:</C> 的规则在匹配文件进入上下文时加载</>,
          description: '与项目 .claude/rules/ 相同，但适用于所有地方。将此用于你希望跨所有工作的约定，如个人代码风格或提交消息格式。',
          docsLink: '/en/memory#organize-rules-with-claude/rules/',
          children: []
        }, {
          id: 'global-skills',
          label: 'skills/',
          type: 'folder',
          icon: 'folder',
          color: '#D4A843',
          oneLiner: '在每个项目中可用的个人技能',
          when: <>在任何项目中使用 <C>/skill-name</C> 调用</>,
          description: '你为自己构建的在所有地方工作的技能。与项目技能结构相同：每个是包含 SKILL.md 的文件夹，限定到你的用户帐户而非单个项目。',
          docsLink: '/en/skills',
          children: []
        }, {
          id: 'global-commands',
          label: 'commands/',
          type: 'folder',
          icon: 'folder',
          color: '#788C5D',
          oneLiner: '在每个项目中可用的个人单文件命令',
          note: commandsNote,
          when: <>用户在任何项目中输入 <C>/command-name</C></>,
          description: '与项目 commands/ 相同，但限定到你的用户帐户。每个 markdown 文件成为在所有地方可用的命令。',
          docsLink: '/en/skills',
          children: []
        }, {
          id: 'global-output-styles',
          label: 'output-styles/',
          type: 'folder',
          icon: 'folder',
          color: '#5AA7A7',
          oneLiner: '调整 Claude 工作方式的自定义系统提示部分',
          when: '在会话开始时通过 outputStyle 设置选择时应用',
          description: [<>每个 markdown 文件定义一个输出样式：附加到系统提示的部分，默认情况下也会删除内置的软件工程任务指令。使用此功能将 Claude Code 适应编程以外的用途，或添加教学或审查模式。</>, <>使用 <C>/config</C> 或设置中的 <C>outputStyle</C> 键选择内置或自定义样式。此处的样式在每个项目中可用；同名的项目级样式优先。</>],
          tips: ['内置样式 Explanatory 和 Learning 随 Claude Code 包含；自定义样式放在此处', <>在 frontmatter 中设置 <C>keep-coding-instructions: true</C> 以在你的附加内容旁边保留默认任务指令</>, '更改在下一个会话生效，因为系统提示在启动时为缓存而固定'],
          docsLink: '/en/output-styles',
          children: [{
            id: 'output-style-example',
            label: 'teaching.md',
            type: 'file',
            icon: 'md',
            color: '#5AA7A7',
            badge: 'local',
            oneLiner: '添加解释并将小更改留给你的示例样式',
            when: <>当设置中的 <C>outputStyle</C> 设置为 <C>teaching</C> 时激活</>,
            description: <>此样式向系统提示附加指令：Claude 在每个任务后添加"为什么选择此方法"说明，并为 10 行以下的更改留下 TODO(human) 标记而不是自己编写。通过将 <C>outputStyle</C> 设置为不带 .md 的文件名，或你在 frontmatter 中设置的 <C>name</C> 字段来选择它。</>,
            example: `---
description: Explains reasoning and asks you to implement small pieces
keep-coding-instructions: true
---

After completing each task, add a brief "Why this approach" note
explaining the key design decision.

When a change is under 10 lines, ask the user to implement it
themselves by leaving a TODO(human) marker instead of writing it.`
          }]
        }, {
          id: 'global-agents',
          label: 'agents/',
          type: 'folder',
          icon: 'folder',
          color: '#C46686',
          oneLiner: '在每个项目中可用的个人子智能体',
          when: 'Claude 委派或你在任何项目中 @提及',
          description: '在此处定义的子智能体在你的所有项目中可用。与项目智能体格式相同。',
          docsLink: '/en/sub-agents',
          children: []
        }, {
          id: 'global-agent-memory',
          label: 'agent-memory/',
          type: 'folder',
          icon: 'folder',
          color: '#C46686',
          autogen: true,
          oneLiner: <>带 <C>memory: user</C> 的子智能体的持久记忆</>,
          when: '子智能体启动时加载到子智能体系统提示中',
          description: <>frontmatter 中有 <C>memory: user</C> 的子智能体将知识存储在此处，跨所有项目持久化。对于项目范围的子智能体记忆，改为参见 <C>.claude/agent-memory/</C>。</>,
          docsLink: '/en/sub-agents#enable-persistent-memory',
          children: []
        }]
      }]
    }
  }), []);
  const BADGE_STYLES = useMemo(() => ({
    committed: {
      bg: 'rgba(85,138,66,0.08)',
      color: 'var(--ce-badge-committed)',
      border: 'rgba(85,138,66,0.15)',
      label: '已提交'
    },
    gitignored: {
      bg: 'rgba(217,119,87,0.06)',
      color: 'var(--ce-badge-gitignored)',
      border: 'rgba(217,119,87,0.15)',
      label: '已 gitignore'
    },
    local: {
      bg: 'rgba(115,114,108,0.06)',
      color: 'var(--ce-badge-local)',
      border: 'rgba(115,114,108,0.12)',
      label: '仅本地'
    },
    autogen: {
      bg: 'rgba(232,164,92,0.1)',
      color: 'var(--ce-badge-autogen)',
      border: 'rgba(232,164,92,0.2)',
      label: 'Claude 写入'
    }
  }), []);
  const allNodes = useMemo(() => {
    const flatten = (nodes, acc, path, parentId) => {
      for (const node of nodes) {
        const nextPath = [...path, node.label];
        acc[node.id] = {
          ...node,
          path: nextPath,
          parentId
        };
        if (node.children) flatten(node.children, acc, nextPath, node.id);
      }
      return acc;
    };
    const project = flatten(FILE_TREE.project.children, {}, [FILE_TREE.project.label]);
    const global = flatten(FILE_TREE.global.children, {}, [FILE_TREE.global.label]);
    for (const id in project) project[id].root = 'project';
    for (const id in global) global[id].root = 'global';
    return {
      ...project,
      ...global
    };
  }, [FILE_TREE]);
  const allFolderIds = useMemo(() => Object.keys(allNodes).filter(id => allNodes[id].type === 'folder'), [allNodes]);
  const DEFAULT_EXPANDED = ['dot-claude', 'rules', 'skills', 'skill-review', 'commands', 'agents', 'agent-memory', 'agent-memory-sub', 'global-dot-claude', 'global-output-styles', 'global-projects', 'memory-dir'];
  const [mounted, setMounted] = useState(false);
  const [activeRoot, setActiveRoot] = useState('project');
  const [selectedId, setSelectedId] = useState('claude-md');
  const [expandedFolders, setExpandedFolders] = useState(() => new Set(DEFAULT_EXPANDED));
  const [forceMobile, setForceMobile] = useState(false);
  const [copiedId, setCopiedId] = useState(null);
  const [isFullscreen, setIsFullscreen] = useState(false);
  const copyTimeoutRef = useRef(null);
  const rootRef = useRef(null);
  useEffect(() => {
    setMounted(true);
    const applyHash = scroll => {
      const hash = window.location.hash.slice(1);
      if (!hash.startsWith('ce-')) return;
      const id = hash.slice(3);
      const node = allNodes[id];
      if (!node) return;
      setActiveRoot(node.root);
      setSelectedId(id);
      setExpandedFolders(new Set(allFolderIds));
      if (scroll && rootRef.current) rootRef.current.scrollIntoView({
        behavior: 'smooth',
        block: 'start'
      });
    };
    applyHash(false);
    const onHashChange = () => applyHash(true);
    const onFsChange = () => setIsFullscreen(!!document.fullscreenElement);
    window.addEventListener('hashchange', onHashChange);
    document.addEventListener('fullscreenchange', onFsChange);
    return () => {
      if (copyTimeoutRef.current) clearTimeout(copyTimeoutRef.current);
      window.removeEventListener('hashchange', onHashChange);
      document.removeEventListener('fullscreenchange', onFsChange);
    };
  }, []);
  useEffect(() => {
    if (!mounted || !rootRef.current) return;
    const hash = window.location.hash.slice(1);
    if (hash.startsWith('ce-') && allNodes[hash.slice(3)]) {
      rootRef.current.scrollIntoView({
        behavior: 'smooth',
        block: 'start'
      });
    }
  }, [mounted]);
  if (!mounted) return null;
  const selected = allNodes[selectedId];
  const tree = FILE_TREE[activeRoot];
  const isCopied = copiedId === selected.id;
  const toggleFolder = id => {
    const next = new Set(expandedFolders);
    next.has(id) ? next.delete(id) : next.add(id);
    setExpandedFolders(next);
  };
  const switchRoot = root => {
    if (root === activeRoot) return;
    setActiveRoot(root);
    const firstId = FILE_TREE[root].children[0].id;
    setSelectedId(firstId);
    try {
      history.replaceState(null, '', '#ce-' + firstId);
    } catch (e) {}
  };
  const toggleFullscreen = () => {
    if (!rootRef.current) return;
    if (document.fullscreenElement) document.exitFullscreen(); else rootRef.current.requestFullscreen().catch(() => {});
  };
  const selectNode = n => {
    setSelectedId(n.id);
    if (n.type === 'folder' && !expandedFolders.has(n.id)) toggleFolder(n.id);
    try {
      history.replaceState(null, '', '#ce-' + n.id);
    } catch (e) {}
  };
  const iconBtn = {
    width: 28,
    flexShrink: 0,
    borderRadius: '6px',
    border: 'none',
    cursor: 'pointer',
    background: 'transparent',
    color: 'var(--ce-text-4)',
    display: 'flex',
    alignItems: 'center',
    justifyContent: 'center'
  };
  const visibleFolderIds = allFolderIds.filter(id => allNodes[id].root === activeRoot);
  const allExpanded = visibleFolderIds.every(id => expandedFolders.has(id));
  const toggleAllFolders = () => {
    const next = new Set(expandedFolders);
    visibleFolderIds.forEach(id => allExpanded ? next.delete(id) : next.add(id));
    setExpandedFolders(next);
  };
  const onTreeKeyDown = e => {
    if (!['ArrowDown', 'ArrowUp', 'ArrowRight', 'ArrowLeft'].includes(e.key)) return;
    const visible = [];
    const walk = nodes => {
      for (const n of nodes) {
        visible.push(n.id);
        if (n.children && expandedFolders.has(n.id)) walk(n.children);
      }
    };
    walk(tree.children);
    const i = visible.indexOf(selectedId);
    if (i === -1) return;
    e.preventDefault();
    if (e.key === 'ArrowDown' && i < visible.length - 1) selectNode(allNodes[visible[i + 1]]); else if (e.key === 'ArrowUp' && i > 0) selectNode(allNodes[visible[i - 1]]); else if (e.key === 'ArrowRight' && selected.type === 'folder') {
      if (!expandedFolders.has(selectedId)) toggleFolder(selectedId); else if (selected.children && selected.children.length) selectNode(allNodes[selected.children[0].id]);
    } else if (e.key === 'ArrowLeft') {
      if (selected.type === 'folder' && expandedFolders.has(selectedId)) toggleFolder(selectedId); else if (selected.parentId) selectNode(allNodes[selected.parentId]);
    }
  };
  const copyExample = (id, text) => {
    const done = () => {
      setCopiedId(id);
      if (copyTimeoutRef.current) clearTimeout(copyTimeoutRef.current);
      copyTimeoutRef.current = setTimeout(() => setCopiedId(null), 2000);
    };
    const fallback = () => {
      const ta = document.createElement('textarea');
      ta.value = text;
      ta.style.position = 'fixed';
      ta.style.opacity = '0';
      document.body.appendChild(ta);
      ta.select();
      try {
        if (document.execCommand('copy')) done();
      } catch (e) {}
      document.body.removeChild(ta);
    };
    if (navigator.clipboard) {
      navigator.clipboard.writeText(text).then(done, fallback);
    } else {
      fallback();
    }
  };
  const renderIcon = (icon, color, size) => {
    const sz = size || 14;
    if (icon === 'folder') {
      return <svg width={sz} height={sz} viewBox="0 0 14 14" fill="none">
          <path d="M1.5 3.5a1 1 0 0 1 1-1h2.6l1 1.2h5.4a1 1 0 0 1 1 1v5.8a1 1 0 0 1-1 1h-9a1 1 0 0 1-1-1V3.5z" fill={color} fillOpacity="0.15" stroke={color} strokeWidth="1" />
        </svg>;
    }
    if (icon === 'json') {
      return <svg width={sz} height={sz} viewBox="0 0 14 14" fill="none">
          <rect x="2" y="1.5" width="10" height="11" rx="1.5" fill={color} fillOpacity="0.15" stroke={color} strokeWidth="1" />
          <text x="7" y="9" fontSize="6" fontFamily="monospace" fill={color} textAnchor="middle" fontWeight="700">{'{}'}</text>
        </svg>;
    }
    return <svg width={sz} height={sz} viewBox="0 0 14 14" fill="none">
        <rect x="2" y="1.5" width="10" height="11" rx="1.5" fill={color} fillOpacity="0.15" stroke={color} strokeWidth="1" />
        <line x1="4.5" y1="5" x2="9.5" y2="5" stroke={color} strokeWidth="1" />
        <line x1="4.5" y1="7" x2="9.5" y2="7" stroke={color} strokeWidth="1" />
        <line x1="4.5" y1="9" x2="8" y2="9" stroke={color} strokeWidth="1" />
      </svg>;
  };
  const renderNode = (node, depth) => {
    const isFolder = node.type === 'folder';
    const isExpanded = expandedFolders.has(node.id);
    const isSelected = selectedId === node.id;
    return <div key={node.id}>
        <button role="treeitem" tabIndex={-1} onClick={() => selectNode(node)} aria-selected={isSelected} aria-expanded={isFolder ? isExpanded : undefined} style={{
      display: 'flex',
      alignItems: 'center',
      gap: '5px',
      width: '100%',
      padding: `4px 8px 4px ${8 + depth * 16}px`,
      background: isSelected ? 'var(--ce-accent-bg)' : 'transparent',
      borderTop: 'none',
      borderRight: 'none',
      borderBottom: 'none',
      borderLeft: isSelected ? '2px solid var(--ce-accent)' : '2px solid transparent',
      outline: 'none',
      cursor: 'pointer',
      textAlign: 'left',
      fontFamily: 'var(--ce-mono)',
      fontSize: '13.5px',
      color: isSelected ? 'var(--ce-accent)' : 'var(--ce-text-2)',
      fontWeight: isSelected ? 550 : 400,
      transition: 'all 0.1s'
    }}>
          {isFolder ? <span onClick={e => {
      e.stopPropagation();
      toggleFolder(node.id);
    }} style={{
      fontSize: '14px',
      color: 'var(--ce-text-4)',
      width: '20px',
      height: '20px',
      display: 'inline-flex',
      alignItems: 'center',
      justifyContent: 'center',
      cursor: 'pointer',
      borderRadius: '4px',
      marginLeft: '-6px',
      flexShrink: 0
    }} onMouseEnter={e => {
      e.currentTarget.style.background = 'var(--ce-arrow-hover)';
      e.currentTarget.style.color = 'var(--ce-text-2)';
    }} onMouseLeave={e => {
      e.currentTarget.style.background = 'transparent';
      e.currentTarget.style.color = 'var(--ce-text-4)';
    }}>{isExpanded ? '▾' : '▸'}</span> : <span style={{
      width: '14px',
      flexShrink: 0
    }} />}
          {renderIcon(node.icon, node.color)}
          <span style={{
      flex: 1,
      overflow: 'hidden',
      textOverflow: 'ellipsis',
      whiteSpace: 'nowrap'
    }}>{node.label}</span>
          {node.badge && BADGE_STYLES[node.badge] && <span title={BADGE_STYLES[node.badge].label} style={{
      width: 6,
      height: 6,
      borderRadius: '50%',
      background: BADGE_STYLES[node.badge].color,
      flexShrink: 0,
      opacity: 0.7
    }} />}
        </button>
        {isFolder && isExpanded && node.children && <div role="group">{node.children.map(child => renderNode(child, depth + 1))}</div>}
      </div>;
  };
  return <>
    <style>{`
      .ce-root {
        --ce-mono: var(--font-mono, ui-monospace, monospace);
        --ce-accent: #D97757;
        --ce-accent-bg: rgba(217,119,87,0.06);
        --ce-accent-border: rgba(217,119,87,0.12);
        --ce-bg: #fff;
        --ce-surface: #FAFAF7;
        --ce-surface-hover: #F0EEE6;
        --ce-border: #E8E6DC;
        --ce-border-subtle: #F0EEE6;
        --ce-text: #141413;
        --ce-text-2: #5E5D59;
        --ce-text-3: #73726C;
        --ce-text-4: #9C9A92;
        --ce-text-5: #B8B6AE;
        --ce-sep: #D1CFC5;
        --ce-code-header: #F5F4ED;
        --ce-code-bg: #1A1918;
        --ce-arrow-hover: rgba(0,0,0,0.08);
        --ce-badge-committed: #3d6b2e;
        --ce-badge-gitignored: #b85c3a;
        --ce-badge-local: #5e5d59;
        --ce-badge-autogen: #b07520;
        --ce-when-text: #4a7fb5;
      }
      .dark .ce-root {
        --ce-bg: #1a1918;
        --ce-surface: #232221;
        --ce-surface-hover: #2e2d2b;
        --ce-border: #3a3936;
        --ce-border-subtle: #2e2d2b;
        --ce-text: #e8e6dc;
        --ce-text-2: #c4c2b8;
        --ce-text-3: #9c9a92;
        --ce-text-4: #73726c;
        --ce-text-5: #5e5d59;
        --ce-sep: #4a4946;
        --ce-code-header: #2e2d2b;
        --ce-code-bg: #0d0d0c;
        --ce-arrow-hover: rgba(255,255,255,0.08);
        --ce-badge-committed: #6fa85c;
        --ce-badge-gitignored: #e08a60;
        --ce-badge-local: #9c9a92;
        --ce-badge-autogen: #e8a45c;
        --ce-when-text: #8bb4e0;
      }
      .ce-mobile-fallback { display: none; border: 1px solid rgba(0,0,0,0.1); background: rgba(0,0,0,0.03); }
      .dark .ce-mobile-fallback { border-color: rgba(255,255,255,0.15); background: rgba(255,255,255,0.04); }
      @media (max-width: 700px) {
        .ce-root:not(.ce-force) { display: none !important; }
        .ce-mobile-fallback { display: block; }
      }
    `}</style>
    {!forceMobile && <div className="ce-mobile-fallback" style={{
    padding: '14px 16px',
    borderRadius: '8px',
    fontSize: '14px'
  }}>
      交互式浏览器在较大屏幕上效果最佳。参见下方的 <a href="#file-reference" style={{
    color: '#D97757'
  }}>文件参考表</a>，或 <button onClick={() => setForceMobile(true)} style={{
    border: 'none',
    background: 'none',
    padding: 0,
    color: '#D97757',
    textDecoration: 'underline',
    cursor: 'pointer',
    font: 'inherit'
  }}>仍然显示浏览器</button>。
    </div>}
    <div ref={rootRef} className={forceMobile ? 'ce-root ce-force' : 'ce-root'} style={{
    borderRadius: isFullscreen ? 0 : '12px',
    border: '1px solid var(--ce-border)',
    background: 'var(--ce-bg)',
    display: 'flex',
    alignItems: 'stretch',
    overflow: 'hidden',
    fontFamily: 'var(--font-sans, -apple-system, sans-serif)',
    ...isFullscreen && ({
      height: '100vh'
    })
  }}>
      {}
      <div style={{
    width: 'min(240px, 35%)',
    minWidth: '180px',
    flexShrink: 0,
    borderRight: '1px solid var(--ce-border-subtle)',
    background: 'var(--ce-surface)',
    display: 'flex',
    flexDirection: 'column'
  }}>
        <div style={{
    padding: '8px 8px 4px',
    borderBottom: '1px solid var(--ce-border-subtle)',
    display: 'flex',
    gap: '4px'
  }}>
          {['project', 'global'].map(root => <button key={root} onClick={() => switchRoot(root)} style={{
    flex: 1,
    padding: '6px 0',
    borderRadius: '6px',
    border: 'none',
    cursor: 'pointer',
    fontFamily: 'var(--ce-mono)',
    fontSize: '11.5px',
    background: activeRoot === root ? 'var(--ce-accent-bg)' : 'transparent',
    color: activeRoot === root ? 'var(--ce-accent)' : 'var(--ce-text-4)',
    fontWeight: activeRoot === root ? 600 : 430
  }}>
              {root === 'project' ? '项目' : '全局 (~/)'}
            </button>)}
          <button onClick={toggleAllFolders} title={allExpanded ? '全部折叠' : '全部展开'} style={{
    ...iconBtn,
    fontSize: 11
  }}>
            {allExpanded ? '⊟' : '⊞'}
          </button>
          <button onClick={toggleFullscreen} title={isFullscreen ? '退出全屏' : '全屏'} style={{
    ...iconBtn,
    fontSize: 13
  }}>
            {isFullscreen ? '⤡' : '⛶'}
          </button>
        </div>
        <div role="tree" aria-label="Configuration files" tabIndex={0} onKeyDown={onTreeKeyDown} style={{
    padding: '6px 0',
    overflowY: 'auto',
    flex: 1,
    outline: 'none'
  }}>
          {tree.children.map(node => renderNode(node, 0))}
        </div>
      </div>

      {}
      <div style={{
    flex: 1,
    minWidth: 0,
    padding: '20px 24px',
    minHeight: '400px',
    overflowY: 'auto'
  }}>
            <span aria-live="polite" style={{
    position: 'absolute',
    width: 1,
    height: 1,
    overflow: 'hidden',
    clip: 'rect(0 0 0 0)'
  }}>{selected.label} 已选中</span>
            {}
            <div style={{
    fontFamily: 'var(--ce-mono)',
    fontSize: '11px',
    color: 'var(--ce-text-4)',
    marginBottom: '10px',
    cursor: 'default'
  }}>
              {selected.path.map((seg, i) => <span key={i}>
                  <span style={{
    color: i === selected.path.length - 1 ? 'var(--ce-accent)' : 'var(--ce-text-4)'
  }}>{seg.replace(/\/$/, '')}</span>
                  {i < selected.path.length - 1 && <span style={{
    color: 'var(--ce-sep)'
  }}> / </span>}
                </span>)}
            </div>

            {}
            <div style={{
    display: 'flex',
    alignItems: 'flex-start',
    gap: '10px',
    marginBottom: '10px'
  }}>
              <span style={{
    flexShrink: 0,
    display: 'flex'
  }}>{renderIcon(selected.icon, selected.color, 24)}</span>
              <div style={{
    flex: 1,
    minWidth: 0
  }}>
                <div style={{
    fontSize: '22px',
    fontWeight: 600,
    color: 'var(--ce-text)',
    letterSpacing: '-0.3px',
    lineHeight: '26px'
  }}>{selected.label}</div>
                {selected.oneLiner && <div style={{
    fontSize: '15px',
    color: 'var(--ce-text-3)',
    marginTop: '3px'
  }}>{selected.oneLiner}</div>}
              </div>
              <div style={{
    display: 'flex',
    gap: '4px',
    flexShrink: 0
  }}>
                {[selected.autogen && 'autogen', selected.badge].filter(Boolean).map(k => {
    const s = BADGE_STYLES[k];
    if (!s) return null;
    return <span key={k} style={{
      fontFamily: 'var(--ce-mono)',
      fontSize: '10px',
      fontWeight: 600,
      textTransform: 'uppercase',
      letterSpacing: '0.3px',
      padding: '2px 6px',
      borderRadius: '4px',
      background: s.bg,
      color: s.color,
      border: `0.5px solid ${s.border}`
    }}>{s.label}</span>;
  })}
              </div>
            </div>

            {}
            {selected.note && <div style={{
    padding: '10px 12px',
    borderRadius: '8px',
    marginBottom: '14px',
    background: 'rgba(217,119,87,0.06)',
    border: '1px solid rgba(217,119,87,0.2)',
    borderLeft: '3px solid var(--ce-accent)',
    fontSize: '15px',
    color: 'var(--ce-text-2)',
    lineHeight: 1.6
  }}>
                {selected.note}
              </div>}

            {}
            {selected.when && <div style={{
    padding: '8px 12px',
    borderRadius: '6px',
    background: 'rgba(106,155,204,0.06)',
    border: '0.5px solid rgba(106,155,204,0.12)',
    fontSize: '15px',
    color: 'var(--ce-when-text)',
    marginBottom: '16px'
  }}>
                <div style={{
    fontSize: '10px',
    fontWeight: 700,
    textTransform: 'uppercase',
    letterSpacing: '0.4px',
    opacity: 0.65,
    marginBottom: '3px'
  }}>加载时机</div>
                <div style={{
    fontWeight: 500
  }}>{selected.when}</div>
              </div>}

            {}
            {selected.description && <div style={{
    fontSize: '16px',
    color: 'var(--ce-text-2)',
    lineHeight: 1.65,
    marginBottom: '16px'
  }}>
                {Array.isArray(selected.description) ? selected.description.map((para, i) => <div key={i} style={{
    marginBottom: i < selected.description.length - 1 ? '12px' : 0
  }}>{para}</div>) : selected.description}
              </div>}

            {}
            {selected.contains && selected.contains.length > 0 && <div style={{
    marginBottom: '16px'
  }}>
                <div style={{
    fontSize: '11px',
    fontWeight: 700,
    color: 'var(--ce-text-4)',
    textTransform: 'uppercase',
    letterSpacing: '0.4px',
    marginBottom: '8px'
  }}>常用键</div>
                {selected.contains.map((item, i) => <div key={i} style={{
    display: 'flex',
    gap: '7px',
    fontSize: '15px',
    color: 'var(--ce-text-2)',
    lineHeight: 1.5,
    marginBottom: '5px'
  }}>
                    <span style={{
    fontSize: '7px',
    color: 'var(--ce-text-4)',
    marginTop: '6px'
  }}>●</span>
                    <span>{item}</span>
                  </div>)}
              </div>}

            {}
            {selected.tips && selected.tips.length > 0 && <div style={{
    padding: '12px 14px',
    borderRadius: '8px',
    background: 'var(--ce-surface)',
    border: '1px solid var(--ce-border-subtle)',
    marginBottom: '16px'
  }}>
                <div style={{
    fontSize: '11px',
    fontWeight: 700,
    color: 'var(--ce-accent)',
    textTransform: 'uppercase',
    letterSpacing: '0.4px',
    marginBottom: '6px'
  }}>提示</div>
                {selected.tips.map((tip, i) => <div key={i} style={{
    display: 'flex',
    gap: '7px',
    fontSize: '14.5px',
    color: 'var(--ce-text-2)',
    marginBottom: i < selected.tips.length - 1 ? '5px' : 0
  }}>
                    <span style={{
    fontSize: '7px',
    color: 'var(--ce-accent)',
    marginTop: '6px'
  }}>●</span>
                    <span>{tip}</span>
                  </div>)}
              </div>}

            {}
            {selected.example && <div style={{
    marginBottom: '16px'
  }}>
                {selected.exampleIntro && <div style={{
    fontSize: '15px',
    color: 'var(--ce-text-2)',
    lineHeight: 1.6,
    marginBottom: '10px'
  }}>
                    {selected.exampleIntro}
                  </div>}
                <div style={{
    display: 'flex',
    justifyContent: 'space-between',
    alignItems: 'center',
    padding: '6px 10px',
    background: 'var(--ce-code-header)',
    border: '1px solid var(--ce-border)',
    borderRadius: '8px 8px 0 0'
  }}>
                  <span style={{
    fontFamily: 'var(--ce-mono)',
    fontSize: '11px',
    fontWeight: 600,
    color: 'var(--ce-text-3)'
  }}>{selected.label}</span>
                  <button onClick={() => copyExample(selected.id, selected.example)} style={{
    padding: '3px 8px',
    borderRadius: '4px',
    fontSize: '11px',
    fontWeight: 600,
    cursor: 'pointer',
    transition: 'all 0.15s',
    background: isCopied ? 'rgba(85,138,66,0.08)' : 'var(--ce-code-header)',
    border: isCopied ? '0.5px solid rgba(85,138,66,0.2)' : '0.5px solid var(--ce-border)',
    color: isCopied ? '#558A42' : 'var(--ce-text-3)'
  }}>
                    {isCopied ? '✓ 已复制' : '复制'}
                  </button>
                </div>
                <pre style={{
    margin: 0,
    padding: '12px 14px',
    background: 'var(--ce-code-bg)',
    color: '#E8E6DC',
    fontFamily: 'var(--ce-mono)',
    fontSize: '13px',
    lineHeight: 1.65,
    borderRadius: '0 0 8px 8px',
    overflowX: 'auto',
    whiteSpace: 'pre'
  }}>{selected.example}</pre>
              </div>}

            {}
            {selected.docsLink && <a href={selected.docsLink} style={{
    display: 'inline-flex',
    padding: '5px 12px',
    borderRadius: '6px',
    background: 'var(--ce-accent-bg)',
    border: '1px solid var(--ce-accent-border)',
    color: 'var(--ce-accent)',
    fontSize: '12px',
    fontWeight: 600,
    textDecoration: 'none'
  }}>完整文档 →</a>}

            {}
            {selected.children && selected.children.length > 0 && <div style={{
    marginTop: '20px'
  }}>
                <div style={{
    fontSize: '11px',
    fontWeight: 700,
    color: 'var(--ce-text-4)',
    textTransform: 'uppercase',
    letterSpacing: '0.4px',
    marginBottom: '8px'
  }}>内容</div>
                <div style={{
    display: 'flex',
    flexDirection: 'column',
    gap: '4px'
  }}>
                  {selected.children.map(child => <button key={child.id} onClick={() => selectNode(child)} style={{
    display: 'flex',
    alignItems: 'center',
    gap: '8px',
    padding: '6px 8px',
    width: '100%',
    background: 'var(--ce-surface)',
    borderRadius: '6px',
    border: 'none',
    cursor: 'pointer',
    textAlign: 'left',
    transition: 'background 0.1s'
  }} onMouseEnter={e => e.currentTarget.style.background = 'var(--ce-surface-hover)'} onMouseLeave={e => e.currentTarget.style.background = 'var(--ce-surface)'}>
                      {renderIcon(child.icon, child.color, 13)}
                      <span style={{
    fontFamily: 'var(--ce-mono)',
    fontSize: '12px',
    color: 'var(--ce-text-2)'
  }}>{child.label}</span>
                      {child.oneLiner && <span style={{
    fontSize: '11px',
    color: 'var(--ce-text-4)',
    overflow: 'hidden',
    textOverflow: 'ellipsis',
    whiteSpace: 'nowrap'
  }}>{child.oneLiner}</span>}
                    </button>)}
                </div>
              </div>}
      </div>
    </div>
    </>;
};

Claude Code 从你的项目目录和主目录中的 `~/.claude` 读取指令、设置、技能、子智能体和记忆。将项目文件提交到 git 以与团队共享；`~/.claude` 中的文件是跨所有项目适用的个人配置。

在 Windows 上，`~/.claude` 解析为 `%USERPROFILE%\.claude`。如果你设置了 [`CLAUDE_CONFIG_DIR`](/en/env-vars)，此页面上的每个 `~/.claude` 路径都位于该目录下。

大多数用户只编辑 `CLAUDE.md` 和 `settings.json`。目录的其余部分是可选的：根据需要添加技能、规则或子智能体。

## 探索目录

点击树中的文件查看每个文件的功能、加载时机和示例。

<ClaudeExplorer />

## 未显示的内容

浏览器涵盖你编写和编辑的文件。一些相关文件位于其他位置：

| 文件 | 位置 | 用途 |
| --- | --- | --- |
| `managed-settings.json` | 系统级，因 OS 而异 | 你无法覆盖的企业强制设置。参见[服务器托管设置](/en/server-managed-settings)。 |
| `CLAUDE.local.md` | 项目根目录 | 你对此项目的私人偏好，与 CLAUDE.md 一起加载。手动创建并添加到 `.gitignore`。 |
| 已安装的插件 | `~/.claude/plugins` | 克隆的市场、已安装的插件版本和每个插件的数据，由 `claude plugin` 命令管理。孤立版本在插件更新或卸载后 7 天删除。参见[插件缓存](/en/plugins-reference#plugin-caching-and-file-resolution)。 |

`~/.claude` 还保存 Claude Code 在你工作时写入的数据：转录、提示历史、文件快照、缓存和日志。参见下方的[应用数据](#application-data)。

## 选择正确的文件

不同类型的自定义位于不同的文件中。使用此表查找更改应放在哪里。

| 你想要 | 编辑 | 范围 | 参考 |
| :--- | :--- | :--- | :--- |
| 给 Claude 项目上下文和约定 | `CLAUDE.md` | 项目或全局 | [记忆](/en/memory) |
| 允许或阻止特定工具调用 | `settings.json` `permissions` 或 `hooks` | 项目或全局 | [权限](/en/permissions)、[钩子](/en/hooks) |
| 在工具调用之前或之后运行脚本 | `settings.json` `hooks` | 项目或全局 | [钩子](/en/hooks) |
| 为会话设置环境变量 | `settings.json` `env` | 项目或全局 | [设置](/en/settings#available-settings) |
| 将个人覆盖排除在 git 之外 | `settings.local.json` | 仅项目 | [设置范围](/en/settings#settings-files) |
| 添加用 `/name` 调用的提示或功能 | `skills/<name>/SKILL.md` | 项目或全局 | [技能](/en/skills) |
| 定义拥有自己工具的专门子智能体 | `agents/*.md` | 项目或全局 | [子智能体](/en/sub-agents) |
| 通过 MCP 连接外部工具 | `.mcp.json` | 仅项目 | [MCP](/en/mcp) |
| 更改 Claude 格式化响应的方式 | `output-styles/*.md` | 项目或全局 | [输出样式](/en/output-styles) |

## 文件参考

此表列出了浏览器涵盖的每个文件。项目范围的文件位于仓库中的 `.claude/` 下（或对于 `CLAUDE.md`、`.mcp.json` 和 `.worktreeinclude` 位于根目录）。全局范围的文件位于 `~/.claude/` 中，适用于所有项目。

<Note>
  有几件事可以覆盖你在这些文件中放置的内容：

  * 你的组织部署的[托管设置](/en/server-managed-settings)优先于一切
  * CLI 标志如 `--permission-mode` 或 `--settings` 在该会话中覆盖 `settings.json`
  * 某些环境变量优先于其等效设置，但这因变量而异：查看[环境变量参考](/en/env-vars)了解每个变量

  参见[设置优先级](/en/settings#settings-precedence)了解完整顺序。
</Note>

点击文件名可在上方的浏览器中打开该节点。

| 文件 | 范围 | 提交 | 功能 | 参考 |
| --- | --- | --- | --- | --- |
| [`CLAUDE.md`](#ce-claude-md) | 项目和全局 | ✓ | 每次会话加载的指令 | [记忆](/en/memory) |
| [`rules/*.md`](#ce-rules) | 项目和全局 | ✓ | 主题限定的指令，可选择路径门控 | [规则](/en/memory#organize-rules-with-claude/rules/) |
| [`settings.json`](#ce-settings-json) | 项目和全局 | ✓ | 权限、钩子、环境变量、模型默认值 | [设置](/en/settings) |
| [`settings.local.json`](#ce-settings-local-json) | 仅项目 | | 你的个人覆盖，自动 gitignore | [设置范围](/en/settings#settings-files) |
| [`.mcp.json`](#ce-mcp-json) | 仅项目 | ✓ | 团队共享的 MCP 服务器 | [MCP 范围](/en/mcp#mcp-installation-scopes) |
| [`.worktreeinclude`](#ce-worktreeinclude) | 仅项目 | ✓ | 要复制到新工作树中的 gitignore 文件 | [工作树](/en/worktrees#copy-gitignored-files-into-worktrees) |
| [`skills/<name>/SKILL.md`](#ce-skills) | 项目和全局 | ✓ | 用 `/name` 调用或自动调用的可重用提示 | [技能](/en/skills) |
| [`commands/*.md`](#ce-commands) | 项目和全局 | ✓ | 单文件提示；与技能相同的机制 | [技能](/en/skills) |
| [`output-styles/*.md`](#ce-output-styles) | 项目和全局 | ✓ | 自定义系统提示部分 | [输出样式](/en/output-styles) |
| [`agents/*.md`](#ce-agents) | 项目和全局 | ✓ | 拥有自己提示和工具的子智能体定义 | [子智能体](/en/sub-agents) |
| [`agent-memory/<name>/`](#ce-agent-memory) | 项目和全局 | ✓ | 子智能体的持久记忆 | [持久记忆](/en/sub-agents#enable-persistent-memory) |
| [`~/.claude.json`](#ce-claude-json) | 仅全局 | | 应用状态、OAuth、UI 开关、个人 MCP 服务器 | [全局配置](/en/settings#global-config-settings) |
| [`projects/<project>/memory/`](#ce-global-projects) | 仅全局 | | 自动记忆：Claude 跨会话给自己的笔记 | [自动记忆](/en/memory#auto-memory) |
| [`keybindings.json`](#ce-keybindings) | 仅全局 | | 自定义键盘快捷键 | [键绑定](/en/keybindings) |
| [`themes/*.json`](#ce-themes) | 仅全局 | | 自定义颜色主题 | [自定义主题](/en/terminal-config#create-a-custom-theme) |

## 故障排除配置

如果设置、钩子或文件未生效，请参见[调试你的配置](/en/debug-your-config)了解检查命令和症状优先的查找表。

## 应用数据

除了你编写的配置外，`~/.claude` 还保存 Claude Code 在会话期间写入的数据。这些文件是纯文本。通过工具的任何内容都会落入磁盘上的转录中：文件内容、命令输出、粘贴的文本。

### 自动清理

以下路径中的文件在超过 [`cleanupPeriodDays`](/en/settings#available-settings) 后会在启动时删除。默认为 30 天。

| `~/.claude/` 下的路径 | 内容 |
| --- | --- |
| `projects/<project>/<session>.jsonl` | 完整对话转录：每条消息、工具调用和工具结果 |
| `projects/<project>/<session>/subagents/` | [子智能体](/en/sub-agents)对话转录，随父会话转录过期时一起移除 |
| `projects/<project>/<session>/tool-results/` | 溢出到单独文件的大型工具输出 |
| `file-history/<session>/` | Claude 更改的文件的编辑前快照，用于[检查点恢复](/en/checkpointing) |
| `plans/` | [计划模式](/en/permission-modes#analyze-before-you-edit-with-plan-mode)期间写入的计划文件 |
| `debug/` | 每个会话的调试日志，仅在你使用 `--debug` 启动或运行 `/debug` 时写入 |
| `paste-cache/`、`image-cache/` | 大型粘贴和附加图片的内容 |
| `session-env/` | 每个会话的环境元数据 |
| `tasks/` | 任务工具写入的每个会话任务列表 |
| `shell-snapshots/` | Bash 工具使用的捕获 shell 环境。正常退出时移除。清理会清除崩溃后遗留的内容。 |
| `backups/` | 配置迁移前拍摄的 `~/.claude.json` 带时间戳副本 |
| `feedback-bundles/` | `/feedback` 在第三方提供商上写入的编辑转录存档，用于发送给你的 Anthropic 客户团队 |
| `todos/`、`statsig/`、`logs/` | 旧版本的遗留目录。不再写入。清理会移除其内容然后删除空目录。 |

### 保留直到你删除

以下路径不被自动清理覆盖，会无限期保留。

| `~/.claude/` 下的路径 | 内容 |
| --- | --- |
| `history.jsonl` | 你输入的每个提示，带时间戳和项目路径。用于上箭头召回。 |
| `stats-cache.json` | `/usage` 显示的聚合 token 和成本计数 |
| `remote-settings.json` | 你的组织的[服务器托管设置](/en/server-managed-settings)的缓存副本。仅在你的组织配置了它们时存在。每次启动时刷新。 |

其他小型缓存和锁文件取决于你使用的功能，可以安全删除。

### 明文存储

转录和历史在静态时未加密。操作系统文件权限是唯一的保护。如果工具读取 `.env` 文件或命令打印凭据，该值会被写入 `projects/<project>/<session>.jsonl`。要减少暴露：

* 降低 `cleanupPeriodDays` 以缩短转录保留时间
* 设置 [`CLAUDE_CODE_SKIP_PROMPT_HISTORY`](/en/env-vars) 环境变量以跳过在任何模式下写入转录和提示历史。在非交互模式中，你可以在 `-p` 旁边传递 `--no-session-persistence`，或在 Agent SDK 中设置 `persistSession: false`。
* 使用[权限规则](/en/permissions)拒绝读取凭据文件

### 清除本地数据

运行 `claude project purge` 删除 Claude Code 为一个项目保存的状态：

* `projects/` 下的转录和自动记忆
* 每个会话的 `tasks/`、`debug/` 和 `file-history/` 条目
* `history.jsonl` 中匹配的提示行
* `~/.claude.json` 中的项目条目

该命令打印完整的删除计划，并在删除任何内容前要求确认。

预览计划而不删除任何内容：

```bash theme={null}
claude project purge ~/work/my-repo --dry-run
```

使用单个确认提示删除：

```bash theme={null}
claude project purge ~/work/my-repo
```

省略路径以从交互列表中选择项目。

跳过确认提示以在脚本中使用：

```bash theme={null}
claude project purge ~/work/my-repo --yes
```

传递 `--all` 而不是路径以一次清除每个项目的状态，这会直接删除 `history.jsonl` 而不是过滤它。传递 `-i` 以逐项查看删除计划。

该命令保留 `shell-snapshots/` 和 `backups/` 不动，因为它们不是项目范围的，并在计划输出中警告它们。如果没有状态匹配给定路径，它以状态 1 退出。

你也可以手动删除上述任何应用数据路径。新会话不受影响。下表显示了过去会话丢失的内容。

| 删除 | 你丢失 |
| --- | --- |
| `~/.claude/projects/` | 过去会话的恢复、继续和回退 |
| `~/.claude/history.jsonl` | 上箭头提示召回 |
| `~/.claude/file-history/` | 过去会话的检查点恢复 |
| `~/.claude/stats-cache.json` | `/usage` 显示的历史总计 |
| `~/.claude/remote-settings.json` | 无。下次启动时重新获取。 |
| `~/.claude/debug/`、`~/.claude/plans/`、`~/.claude/paste-cache/`、`~/.claude/image-cache/`、`~/.claude/session-env/`、`~/.claude/tasks/`、`~/.claude/shell-snapshots/`、`~/.claude/backups/` | 无用户可见内容 |
| `~/.claude/todos/`、`~/.claude/statsig/`、`~/.claude/logs/` | 无。当前版本不写入的遗留目录。 |

不要删除 `~/.claude.json`、`~/.claude/settings.json` 或 `~/.claude/plugins/`：它们保存你的认证、偏好和已安装的插件。

## 相关资源

* [管理 Claude 的记忆](/en/memory)：编写和组织 CLAUDE.md、规则和自动记忆
* [配置设置](/en/settings)：设置权限、钩子、环境变量和模型默认值
* [创建技能](/en/skills)：构建可重用的提示和工作流
* [配置子智能体](/en/sub-agents)：定义拥有自己上下文的专门智能体
