SpyBara
Go Premium

Documentation 2026-07-27 21:02 UTC to 2026-07-28 23:57 UTC

4 files changed +60 −60. View all changes and history on the product overview
2026
Wed 29 07:01 Tue 28 23:57 Mon 27 21:02 Sun 26 19:02 Sat 25 21:59 Fri 24 23:01 Thu 23 23:57 Wed 22 23:59 Tue 21 23:00 Mon 20 23:01 Sat 18 16:02 Fri 17 22:57 Thu 16 22:59 Wed 15 22:00 Tue 14 23:01 Mon 13 23:57 Sat 11 19:03 Fri 10 17:00 Thu 9 23:58 Wed 8 16:02 Tue 7 16:02 Mon 6 23:57 Sat 4 03:01 Fri 3 23:00 Thu 2 23:59 Wed 1 21:01
Details

20 background: 'var(--ce-surface)',20 background: 'var(--ce-surface)',

21 border: '0.5px solid var(--ce-border-subtle)'21 border: '0.5px solid var(--ce-border-subtle)'

22 }}>{children}</code>, []);22 }}>{children}</code>, []);

23 const commandsNote = useMemo(() => <>Commands and skills are now the same mechanism. For new workflows, use <A href="/en/skills">skills/</A> instead: same <C>/name</C> invocation, plus you can bundle supporting files.</>, []);23 const commandsNote = useMemo(() => <>Commands and skills are now the same mechanism. For new workflows, use <A href="/docs/en/skills">skills/</A> instead: same <C>/name</C> invocation, plus you can bundle supporting files.</>, []);

24 const FILE_TREE = useMemo(() => ({24 const FILE_TREE = useMemo(() => ({

25 project: {25 project: {

26 label: 'your-project/',26 label: 'your-project/',


34 oneLiner: 'Project instructions Claude reads every session',34 oneLiner: 'Project instructions Claude reads every session',

35 when: 'Loaded into context at the start of every session',35 when: 'Loaded into context at the start of every session',

36 description: 'Project-specific instructions that shape how Claude works in this repository. Put your conventions, common commands, and architectural context here so Claude operates with the same assumptions your team does.',36 description: 'Project-specific instructions that shape how Claude works in this repository. Put your conventions, common commands, and architectural context here so Claude operates with the same assumptions your team does.',

37 tips: ['Target under 200 lines. Longer files still load in full but may reduce adherence', <>CLAUDE.md loads into every session. If something only matters for specific tasks, move it to a <A href="/en/skills">skill</A> or a path-scoped <A href="/en/memory#organize-rules-with-claude/rules/">rule</A> so it loads only when needed</>, 'List the commands you run most, like build, test, and format, so Claude knows them without you spelling them out each time', <>Run <C>/memory</C> to open and edit CLAUDE.md from within a session</>, <>Also works at <C>.claude/CLAUDE.md</C> if you prefer to keep the project root clean</>],37 tips: ['Target under 200 lines. Longer files still load in full but may reduce adherence', <>CLAUDE.md loads into every session. If something only matters for specific tasks, move it to a <A href="/docs/en/skills">skill</A> or a path-scoped <A href="/docs/en/memory#organize-rules-with-claude/rules/">rule</A> so it loads only when needed</>, 'List the commands you run most, like build, test, and format, so Claude knows them without you spelling them out each time', <>Run <C>/memory</C> to open and edit CLAUDE.md from within a session</>, <>Also works at <C>.claude/CLAUDE.md</C> if you prefer to keep the project root clean</>],

38 exampleIntro: 'This example is for a TypeScript and React project. It lists the build and test commands, the framework conventions Claude should follow, and project-specific rules like export style and file layout.',38 exampleIntro: 'This example is for a TypeScript and React project. It lists the build and test commands, the framework conventions Claude should follow, and project-specific rules like export style and file layout.',

39 example: `# Project conventions39 example: `# Project conventions

40 40 


60 color: '#9B7BC4',60 color: '#9B7BC4',

61 badge: 'committed',61 badge: 'committed',

62 oneLiner: 'Project-scoped MCP servers, shared with your team',62 oneLiner: 'Project-scoped MCP servers, shared with your team',

63 when: <>Servers connect when the session begins. Tool schemas are deferred by default and load on demand via <A href="/en/mcp#scale-with-mcp-tool-search">tool search</A></>,63 when: <>Servers connect when the session begins. Tool schemas are deferred by default and load on demand via <A href="/docs/en/mcp#scale-with-mcp-tool-search">tool search</A></>,

64 description: <>Configures Model Context Protocol (MCP) servers that give Claude access to external tools: databases, APIs, browsers, and more. This file holds the project-scoped servers your whole team uses. Personal servers you want to keep to yourself go in <C>~/.claude.json</C> instead.</>,64 description: <>Configures Model Context Protocol (MCP) servers that give Claude access to external tools: databases, APIs, browsers, and more. This file holds the project-scoped servers your whole team uses. Personal servers you want to keep to yourself go in <C>~/.claude.json</C> instead.</>,

65 tips: [<>Use environment variable references for secrets: <C>{'${NOTION_TOKEN}'}</C></>, <>Lives at the project root, not inside <C>.claude/</C></>, <>For servers only you need, run <C>claude mcp add --scope user</C>. This writes to <C>~/.claude.json</C> instead of <C>.mcp.json</C></>],65 tips: [<>Use environment variable references for secrets: <C>{'${NOTION_TOKEN}'}</C></>, <>Lives at the project root, not inside <C>.claude/</C></>, <>For servers only you need, run <C>claude mcp add --scope user</C>. This writes to <C>~/.claude.json</C> instead of <C>.mcp.json</C></>],

66 exampleIntro: <>This example configures the Notion MCP server so Claude can read and update pages in your workspace. The <C>{'${NOTION_TOKEN}'}</C> reference is read from your shell environment when Claude Code starts the server, so the token never lands in the file.</>,66 exampleIntro: <>This example configures the Notion MCP server so Claude can read and update pages in your workspace. The <C>{'${NOTION_TOKEN}'}</C> reference is read from your shell environment when Claude Code starts the server, so the token never lands in the file.</>,


86 oneLiner: 'Gitignored files to copy into new worktrees',86 oneLiner: 'Gitignored files to copy into new worktrees',

87 when: <>Read when Claude creates a git worktree via <C>--worktree</C>, the <C>EnterWorktree</C> tool, or subagent <C>isolation: worktree</C></>,87 when: <>Read when Claude creates a git worktree via <C>--worktree</C>, the <C>EnterWorktree</C> tool, or subagent <C>isolation: worktree</C></>,

88 description: <>Lists gitignored files to copy from your main repository into each new worktree. Worktrees are fresh checkouts, so untracked files like <C>.env</C> are missing by default. Patterns here use <C>.gitignore</C> syntax. Only files that match a pattern and are also gitignored get copied, so tracked files are never duplicated.</>,88 description: <>Lists gitignored files to copy from your main repository into each new worktree. Worktrees are fresh checkouts, so untracked files like <C>.env</C> are missing by default. Patterns here use <C>.gitignore</C> syntax. Only files that match a pattern and are also gitignored get copied, so tracked files are never duplicated.</>,

89 tips: [<>Lives at the project root, not inside <C>.claude/</C></>, <>Git-only: if you configure a <A href="/en/hooks#worktreecreate">WorktreeCreate hook</A> for a different VCS, this file is not read. Copy files inside your hook script instead</>, <>Also applies to parallel sessions in the <A href="/en/desktop#work-in-parallel-with-sessions">desktop app</A></>],89 tips: [<>Lives at the project root, not inside <C>.claude/</C></>, <>Git-only: if you configure a <A href="/docs/en/hooks#worktreecreate">WorktreeCreate hook</A> for a different VCS, this file is not read. Copy files inside your hook script instead</>, <>Also applies to parallel sessions in the <A href="/docs/en/desktop#work-in-parallel-with-sessions">desktop app</A></>],

90 exampleIntro: 'This example copies your local environment files and a secrets config into every worktree Claude creates. Comments start with # and blank lines are ignored, same as .gitignore.',90 exampleIntro: 'This example copies your local environment files and a secrets config into every worktree Claude creates. Comments start with # and blank lines are ignored, same as .gitignore.',

91 example: `# Local environment91 example: `# Local environment

92.env92.env


102 icon: 'folder',102 icon: 'folder',

103 color: 'var(--ce-accent)',103 color: 'var(--ce-accent)',

104 oneLiner: 'Project-level configuration, rules, and extensions',104 oneLiner: 'Project-level configuration, rules, and extensions',

105 description: 'Everything Claude Code reads that is specific to this project. If you use git, commit most files here so your team shares them; a few, like settings.local.json, are automatically gitignored. Each file badge shows which.',105 description: 'Everything Claude Code reads that is specific to this project. If you use git, commit most files here so your team shares them; a few, like settings.local.json, are gitignored when Claude Code saves settings to them. Each file badge shows which.',

106 children: [{106 children: [{

107 id: 'settings-json',107 id: 'settings-json',

108 label: 'settings.json',108 label: 'settings.json',


113 oneLiner: 'Permissions, hooks, and configuration',113 oneLiner: 'Permissions, hooks, and configuration',

114 when: <>Overrides global <C>~/.claude/settings.json</C>. Local settings, CLI flags, and managed settings override this</>,114 when: <>Overrides global <C>~/.claude/settings.json</C>. Local settings, CLI flags, and managed settings override this</>,

115 description: 'Settings that Claude Code applies directly. Permissions control which commands and tools Claude can use; hooks run your scripts at specific points in a session. Unlike CLAUDE.md, which Claude reads as guidance, these are enforced whether Claude follows them or not.',115 description: 'Settings that Claude Code applies directly. Permissions control which commands and tools Claude can use; hooks run your scripts at specific points in a session. Unlike CLAUDE.md, which Claude reads as guidance, these are enforced whether Claude follows them or not.',

116 contains: [<><A href="/en/permissions">permissions</A>: allow, deny, or prompt before Claude uses specific tools or commands</>, <><A href="/en/hooks">hooks</A>: run your own scripts on events like before a tool call or after a file edit</>, <><A href="/en/statusline">statusLine</A>: customize the line shown at the bottom while Claude works</>, <><A href="/en/settings#available-settings">model</A>: pick a default model for this project</>, <><A href="/en/settings#environment-variables">env</A>: environment variables set in every session</>, <><A href="/en/output-styles">outputStyle</A>: select a custom system-prompt style from output-styles/</>],116 contains: [<><A href="/docs/en/permissions">permissions</A>: allow, deny, or prompt before Claude uses specific tools or commands</>, <><A href="/docs/en/hooks">hooks</A>: run your own scripts on events like before a tool call or after a file edit</>, <><A href="/docs/en/statusline">statusLine</A>: customize the line shown at the bottom while Claude works</>, <><A href="/docs/en/settings#available-settings">model</A>: pick a default model for this project</>, <><A href="/docs/en/settings#environment-variables">env</A>: environment variables set in every session</>, <><A href="/docs/en/output-styles">outputStyle</A>: select a custom system-prompt style from output-styles/</>],

117 tips: [<>Bash permission patterns support wildcards: <C>Bash(npm test *)</C> matches any command starting with <C>npm test</C></>, <>Array settings like <C>permissions.allow</C> combine across all scopes; scalar settings like <C>model</C> use the most specific value</>],117 tips: [<>Bash permission patterns support wildcards: <C>Bash(npm test *)</C> matches any command starting with <C>npm test</C></>, <>Array settings like <C>permissions.allow</C> combine across all scopes; scalar settings like <C>model</C> use the most specific value</>],

118 exampleIntro: <>This example allows <C>npm test</C> and <C>npm run</C> commands without prompting, blocks <C>rm -rf</C>, and runs Prettier on files after Claude edits or writes them.</>,118 exampleIntro: <>This example allows <C>npm test</C> and <C>npm run</C> commands without prompting, blocks <C>rm -rf</C>, and runs Prettier on files after Claude edits or writes them.</>,

119 example: `{119 example: `{


146 badge: 'gitignored',146 badge: 'gitignored',

147 oneLiner: 'Your personal settings overrides for this project',147 oneLiner: 'Your personal settings overrides for this project',

148 when: 'Highest of the user-editable settings files; CLI flags and managed settings still take precedence',148 when: 'Highest of the user-editable settings files; CLI flags and managed settings still take precedence',

149 description: 'Personal settings that take precedence over the project defaults. Same JSON format as settings.json, but not committed. Use this when you need different permissions or defaults than the team config.',149 description: 'Personal settings that take precedence over the project defaults. Same JSON format as settings.json, gitignored when Claude Code saves a setting to it. Use this when you need different permissions or defaults than the team config.',

150 tips: [<>Same schema as settings.json. Array settings like <C>permissions.allow</C> combine across scopes; scalar settings like <C>model</C> use the local value</>, <>Claude Code adds this file to <C>~/.config/git/ignore</C> the first time it writes one. If you use a custom <C>core.excludesFile</C>, add the pattern there too. To share the ignore rule with your team, also add it to the project <C>.gitignore</C></>],150 tips: [<>Same schema as settings.json. Array settings like <C>permissions.allow</C> combine across scopes; scalar settings like <C>model</C> use the local value</>, <>When Claude Code saves a setting to this file in a repository that doesn't already ignore it, it adds <C>**/.claude/settings.local.json</C> to your global git excludes file: <C>core.excludesFile</C> from your global git config when it's set to an absolute or <C>~</C>-prefixed path, otherwise <C>$XDG_CONFIG_HOME/git/ignore</C>, or <C>~/.config/git/ignore</C>. To share the ignore rule with your team, also add it to the project <C>.gitignore</C></>],

151 exampleIntro: 'This example adds Docker permissions on top of whatever the team settings.json allows.',151 exampleIntro: 'This example adds Docker permissions on top of whatever the team settings.json allows.',

152 example: `{152 example: `{

153 "permissions": {153 "permissions": {


165 color: '#9B7BC4',165 color: '#9B7BC4',

166 oneLiner: 'Topic-scoped instructions, optionally gated by file paths',166 oneLiner: 'Topic-scoped instructions, optionally gated by file paths',

167 when: <>Rules without <C>paths:</C> load at session start. Rules with <C>paths:</C> load when a matching file enters context</>,167 when: <>Rules without <C>paths:</C> load at session start. Rules with <C>paths:</C> load when a matching file enters context</>,

168 description: [<>Project instructions split into topic files that can load conditionally based on file paths. A rule without <C>paths:</C> frontmatter loads at session start like CLAUDE.md; a rule with <C>paths:</C> loads only when Claude reads a matching file.</>, <>Like CLAUDE.md, rules are guidance Claude reads, not configuration Claude Code enforces. For guaranteed behavior use <A href="/en/hooks">hooks</A> or <A href="/en/permissions">permissions</A>.</>],168 description: [<>Project instructions split into topic files that can load conditionally based on file paths. A rule without <C>paths:</C> frontmatter loads at session start like CLAUDE.md; a rule with <C>paths:</C> loads only when Claude reads a matching file.</>, <>Like CLAUDE.md, rules are guidance Claude reads, not configuration Claude Code enforces. For guaranteed behavior use <A href="/docs/en/hooks">hooks</A> or <A href="/docs/en/permissions">permissions</A>.</>],

169 tips: [<>Use <C>paths:</C> frontmatter with globs to scope rules to directories or file types</>, <>Subdirectories work: <C>.claude/rules/frontend/react.md</C> is discovered automatically</>, 'When CLAUDE.md approaches 200 lines, start splitting into rules'],169 tips: [<>Use <C>paths:</C> frontmatter with globs to scope rules to directories or file types</>, <>Subdirectories work: <C>.claude/rules/frontend/react.md</C> is discovered automatically</>, 'When CLAUDE.md approaches 200 lines, start splitting into rules'],

170 docsLink: '/en/memory#organize-rules-with-claude/rules/',170 docsLink: '/en/memory#organize-rules-with-claude/rules/',

171 children: [{171 children: [{


369 color: '#C46686',369 color: '#C46686',

370 oneLiner: 'Dynamic workflow scripts that orchestrate many subagents',370 oneLiner: 'Dynamic workflow scripts that orchestrate many subagents',

371 when: 'Loaded at startup; each file becomes a /<name> command',371 when: 'Loaded at startup; each file becomes a /<name> command',

372 description: <>Each <C>.js</C> file is a <A href="/en/workflows">dynamic workflow</A>: a script the runtime executes to spawn and coordinate many subagents. Workflows are written by Claude and saved here from <C>/workflows</C> rather than authored from scratch.</>,372 description: <>Each <C>.js</C> file is a <A href="/docs/en/workflows">dynamic workflow</A>: a script the runtime executes to spawn and coordinate many subagents. Workflows are written by Claude and saved here from <C>/workflows</C> rather than authored from scratch.</>,

373 tips: [<>Save a run from <C>/workflows</C> with <C>s</C> to create one of these</>, <>A project workflow takes precedence over a personal one in <C>~/.claude/workflows/</C> with the same name</>],373 tips: [<>Save a run from <C>/workflows</C> with <C>s</C> to create one of these</>, <>A project workflow takes precedence over a personal one in <C>~/.claude/workflows/</C> with the same name</>],

374 docsLink: '/en/workflows'374 docsLink: '/en/workflows'

375 }, {375 }, {


382 autogen: true,382 autogen: true,

383 oneLiner: 'Subagent persistent memory, separate from your main session auto memory',383 oneLiner: 'Subagent persistent memory, separate from your main session auto memory',

384 when: 'First 200 lines (capped at 25KB) of MEMORY.md loaded into the subagent system prompt when it runs',384 when: 'First 200 lines (capped at 25KB) of MEMORY.md loaded into the subagent system prompt when it runs',

385 description: <>Subagents with <C>memory: project</C> in their frontmatter get a dedicated memory directory here. This is distinct from your <A href="/en/memory#auto-memory">main session auto memory</A> at <C>~/.claude/projects/</C>: each subagent reads and writes its own MEMORY.md, not yours.</>,385 description: <>Subagents with <C>memory: project</C> in their frontmatter get a dedicated memory directory here. This is distinct from your <A href="/docs/en/memory#auto-memory">main session auto memory</A> at <C>~/.claude/projects/</C>: each subagent reads and writes its own MEMORY.md, not yours.</>,

386 tips: [<>Only created for subagents that set the <C>memory:</C> frontmatter field</>, <>This directory holds project-scoped subagent memory, meant to be shared with your team. To keep memory out of version control use <C>memory: local</C>, which writes to <C>.claude/agent-memory-local/</C> instead. For cross-project memory use <C>memory: user</C>, which writes to <C>~/.claude/agent-memory/</C></>, <>The main session auto memory is a different feature; see <C>~/.claude/projects/</C> in the Global tab</>],386 tips: [<>Only created for subagents that set the <C>memory:</C> frontmatter field</>, <>This directory holds project-scoped subagent memory, meant to be shared with your team. To keep memory out of version control use <C>memory: local</C>, which writes to <C>.claude/agent-memory-local/</C> instead. For cross-project memory use <C>memory: user</C>, which writes to <C>~/.claude/agent-memory/</C></>, <>The main session auto memory is a different feature; see <C>~/.claude/projects/</C> in the Global tab</>],

387 docsLink: '/en/sub-agents#enable-persistent-memory',387 docsLink: '/en/sub-agents#enable-persistent-memory',

388 children: [{388 children: [{


402 autogen: true,402 autogen: true,

403 oneLiner: 'The subagent writes and maintains this file automatically',403 oneLiner: 'The subagent writes and maintains this file automatically',

404 when: 'Loaded into the subagent system prompt when the subagent starts',404 when: 'Loaded into the subagent system prompt when the subagent starts',

405 description: <>Works the same as your <A href="/en/memory#auto-memory">main auto memory</A>: the subagent creates and updates this file itself. You do not write it. The subagent reads it at the start of each task and writes back what it learns.</>,405 description: <>Works the same as your <A href="/docs/en/memory#auto-memory">main auto memory</A>: the subagent creates and updates this file itself. You do not write it. The subagent reads it at the start of each task and writes back what it learns.</>,

406 example: `# code-reviewer memory406 example: `# code-reviewer memory

407 407 

408## Patterns seen408## Patterns seen


1432 1432 

1433Claude Code 從您的專案目錄和主目錄中的 `~/.claude` 讀取指令、設定、skills、subagents 和記憶。將專案檔案提交到 git 以與您的團隊共享;`~/.claude` 中的檔案是個人設定,適用於您的所有專案。1433Claude Code 從您的專案目錄和主目錄中的 `~/.claude` 讀取指令、設定、skills、subagents 和記憶。將專案檔案提交到 git 以與您的團隊共享;`~/.claude` 中的檔案是個人設定,適用於您的所有專案。

1434 1434 

1435在 Windows 上,`~/.claude` 解析為 `%USERPROFILE%\.claude`。如果您設定了 [`CLAUDE_CONFIG_DIR`](/zh-TW/env-vars),此頁面上的每個 `~/.claude` 路徑都會改為位於該目錄下。1435在 Windows 上,`~/.claude` 解析為 `%USERPROFILE%\.claude`。如果您設定了 [`CLAUDE_CONFIG_DIR`](/docs/zh-TW/env-vars),此頁面上的每個 `~/.claude` 路徑都會改為位於該目錄下。

1436 1436 

1437大多數使用者只編輯 `CLAUDE.md` 和 `settings.json`。目錄的其餘部分是可選的:根據需要新增 skills、rules 或 subagents。1437大多數使用者只編輯 `CLAUDE.md` 和 `settings.json`。目錄的其餘部分是可選的:根據需要新增 skills、rules 或 subagents。

1438 1438 


1452 1452 

1453| 檔案 | 位置 | 用途 |1453| 檔案 | 位置 | 用途 |

1454| ----------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |1454| ----------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

1455| `managed-settings.json` | 系統級別,因作業系統而異 | 企業強制執行的設定,您無法覆蓋。請參閱[伺服器管理的設定](/zh-TW/server-managed-settings)。 |1455| `managed-settings.json` | 系統級別,因作業系統而異 | 企業強制執行的設定,您無法覆蓋。請參閱[伺服器管理的設定](/docs/zh-TW/server-managed-settings)。 |

1456| `CLAUDE.local.md` | 專案根目錄 | 您對此專案的私人偏好設定,與 CLAUDE.md 一起載入。手動建立並將其新增到 `.gitignore`。 |1456| `CLAUDE.local.md` | 專案根目錄 | 您對此專案的私人偏好設定,與 CLAUDE.md 一起載入。手動建立並將其新增到 `.gitignore`。 |

1457| 已安裝的 plugins | `~/.claude/plugins` | 複製的市場、已安裝的 plugin 版本和每個 plugin 的資料,由 `claude plugin` 命令管理。孤立版本在 plugin 更新或解除安裝後 7 天內被刪除。請參閱 [plugin 快取](/zh-TW/plugins-reference#plugin-caching-and-file-resolution)。 |1457| 已安裝的 plugins | `~/.claude/plugins` | 複製的市場、已安裝的 plugin 版本和每個 plugin 的資料,由 `claude plugin` 命令管理。孤立版本在 plugin 更新或解除安裝後 7 天內被刪除。請參閱 [plugin 快取](/docs/zh-TW/plugins-reference#plugin-caching-and-file-resolution)。 |

1458 1458 

1459`~/.claude` 還保存 Claude Code 在您工作時寫入的資料:文字記錄、提示歷史記錄、檔案快照、快取和日誌。請參閱下方的[應用程式資料](#application-data)。1459`~/.claude` 還保存 Claude Code 在您工作時寫入的資料:文字記錄、提示歷史記錄、檔案快照、快取和日誌。請參閱下方的[應用程式資料](#application-data)。

1460 1460 


1466 1466 

1467| 您想要 | 編輯 | 範圍 | 參考 |1467| 您想要 | 編輯 | 範圍 | 參考 |

1468| :--------------------- | :-------------------------------------- | :---- | :------------------------------------------------------ |1468| :--------------------- | :-------------------------------------- | :---- | :------------------------------------------------------ |

1469| 為 Claude 提供專案上下文和慣例 | `CLAUDE.md` | 專案或全域 | [Memory](/zh-TW/memory) |1469| 為 Claude 提供專案上下文和慣例 | `CLAUDE.md` | 專案或全域 | [Memory](/docs/zh-TW/memory) |

1470| 允許或阻止特定工具呼叫 | `settings.json` `permissions` 或 `hooks` | 專案或全域 | [Permissions](/zh-TW/permissions)、[Hooks](/zh-TW/hooks) |1470| 允許或阻止特定工具呼叫 | `settings.json` `permissions` 或 `hooks` | 專案或全域 | [Permissions](/docs/zh-TW/permissions)、[Hooks](/docs/zh-TW/hooks) |

1471| 在工具呼叫之前或之後執行指令碼 | `settings.json` `hooks` | 專案或全域 | [Hooks](/zh-TW/hooks) |1471| 在工具呼叫之前或之後執行指令碼 | `settings.json` `hooks` | 專案或全域 | [Hooks](/docs/zh-TW/hooks) |

1472| 為工作階段設定環境變數 | `settings.json` `env` | 專案或全域 | [Settings](/zh-TW/settings#available-settings) |1472| 為工作階段設定環境變數 | `settings.json` `env` | 專案或全域 | [Settings](/docs/zh-TW/settings#available-settings) |

1473| 將個人覆蓋保留在 git 之外 | `settings.local.json` | 僅專案 | [Settings scopes](/zh-TW/settings#settings-files) |1473| 將個人覆蓋保留在 git 之外 | `settings.local.json` | 僅專案 | [Settings scopes](/docs/zh-TW/settings#settings-files) |

1474| 新增您使用 `/name` 叫用的提示或功能 | `skills/<name>/SKILL.md` | 專案或全域 | [Skills](/zh-TW/skills) |1474| 新增您使用 `/name` 叫用的提示或功能 | `skills/<name>/SKILL.md` | 專案或全域 | [Skills](/docs/zh-TW/skills) |

1475| 定義具有自己工具的專門 subagent | `agents/*.md` | 專案或全域 | [Subagents](/zh-TW/sub-agents) |1475| 定義具有自己工具的專門 subagent | `agents/*.md` | 專案或全域 | [Subagents](/docs/zh-TW/sub-agents) |

1476| 透過指令碼協調許多 subagent | `workflows/*.js` | 專案或全域 | [Dynamic workflows](/zh-TW/workflows) |1476| 透過指令碼協調許多 subagent | `workflows/*.js` | 專案或全域 | [Dynamic workflows](/docs/zh-TW/workflows) |

1477| 透過 MCP 連接外部工具 | `.mcp.json` | 僅專案 | [MCP](/zh-TW/mcp) |1477| 透過 MCP 連接外部工具 | `.mcp.json` | 僅專案 | [MCP](/docs/zh-TW/mcp) |

1478| 變更 Claude 格式化回應的方式 | `output-styles/*.md` | 專案或全域 | [Output styles](/zh-TW/output-styles) |1478| 變更 Claude 格式化回應的方式 | `output-styles/*.md` | 專案或全域 | [Output styles](/docs/zh-TW/output-styles) |

1479 1479 

1480<h2 id="file-reference">1480<h2 id="file-reference">

1481 檔案參考1481 檔案參考


1486<Note>1486<Note>

1487 有幾件事可以覆蓋您在這些檔案中放入的內容:1487 有幾件事可以覆蓋您在這些檔案中放入的內容:

1488 1488 

1489 * 您的組織部署的[受管設定](/zh-TW/server-managed-settings)優先於所有內容1489 * 您的組織部署的[受管設定](/docs/zh-TW/server-managed-settings)優先於所有內容

1490 * CLI 旗標(如 `--permission-mode` 或 `--settings`)會覆蓋該工作階段的 `settings.json`1490 * CLI 旗標(如 `--permission-mode` 或 `--settings`)會覆蓋該工作階段的 `settings.json`

1491 * 某些環境變數優先於其等效設定,但這會有所不同:檢查[環境變數參考](/zh-TW/env-vars)以了解每個變數1491 * 某些環境變數優先於其等效設定,但這會有所不同:檢查[環境變數參考](/docs/zh-TW/env-vars)以了解每個變數

1492 1492 

1493 請參閱[設定優先順序](/zh-TW/settings#settings-precedence)以了解完整順序。1493 請參閱[設定優先順序](/docs/zh-TW/settings#settings-precedence)以了解完整順序。

1494</Note>1494</Note>

1495 1495 

1496點擊檔案名稱以在上方的探索器中開啟該節點。1496點擊檔案名稱以在上方的探索器中開啟該節點。

1497 1497 

1498| 檔案 | 範圍 | 提交 | 功能 | 參考 |1498| 檔案 | 範圍 | 提交 | 功能 | 參考 |

1499| --------------------------------------------------- | ----- | -- | ----------------------------------------------------------- | ------------------------------------------------------------------ |1499| --------------------------------------------------- | ----- | -- | ----------------------------------------------------------- | ------------------------------------------------------------------ |

1500| [`CLAUDE.md`](#ce-claude-md) | 專案和全域 | ✓ | 每個工作階段載入的指令 | [Memory](/zh-TW/memory) |1500| [`CLAUDE.md`](#ce-claude-md) | 專案和全域 | ✓ | 每個工作階段載入的指令 | [Memory](/docs/zh-TW/memory) |

1501| [`rules/*.md`](#ce-rules) | 專案和全域 | ✓ | 主題範圍的指令,可選擇路徑限制 | [Rules](/zh-TW/memory#organize-rules-with-claude/rules/) |1501| [`rules/*.md`](#ce-rules) | 專案和全域 | ✓ | 主題範圍的指令,可選擇路徑限制 | [Rules](/docs/zh-TW/memory#organize-rules-with-claude/rules/) |

1502| [`settings.json`](#ce-settings-json) | 專案和全域 | ✓ | 權限、hooks、環境變數、模型預設值 | [Settings](/zh-TW/settings) |1502| [`settings.json`](#ce-settings-json) | 專案和全域 | ✓ | 權限、hooks、環境變數、模型預設值 | [Settings](/docs/zh-TW/settings) |

1503| [`settings.local.json`](#ce-settings-local-json) | 僅專案 | | 您的個人覆蓋,自動 gitignored | [Settings scopes](/zh-TW/settings#settings-files) |1503| [`settings.local.json`](#ce-settings-local-json) | 僅專案 | | 您的個人覆蓋,自動 gitignored | [Settings scopes](/docs/zh-TW/settings#settings-files) |

1504| [`.mcp.json`](#ce-mcp-json) | 僅專案 | ✓ | 團隊共享的 MCP 伺服器 | [MCP scopes](/zh-TW/mcp#mcp-installation-scopes) |1504| [`.mcp.json`](#ce-mcp-json) | 僅專案 | ✓ | 團隊共享的 MCP 伺服器 | [MCP scopes](/docs/zh-TW/mcp#mcp-installation-scopes) |

1505| [`.worktreeinclude`](#ce-worktreeinclude) | 僅專案 | ✓ | Gitignored 檔案以複製到新的 worktrees | [Worktrees](/zh-TW/worktrees#copy-gitignored-files-into-worktrees) |1505| [`.worktreeinclude`](#ce-worktreeinclude) | 僅專案 | ✓ | Gitignored 檔案以複製到新的 worktrees | [Worktrees](/docs/zh-TW/worktrees#copy-gitignored-files-into-worktrees) |

1506| [`skills/<name>/SKILL.md`](#ce-skills) | 專案和全域 | ✓ | 可重複使用的提示,使用 `/name` 叫用或自動叫用 | [Skills](/zh-TW/skills) |1506| [`skills/<name>/SKILL.md`](#ce-skills) | 專案和全域 | ✓ | 可重複使用的提示,使用 `/name` 叫用或自動叫用 | [Skills](/docs/zh-TW/skills) |

1507| [`commands/*.md`](#ce-commands) | 專案和全域 | ✓ | 單檔案提示;與 skills 相同的機制 | [Skills](/zh-TW/skills) |1507| [`commands/*.md`](#ce-commands) | 專案和全域 | ✓ | 單檔案提示;與 skills 相同的機制 | [Skills](/docs/zh-TW/skills) |

1508| [`output-styles/*.md`](#ce-output-styles) | 專案和全域 | ✓ | 自訂系統提示部分 | [Output styles](/zh-TW/output-styles) |1508| [`output-styles/*.md`](#ce-output-styles) | 專案和全域 | ✓ | 自訂系統提示部分 | [Output styles](/docs/zh-TW/output-styles) |

1509| [`agents/*.md`](#ce-agents) | 專案和全域 | ✓ | Subagent 定義及其自己的提示和工具 | [Subagents](/zh-TW/sub-agents) |1509| [`agents/*.md`](#ce-agents) | 專案和全域 | ✓ | Subagent 定義及其自己的提示和工具 | [Subagents](/docs/zh-TW/sub-agents) |

1510| [`workflows/*.js`](#ce-workflows) | 專案和全域 | ✓ | Claude 撰寫並從 `/workflows` 儲存的動態工作流程指令碼;每個檔案都會變成 `/<name>` 命令 | [Dynamic workflows](/zh-TW/workflows) |1510| [`workflows/*.js`](#ce-workflows) | 專案和全域 | ✓ | Claude 撰寫並從 `/workflows` 儲存的動態工作流程指令碼;每個檔案都會變成 `/<name>` 命令 | [Dynamic workflows](/docs/zh-TW/workflows) |

1511| [`agent-memory/<name>/`](#ce-agent-memory) | 專案和全域 | ✓ | Subagents 的持久記憶 | [Persistent memory](/zh-TW/sub-agents#enable-persistent-memory) |1511| [`agent-memory/<name>/`](#ce-agent-memory) | 專案和全域 | ✓ | Subagents 的持久記憶 | [Persistent memory](/docs/zh-TW/sub-agents#enable-persistent-memory) |

1512| [`~/.claude.json`](#ce-claude-json) | 僅全域 | | 應用程式狀態、OAuth、UI 切換、個人 MCP 伺服器 | [Global config](/zh-TW/settings#global-config-settings) |1512| [`~/.claude.json`](#ce-claude-json) | 僅全域 | | 應用程式狀態、OAuth、UI 切換、個人 MCP 伺服器 | [Global config](/docs/zh-TW/settings#global-config-settings) |

1513| [`projects/<project>/memory/`](#ce-global-projects) | 僅全域 | | 自動記憶:Claude 在工作階段間對自己的筆記 | [Auto memory](/zh-TW/memory#auto-memory) |1513| [`projects/<project>/memory/`](#ce-global-projects) | 僅全域 | | 自動記憶:Claude 在工作階段間對自己的筆記 | [Auto memory](/docs/zh-TW/memory#auto-memory) |

1514| [`keybindings.json`](#ce-keybindings) | 僅全域 | | 自訂快捷鍵 | [Keybindings](/zh-TW/keybindings) |1514| [`keybindings.json`](#ce-keybindings) | 僅全域 | | 自訂快捷鍵 | [Keybindings](/docs/zh-TW/keybindings) |

1515| [`themes/*.json`](#ce-themes) | 僅全域 | | 自訂色彩主題 | [Custom themes](/zh-TW/terminal-config#create-a-custom-theme) |1515| [`themes/*.json`](#ce-themes) | 僅全域 | | 自訂色彩主題 | [Custom themes](/docs/zh-TW/terminal-config#create-a-custom-theme) |

1516 1516 

1517<h2 id="troubleshoot-configuration">1517<h2 id="troubleshoot-configuration">

1518 疑難排解設定1518 疑難排解設定

1519</h2>1519</h2>

1520 1520 

1521如果設定、hook 或檔案未生效,請參閱[偵錯您的設定](/zh-TW/debug-your-config)以取得檢查命令和症狀優先查詢表。1521如果設定、hook 或檔案未生效,請參閱[偵錯您的設定](/docs/zh-TW/debug-your-config)以取得檢查命令和症狀優先查詢表。

1522 1522 

1523<h2 id="application-data">1523<h2 id="application-data">

1524 應用程式資料1524 應用程式資料


1530 自動清理1530 自動清理

1531</h3>1531</h3>

1532 1532 

1533下列路徑中的檔案在啟動時被刪除,一旦它們的年齡超過 [`cleanupPeriodDays`](/zh-TW/settings#available-settings)。預設值為 30 天。1533下列路徑中的檔案在啟動時被刪除,一旦它們的年齡超過 [`cleanupPeriodDays`](/docs/zh-TW/settings#available-settings)。預設值為 30 天。

1534 1534 

1535| `~/.claude/` 下的路徑 | 內容 |1535| `~/.claude/` 下的路徑 | 內容 |

1536| -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |1536| -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |

1537| `projects/<project>/<session>.jsonl` | 完整對話文字記錄:每條訊息、工具呼叫和工具結果 |1537| `projects/<project>/<session>.jsonl` | 完整對話文字記錄:每條訊息、工具呼叫和工具結果 |

1538| `projects/<project>/<session>/subagents/` | [Subagent](/zh-TW/sub-agents) 對話文字記錄,當父工作階段文字記錄過期時一起移除 |1538| `projects/<project>/<session>/subagents/` | [Subagent](/docs/zh-TW/sub-agents) 對話文字記錄,當父工作階段文字記錄過期時一起移除 |

1539| `projects/<project>/<session>/tool-results/` | 溢出到單獨檔案的大型工具輸出 |1539| `projects/<project>/<session>/tool-results/` | 溢出到單獨檔案的大型工具輸出 |

1540| `file-history/<session>/` | Claude 變更的檔案的編輯前快照,用於[檢查點還原](/zh-TW/checkpointing)。保存 100 個最近檢查點的快照;沒有保留檢查點參考的快照檔案會被刪除,除了每個檔案的第一個快照 |1540| `file-history/<session>/` | Claude 變更的檔案的編輯前快照,用於[檢查點還原](/docs/zh-TW/checkpointing)。保存 100 個最近檢查點的快照;沒有保留檢查點參考的快照檔案會被刪除,除了每個檔案的第一個快照 |

1541| `plans/` | 在 [Plan Mode](/zh-TW/permission-modes#analyze-before-you-edit-with-plan-mode) 期間寫入的計畫檔案 |1541| `plans/` | 在 [Plan Mode](/docs/zh-TW/permission-modes#analyze-before-you-edit-with-plan-mode) 期間寫入的計畫檔案 |

1542| `debug/` | 每個工作階段的偵錯日誌,僅在您使用 `--debug` 啟動或執行 `/debug` 時寫入 |1542| `debug/` | 每個工作階段的偵錯日誌,僅在您使用 `--debug` 啟動或執行 `/debug` 時寫入 |

1543| `paste-cache/`、`image-cache/` | 大型貼上和附加影像的內容 |1543| `paste-cache/`、`image-cache/` | 大型貼上和附加影像的內容 |

1544| `session-env/` | 每個工作階段的環境中繼資料 |1544| `session-env/` | 每個工作階段的環境中繼資料 |

1545| `tasks/` | 由 task tools 寫入的每個工作階段任務清單 |1545| `tasks/` | 由 task tools 寫入的每個工作階段任務清單 |

1546| `shell-snapshots/` | 在啟動時擷取的別名、函式和 shell 選項,由 [Bash tool](/zh-TW/tools-reference#bash-tool-behavior) 應用於每個命令。在正常退出時移除。掃描會清除任何在當機後遺留的檔案。 |1546| `shell-snapshots/` | 在啟動時擷取的別名、函式和 shell 選項,由 [Bash tool](/docs/zh-TW/tools-reference#bash-tool-behavior) 應用於每個命令。在正常退出時移除。掃描會清除任何在當機後遺留的檔案。 |

1547| `backups/` | 在設定遷移前取得的 `~/.claude.json` 的時間戳記副本 |1547| `backups/` | 在設定遷移前取得的 `~/.claude.json` 的時間戳記副本 |

1548| `feedback-bundles/` | 由 `/feedback` 在第三方提供者上寫入的已編輯文字記錄存檔,或在未設定 Anthropic 認證時寫入,用於傳送到您的 Anthropic 帳戶團隊 |1548| `feedback-bundles/` | 由 `/feedback` 在第三方提供者上寫入的已編輯文字記錄存檔,或在未設定 Anthropic 認證時寫入,用於傳送到您的 Anthropic 帳戶團隊 |

1549| `todos/`、`statsig/`、`logs/` | 舊版本的舊版目錄。不再寫入。掃描會移除其內容,然後移除空目錄。 |1549| `todos/`、`statsig/`、`logs/` | 舊版本的舊版目錄。不再寫入。掃描會移除其內容,然後移除空目錄。 |


1558| ---------------------- | --------------------------------------------------------------------------- |1558| ---------------------- | --------------------------------------------------------------------------- |

1559| `history.jsonl` | 您輸入的每個提示,帶有時間戳記和專案路徑。用於向上箭頭回憶。 |1559| `history.jsonl` | 您輸入的每個提示,帶有時間戳記和專案路徑。用於向上箭頭回憶。 |

1560| `stats-cache.json` | 由 `/usage` 顯示的彙總權杖和成本計數 |1560| `stats-cache.json` | 由 `/usage` 顯示的彙總權杖和成本計數 |

1561| `remote-settings.json` | 您組織的[伺服器管理設定](/zh-TW/server-managed-settings)的快取副本。僅在您的組織已設定時出現。在每次啟動時重新整理。 |1561| `remote-settings.json` | 您組織的[伺服器管理設定](/docs/zh-TW/server-managed-settings)的快取副本。僅在您的組織已設定時出現。在每次啟動時重新整理。 |

1562 1562 

1563其他小型快取和鎖定檔案會根據您使用的功能而出現,可安全刪除。1563其他小型快取和鎖定檔案會根據您使用的功能而出現,可安全刪除。

1564 1564 


1569文字記錄和歷史記錄在靜止時未加密。作業系統檔案權限是唯一的保護。如果工具讀取 `.env` 檔案或命令列印認證,該值會寫入 `projects/<project>/<session>.jsonl`。若要減少暴露:1569文字記錄和歷史記錄在靜止時未加密。作業系統檔案權限是唯一的保護。如果工具讀取 `.env` 檔案或命令列印認證,該值會寫入 `projects/<project>/<session>.jsonl`。若要減少暴露:

1570 1570 

1571* 降低 `cleanupPeriodDays` 以縮短文字記錄的保留時間1571* 降低 `cleanupPeriodDays` 以縮短文字記錄的保留時間

1572* 設定 [`CLAUDE_CODE_SKIP_PROMPT_HISTORY`](/zh-TW/env-vars) 環境變數以跳過在任何模式中寫入文字記錄和提示歷史記錄。在非互動模式中,您可以改為在 `-p` 旁邊傳遞 `--no-session-persistence`,或在 Agent SDK 中設定 `persistSession: false`。1572* 設定 [`CLAUDE_CODE_SKIP_PROMPT_HISTORY`](/docs/zh-TW/env-vars) 環境變數以跳過在任何模式中寫入文字記錄和提示歷史記錄。在非互動模式中,您可以改為在 `-p` 旁邊傳遞 `--no-session-persistence`,或在 Agent SDK 中設定 `persistSession: false`。

1573* 使用[權限規則](/zh-TW/permissions)拒絕讀取認證檔案1573* 使用[權限規則](/docs/zh-TW/permissions)拒絕讀取認證檔案

1574 1574 

1575<h3 id="clear-local-data">1575<h3 id="clear-local-data">

1576 清除本機資料1576 清除本機資料


1627 相關資源1627 相關資源

1628</h2>1628</h2>

1629 1629 

1630* [管理 Claude 的記憶](/zh-TW/memory):寫入和組織 CLAUDE.md、rules 和自動記憶1630* [管理 Claude 的記憶](/docs/zh-TW/memory):寫入和組織 CLAUDE.md、rules 和自動記憶

1631* [設定設定](/zh-TW/settings):設定權限、hooks、環境變數和模型預設值1631* [設定設定](/docs/zh-TW/settings):設定權限、hooks、環境變數和模型預設值

1632* [建立 skills](/zh-TW/skills):建立可重複使用的提示和工作流程1632* [建立 skills](/docs/zh-TW/skills):建立可重複使用的提示和工作流程

1633* [設定 subagents](/zh-TW/sub-agents):定義具有自己上下文的專門代理1633* [設定 subagents](/docs/zh-TW/sub-agents):定義具有自己上下文的專門代理

hooks.md +1 −1

Details

39| `UserPromptSubmit` | When you submit a prompt, before Claude processes it |39| `UserPromptSubmit` | When you submit a prompt, before Claude processes it |

40| `UserPromptExpansion` | When a user-typed command expands into a prompt, before it reaches Claude. Can block the expansion |40| `UserPromptExpansion` | When a user-typed command expands into a prompt, before it reaches Claude. Can block the expansion |

41| `PreToolUse` | Before a tool call executes. Can block it |41| `PreToolUse` | Before a tool call executes. Can block it |

42| `PermissionRequest` | When a permission dialog appears |42| `PermissionRequest` | When a tool call needs a permission decision |

43| `PermissionDenied` | When a tool call is denied by the auto mode classifier. Return `{retry: true}` to tell the model it may retry the denied tool call |43| `PermissionDenied` | When a tool call is denied by the auto mode classifier. Return `{retry: true}` to tell the model it may retry the denied tool call |

44| `PostToolUse` | After a tool call succeeds |44| `PostToolUse` | After a tool call succeeds |

45| `PostToolUseFailure` | After a tool call fails |45| `PostToolUseFailure` | After a tool call fails |

hooks-guide.md +1 −1

Details

465| `UserPromptSubmit` | When you submit a prompt, before Claude processes it |465| `UserPromptSubmit` | When you submit a prompt, before Claude processes it |

466| `UserPromptExpansion` | When a user-typed command expands into a prompt, before it reaches Claude. Can block the expansion |466| `UserPromptExpansion` | When a user-typed command expands into a prompt, before it reaches Claude. Can block the expansion |

467| `PreToolUse` | Before a tool call executes. Can block it |467| `PreToolUse` | Before a tool call executes. Can block it |

468| `PermissionRequest` | When a permission dialog appears |468| `PermissionRequest` | When a tool call needs a permission decision |

469| `PermissionDenied` | When a tool call is denied by the auto mode classifier. Return `{retry: true}` to tell the model it may retry the denied tool call |469| `PermissionDenied` | When a tool call is denied by the auto mode classifier. Return `{retry: true}` to tell the model it may retry the denied tool call |

470| `PostToolUse` | After a tool call succeeds |470| `PostToolUse` | After a tool call succeeds |

471| `PostToolUseFailure` | After a tool call fails |471| `PostToolUseFailure` | After a tool call fails |

Details

125| `UserPromptSubmit` | When you submit a prompt, before Claude processes it |125| `UserPromptSubmit` | When you submit a prompt, before Claude processes it |

126| `UserPromptExpansion` | When a user-typed command expands into a prompt, before it reaches Claude. Can block the expansion |126| `UserPromptExpansion` | When a user-typed command expands into a prompt, before it reaches Claude. Can block the expansion |

127| `PreToolUse` | Before a tool call executes. Can block it |127| `PreToolUse` | Before a tool call executes. Can block it |

128| `PermissionRequest` | When a permission dialog appears |128| `PermissionRequest` | When a tool call needs a permission decision |

129| `PermissionDenied` | When a tool call is denied by the auto mode classifier. Return `{retry: true}` to tell the model it may retry the denied tool call |129| `PermissionDenied` | When a tool call is denied by the auto mode classifier. Return `{retry: true}` to tell the model it may retry the denied tool call |

130| `PostToolUse` | After a tool call succeeds |130| `PostToolUse` | After a tool call succeeds |

131| `PostToolUseFailure` | After a tool call fails |131| `PostToolUseFailure` | After a tool call fails |