1> ## Documentation Index
2> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt
3> Use this file to discover all available pages before exploring further.
4
5# Explore the .claude directory
6
7> Where Claude Code reads CLAUDE.md, settings.json, hooks, skills, commands, subagents, rules, and auto memory. Explore the .claude directory in your project and ~/.claude in your home directory.
8
9export const ClaudeExplorer = () => {
10 const A = useMemo(() => ({href, children}) => <a href={href} style={{
11 color: 'var(--ce-accent)',
12 textDecoration: 'none',
13 borderBottom: '1px dotted var(--ce-accent)'
14 }}>{children}</a>, []);
15 const C = useMemo(() => ({children}) => <code style={{
16 fontFamily: 'var(--ce-mono)',
17 fontSize: '0.92em',
18 padding: '1px 4px',
19 borderRadius: '3px',
20 background: 'var(--ce-surface)',
21 border: '0.5px solid var(--ce-border-subtle)'
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.</>, []);
24 const FILE_TREE = useMemo(() => ({
25 project: {
26 label: 'your-project/',
27 children: [{
28 id: 'claude-md',
29 label: 'CLAUDE.md',
30 type: 'file',
31 icon: 'md',
32 color: '#6A9BCC',
33 badge: 'committed',
34 oneLiner: 'Project instructions Claude reads 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.',
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</>],
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 conventions
40
41## Commands
42- Build: \`npm run build\`
43- Test: \`npm test\`
44- Lint: \`npm run lint\`
45
46## Stack
47- TypeScript with strict mode
48- React 19, functional components only
49
50## Rules
51- Named exports, never default exports
52- Tests live next to source: \`foo.ts\` -> \`foo.test.ts\`
53- All API routes return \`{ data, error }\` shape`,
54 docsLink: '/en/memory'
55 }, {
56 id: 'mcp-json',
57 label: '.mcp.json',
58 type: 'file',
59 icon: 'json',
60 color: '#9B7BC4',
61 badge: 'committed',
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></>,
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>{'${GITHUB_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 GitHub MCP server so Claude can read issues and open pull requests. The <C>{'${GITHUB_TOKEN}'}</C> reference is read from your shell environment when Claude Code starts the server, so the token never lands in the file.</>,
67 example: `{
68 "mcpServers": {
69 "github": {
70 "command": "npx",
71 "args": ["-y", "@modelcontextprotocol/server-github"],
72 "env": {
73 "GITHUB_TOKEN": "\${GITHUB_TOKEN}"
74 }
75 }
76 }
77}`,
78 docsLink: '/en/mcp'
79 }, {
80 id: 'worktreeinclude',
81 label: '.worktreeinclude',
82 type: 'file',
83 icon: 'md',
84 color: '#8FA876',
85 badge: 'committed',
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></>,
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></>],
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 environment
92.env
93.env.local
94
95# API credentials
96config/secrets.json`,
97 docsLink: '/en/common-workflows#copy-gitignored-files-to-worktrees'
98 }, {
99 id: 'dot-claude',
100 label: '.claude/',
101 type: 'folder',
102 icon: 'folder',
103 color: 'var(--ce-accent)',
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.',
106 children: [{
107 id: 'settings-json',
108 label: 'settings.json',
109 type: 'file',
110 icon: 'json',
111 color: 'var(--ce-text-3)',
112 badge: 'committed',
113 oneLiner: 'Permissions, hooks, and configuration',
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.',
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/</>],
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.</>,
119 example: `{
120 "permissions": {
121 "allow": [
122 "Bash(npm test *)",
123 "Bash(npm run *)"
124 ],
125 "deny": [
126 "Bash(rm -rf *)"
127 ]
128 },
129 "hooks": {
130 "PostToolUse": [{
131 "matcher": "Edit|Write",
132 "hooks": [{
133 "type": "command",
134 "command": "jq -r '.tool_input.file_path' | xargs npx prettier --write"
135 }]
136 }]
137 }
138}`,
139 docsLink: '/en/settings'
140 }, {
141 id: 'settings-local-json',
142 label: 'settings.local.json',
143 type: 'file',
144 icon: 'json',
145 color: 'var(--ce-text-3)',
146 badge: 'gitignored',
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',
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.',
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></>],
151 exampleIntro: 'This example adds Docker permissions on top of whatever the team settings.json allows.',
152 example: `{
153 "permissions": {
154 "allow": [
155 "Bash(docker *)"
156 ]
157 }
158}`,
159 docsLink: '/en/settings'
160 }, {
161 id: 'rules',
162 label: 'rules/',
163 type: 'folder',
164 icon: 'folder',
165 color: '#9B7BC4',
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</>,
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>.</>],
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/',
171 children: [{
172 id: 'rule-testing',
173 label: 'testing.md',
174 type: 'file',
175 icon: 'md',
176 color: '#9B7BC4',
177 badge: 'committed',
178 oneLiner: 'Test conventions scoped to test files',
179 when: <>Loaded when Claude reads a file matching the <C>paths:</C> globs below</>,
180 description: <>An example rule that only loads when Claude is working on test files. The <C>paths:</C> globs in the frontmatter define which files trigger it; here, anything ending in .test.ts or .test.tsx. For other files, this rule is not loaded into context.</>,
181 example: `---
182paths:
183 - "**/*.test.ts"
184 - "**/*.test.tsx"
185---
186
187# Testing Rules
188
189- Use descriptive test names: "should [expected] when [condition]"
190- Mock external dependencies, not internal modules
191- Clean up side effects in afterEach`
192 }, {
193 id: 'rule-api',
194 label: 'api-design.md',
195 type: 'file',
196 icon: 'md',
197 color: '#9B7BC4',
198 badge: 'committed',
199 oneLiner: 'API conventions scoped to backend code',
200 when: <>Loaded when Claude reads a file matching the <C>paths:</C> glob below</>,
201 description: <>A second example showing a rule scoped to backend code. The <C>paths:</C> glob matches files under src/api/, so these conventions load only when Claude is editing API routes.</>,
202 example: `---
203paths:
204 - "src/api/**/*.ts"
205---
206
207# API Design Rules
208
209- All endpoints must validate input with Zod schemas
210- Return shape: { data: T } | { error: string }
211- Rate limit all public endpoints`
212 }]
213 }, {
214 id: 'skills',
215 label: 'skills/',
216 type: 'folder',
217 icon: 'folder',
218 color: '#D4A843',
219 oneLiner: 'Reusable prompts you or Claude invoke by name',
220 when: <>Invoked with <C>/skill-name</C> or when Claude matches the task to a skill</>,
221 description: <>Each skill is a folder with a SKILL.md file plus any supporting files it needs. By default, both you and Claude can invoke a skill. Use frontmatter to control that: <C>disable-model-invocation: true</C> for user-only workflows like <C>/deploy</C>, or <C>user-invocable: false</C> to hide from the <C>/</C> menu while Claude can still invoke it.</>,
222 tips: [<>Skills accept arguments: <C>/deploy staging</C> passes "staging" as <C>$ARGUMENTS</C>. Use <C>$0</C>, <C>$1</C>, and so on for positional access</>, <>The <C>description</C> frontmatter determines when Claude auto-invokes the skill</>, 'Bundle reference docs alongside SKILL.md. Claude knows the skill directory path and can read supporting files when you mention them'],
223 docsLink: '/en/skills',
224 children: [{
225 id: 'skill-review',
226 label: 'security-review/',
227 type: 'folder',
228 icon: 'folder',
229 color: '#D4A843',
230 oneLiner: 'A skill bundling SKILL.md with supporting files',
231 children: [{
232 id: 'skill-review-md',
233 label: 'SKILL.md',
234 type: 'file',
235 icon: 'md',
236 color: '#D4A843',
237 badge: 'committed',
238 oneLiner: 'Entrypoint: trigger, invocability, instructions',
239 when: <>User types <C>/security-review <target></C>; Claude cannot auto-invoke this skill</>,
240 description: [<>This skill uses <C>disable-model-invocation: true</C> so only you can trigger it; Claude never invokes it on its own.</>, <>The <C>!`...`</C> line runs a shell command and injects its output into the prompt. <C>$ARGUMENTS</C> substitutes whatever you typed after the skill name. Claude sees the skill directory path, so mentioning a bundled file like checklist.md lets Claude read it.</>],
241 example: `---
242description: Reviews code changes for security vulnerabilities, authentication gaps, and injection risks
243disable-model-invocation: true
244argument-hint: <branch-or-path>
245---
246
247## Diff to review
248
249!\`git diff $ARGUMENTS\`
250
251Audit the changes above for:
252
2531. Injection vulnerabilities (SQL, XSS, command)
2542. Authentication and authorization gaps
2553. Hardcoded secrets or credentials
256
257Use checklist.md in this skill directory for the full review checklist.
258
259Report findings with severity ratings and remediation steps.`
260 }, {
261 id: 'skill-checklist',
262 label: 'checklist.md',
263 type: 'file',
264 icon: 'md',
265 color: '#D4A843',
266 badge: 'committed',
267 oneLiner: 'Supporting file bundled with the skill',
268 when: 'Claude reads it when SKILL.md mentions it',
269 description: <>Skills can bundle any supporting files: reference docs, templates, scripts. The skill directory path is prepended to SKILL.md, so Claude can read bundled files by name. For scripts in bash injection commands, use the <C>{'${CLAUDE_SKILL_DIR}'}</C> placeholder.</>,
270 example: `# Security Review Checklist
271
272## Input Validation
273- [ ] All user input sanitized before DB queries
274- [ ] File upload MIME types validated
275- [ ] Path traversal prevented on file operations
276
277## Authentication
278- [ ] JWT tokens expire after 24 hours
279- [ ] API keys stored in environment variables
280- [ ] Passwords hashed with bcrypt or argon2`
281 }]
282 }]
283 }, {
284 id: 'commands',
285 label: 'commands/',
286 type: 'folder',
287 icon: 'folder',
288 color: '#788C5D',
289 oneLiner: <>Single-file prompts invoked with <C>/name</C></>,
290 note: commandsNote,
291 when: <>User types <C>/command-name</C></>,
292 description: <>A file at <C>commands/deploy.md</C> creates <C>/deploy</C> the same way a skill at <C>skills/deploy/SKILL.md</C> does, and both can be auto-invoked by Claude. Skills use a directory with SKILL.md, letting you bundle reference docs, templates, or scripts alongside the prompt.</>,
293 tips: [<>Use <C>$ARGUMENTS</C> in the file to accept parameters: <C>/fix-issue 123</C></>, 'If a skill and command share a name, the skill takes precedence', 'New commands should usually be skills instead; commands remain supported'],
294 docsLink: '/en/skills',
295 children: [{
296 id: 'cmd-example',
297 label: 'fix-issue.md',
298 type: 'file',
299 icon: 'md',
300 color: '#788C5D',
301 badge: 'committed',
302 oneLiner: <>Invoked as <C>/fix-issue <number></C></>,
303 note: commandsNote,
304 description: [<>An example command for fixing a GitHub issue. Type <C>/fix-issue 123</C> and the <C>!`...`</C> line runs <C>gh issue view 123</C> in your shell, injecting the output into the prompt before Claude sees it.</>, <><C>$ARGUMENTS</C> substitutes whatever you typed after the command name. For positional access, use <C>$0</C> <C>$1</C> and so on.</>],
305 example: `---
306argument-hint: <issue-number>
307---
308
309!\`gh issue view $ARGUMENTS\`
310
311Investigate and fix the issue above.
312
3131. Trace the bug to its root cause
3142. Implement the fix
3153. Write or update tests
3164. Summarize what you changed and why`
317 }]
318 }, {
319 id: 'output-styles',
320 label: 'output-styles/',
321 type: 'folder',
322 icon: 'folder',
323 color: '#5AA7A7',
324 oneLiner: 'Project-scoped output styles, if your team shares any',
325 when: 'Applied at session start when selected via the outputStyle setting',
326 description: <>Output styles are usually personal, so most live in <C>~/.claude/output-styles/</C>. Put one here if your team shares a style, like a review mode everyone uses. See <A href="#ce-global-output-styles">the Global tab</A> for the full explanation and example.</>,
327 docsLink: '/en/output-styles',
328 children: []
329 }, {
330 id: 'agents',
331 label: 'agents/',
332 type: 'folder',
333 icon: 'folder',
334 color: '#C46686',
335 oneLiner: 'Specialized subagents with their own context window',
336 when: 'Runs in its own context window when you or Claude invoke it',
337 description: 'Each markdown file defines a subagent with its own system prompt, tool access, and optionally its own model. Subagents run in a fresh context window, keeping the main conversation clean. Useful for parallel work or isolated tasks.',
338 tips: ['Each agent gets a fresh context window, separate from your main session', <>Restrict tool access per agent with the <C>tools:</C> frontmatter field</>, 'Type @ and pick an agent from the autocomplete to delegate directly'],
339 docsLink: '/en/sub-agents',
340 children: [{
341 id: 'agent-reviewer',
342 label: 'code-reviewer.md',
343 type: 'file',
344 icon: 'md',
345 color: '#C46686',
346 badge: 'committed',
347 oneLiner: 'Subagent for isolated code review',
348 when: 'Claude spawns it for review tasks, or you @-mention it from the autocomplete',
349 description: <>An example subagent restricted to read-only tools. The <C>description</C> frontmatter tells Claude when to delegate to it automatically; <C>tools:</C> limits it to Read, Grep, and Glob so it can inspect code but never edit. The body becomes the subagent's system prompt.</>,
350 example: `---
351name: code-reviewer
352description: Reviews code for correctness, security, and maintainability
353tools: Read, Grep, Glob
354---
355
356You are a senior code reviewer. Review for:
357
3581. Correctness: logic errors, edge cases, null handling
3592. Security: injection, auth bypass, data exposure
3603. Maintainability: naming, complexity, duplication
361
362Every finding must include a concrete fix.`
363 }]
364 }, {
365 id: 'agent-memory',
366 label: 'agent-memory/',
367 type: 'folder',
368 icon: 'folder',
369 color: '#C46686',
370 badge: 'committed',
371 autogen: true,
372 oneLiner: 'Subagent persistent memory, separate from your main session auto memory',
373 when: 'First 200 lines (capped at 25KB) of MEMORY.md loaded into the subagent system prompt when it runs',
374 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.</>,
375 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</>],
376 docsLink: '/en/sub-agents#enable-persistent-memory',
377 children: [{
378 id: 'agent-memory-sub',
379 label: '<agent-name>/',
380 type: 'folder',
381 icon: 'folder',
382 color: '#C46686',
383 autogen: true,
384 children: [{
385 id: 'agent-memory-md',
386 label: 'MEMORY.md',
387 type: 'file',
388 icon: 'md',
389 color: '#C46686',
390 badge: 'committed',
391 autogen: true,
392 oneLiner: 'The subagent writes and maintains this file automatically',
393 when: 'Loaded into the subagent system prompt when the subagent starts',
394 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.</>,
395 example: `# code-reviewer memory
396
397## Patterns seen
398- Project uses custom Result<T, E> type, not exceptions
399- Auth middleware expects Bearer token in Authorization header
400- Tests use factory functions in test/factories/
401
402## Recurring issues
403- Missing null checks on API responses (src/api/*)
404- Unhandled promise rejections in background jobs`
405 }]
406 }]
407 }]
408 }]
409 },
410 global: {
411 label: '~/',
412 children: [{
413 id: 'claude-json',
414 label: '.claude.json',
415 type: 'file',
416 icon: 'json',
417 color: 'var(--ce-text-3)',
418 badge: 'local',
419 oneLiner: 'App state and UI preferences',
420 when: <>Read at session start for your preferences and MCP servers. Claude Code writes back to it when you change settings in <C>/config</C> or approve trust prompts</>,
421 description: <>Holds state that does not belong in settings.json: theme, OAuth session, per-project trust decisions, your personal MCP servers, and UI toggles. Mostly managed through <C>/config</C> rather than editing directly.</>,
422 tips: [<>UI toggles like <C>showTurnDuration</C> and <C>terminalProgressBarEnabled</C> live here, not in settings.json</>, <>The <C>projects</C> key tracks per-project state like trust-dialog acceptance and last-session metrics. Permission rules you approve in-session go to <C>.claude/settings.local.json</C> instead</>, <>MCP servers here are yours only: user scope applies across all projects, local scope is per-project but not committed. Team-shared servers go in <C>.mcp.json</C> at the project root instead</>],
423 example: `{
424 "editorMode": "vim",
425 "showTurnDuration": false,
426 "mcpServers": {
427 "my-tools": {
428 "command": "npx",
429 "args": ["-y", "@example/mcp-server"]
430 }
431 }
432}`,
433 docsLink: '/en/settings#global-config-settings'
434 }, {
435 id: 'global-dot-claude',
436 label: '.claude/',
437 type: 'folder',
438 icon: 'folder',
439 color: 'var(--ce-accent)',
440 oneLiner: 'Your personal configuration across all projects',
441 description: 'The global counterpart to your project .claude/ directory. Files here apply to every project you work in and are never committed to any repository.',
442 children: [{
443 id: 'global-claude-md',
444 label: 'CLAUDE.md',
445 type: 'file',
446 icon: 'md',
447 color: '#6A9BCC',
448 badge: 'local',
449 oneLiner: 'Personal preferences across every project',
450 when: 'Loaded at the start of every session, in every project',
451 description: 'Your global instruction file. Loaded alongside the project CLAUDE.md at session start, so both are in context together. When instructions conflict, project-level instructions take priority. Keep this to preferences that apply everywhere: response style, commit format, personal conventions.',
452 tips: ['Keep it short since it loads into context for every project, alongside that project\'s own CLAUDE.md', 'Good for response style, commit format, and personal conventions'],
453 example: `# Global preferences
454
455- Keep explanations concise
456- Use conventional commit format
457- Show the terminal command to verify changes
458- Prefer composition over inheritance`,
459 docsLink: '/en/memory'
460 }, {
461 id: 'global-settings',
462 label: 'settings.json',
463 type: 'file',
464 icon: 'json',
465 color: 'var(--ce-text-3)',
466 badge: 'local',
467 oneLiner: 'Default settings for all projects',
468 when: 'Your defaults. Project and local settings.json override any keys you also set there',
469 description: [<>Same keys as project <C>settings.json</C>: permissions, hooks, model, environment variables, and the rest. Put settings here that you want in every project, like permissions you always allow, a preferred model, or a notification hook that runs regardless of which project you're in.</>, <>Settings follow a precedence order: project <C>settings.json</C> overrides any matching keys you set here. This is different from CLAUDE.md, where global and project files are both loaded into context rather than merged key by key.</>],
470 example: `{
471 "permissions": {
472 "allow": [
473 "Bash(git log *)",
474 "Bash(git diff *)"
475 ]
476 }
477}`,
478 docsLink: '/en/settings'
479 }, {
480 id: 'keybindings',
481 label: 'keybindings.json',
482 type: 'file',
483 icon: 'json',
484 color: 'var(--ce-text-3)',
485 badge: 'local',
486 oneLiner: 'Custom keyboard shortcuts',
487 when: 'Read at session start and hot-reloaded when you edit the file',
488 description: <>Rebind keyboard shortcuts in the interactive CLI. Run <C>/keybindings</C> to create or open this file with a schema reference. Ctrl+C, Ctrl+D, and Ctrl+M are reserved and cannot be rebound.</>,
489 exampleIntro: <>This example binds <C>Ctrl+E</C> to open your external editor and unbinds <C>Ctrl+U</C> by setting it to <C>null</C>. The <C>context</C> field scopes bindings to a specific part of the CLI, here the main chat input.</>,
490 example: `{
491 "$schema": "https://www.schemastore.org/claude-code-keybindings.json",
492 "$docs": "https://code.claude.com/docs/en/keybindings",
493 "bindings": [
494 {
495 "context": "Chat",
496 "bindings": {
497 "ctrl+e": "chat:externalEditor",
498 "ctrl+u": null
499 }
500 }
501 ]
502}`,
503 docsLink: '/en/keybindings'
504 }, {
505 id: 'global-projects',
506 label: 'projects/',
507 type: 'folder',
508 icon: 'folder',
509 color: '#E8A45C',
510 autogen: true,
511 oneLiner: "Auto memory: Claude's notes to itself, per project",
512 when: 'MEMORY.md loaded at session start; topic files read on demand',
513 description: 'Auto memory lets Claude accumulate knowledge across sessions without you writing anything. Claude saves notes as it works: build commands, debugging insights, architecture notes. Each project gets its own memory directory keyed by the repository path.',
514 tips: [<>On by default. Toggle with <C>/memory</C> or <C>autoMemoryEnabled</C> in settings</>, 'MEMORY.md is the index loaded each session. The first 200 lines, or 25KB, whichever comes first, are read', 'Topic files like debugging.md are read on demand, not at startup', 'These are plain markdown. Edit or delete them anytime'],
515 docsLink: '/en/memory#auto-memory',
516 children: [{
517 id: 'memory-dir',
518 label: '<project>/memory/',
519 type: 'folder',
520 icon: 'folder',
521 color: '#E8A45C',
522 autogen: true,
523 oneLiner: "Claude's accumulated knowledge for one project",
524 children: [{
525 id: 'memory-md',
526 label: 'MEMORY.md',
527 type: 'file',
528 icon: 'md',
529 color: '#E8A45C',
530 badge: 'local',
531 autogen: true,
532 oneLiner: 'Claude writes and maintains this file automatically',
533 when: 'First 200 lines (capped at 25KB) loaded at session start',
534 description: 'Claude creates and updates this file as it works; you do not write it yourself. It acts as an index that Claude reads at the start of every session, pointing to topic files for detail. You can edit or delete it, but Claude will keep updating it.',
535 example: `# Memory Index
536
537## Project
538- [build-and-test.md](build-and-test.md): npm run build (~45s), Vitest, dev server on 3001
539- [architecture.md](architecture.md): API client singleton, refresh-token auth
540
541## Reference
542- [debugging.md](debugging.md): auth token rotation and DB connection troubleshooting`,
543 docsLink: '/en/memory'
544 }, {
545 id: 'memory-topic',
546 label: 'debugging.md',
547 type: 'file',
548 icon: 'md',
549 color: '#E8A45C',
550 badge: 'local',
551 autogen: true,
552 oneLiner: 'Topic notes Claude writes when MEMORY.md gets long',
553 when: 'Claude reads this when a related task comes up',
554 description: 'An example of a topic file Claude creates when MEMORY.md grows too long. Claude picks the filename based on what it splits out: debugging.md, architecture.md, build-commands.md, or similar. You never create these yourself. Claude reads a topic file back only when the current task relates to it.',
555 example: `---
556name: Debugging patterns
557description: Auth token rotation and database connection troubleshooting for this project
558type: reference
559---
560
561## Auth Token Issues
562- Refresh token rotation: old token invalidated immediately
563- If 401 after refresh: check clock skew between client and server
564
565## Database Connection Drops
566- Connection pool: max 10 in dev, 50 in prod
567- Always check \`docker compose ps\` first`
568 }]
569 }]
570 }, {
571 id: 'global-rules',
572 label: 'rules/',
573 type: 'folder',
574 icon: 'folder',
575 color: '#9B7BC4',
576 oneLiner: 'User-level rules that apply to every project',
577 when: <>Rules without <C>paths:</C> load at session start. Rules with <C>paths:</C> load when a matching file enters context</>,
578 description: 'Same as project .claude/rules/ but applies everywhere. Use this for conventions you want across all your work, like personal code style or commit message format.',
579 docsLink: '/en/memory#organize-rules-with-claude/rules/',
580 children: []
581 }, {
582 id: 'global-skills',
583 label: 'skills/',
584 type: 'folder',
585 icon: 'folder',
586 color: '#D4A843',
587 oneLiner: 'Personal skills available in every project',
588 when: <>Invoked with <C>/skill-name</C> in any project</>,
589 description: 'Skills you built for yourself that work everywhere. Same structure as project skills: each is a folder with SKILL.md, scoped to your user account instead of a single project.',
590 docsLink: '/en/skills',
591 children: []
592 }, {
593 id: 'global-commands',
594 label: 'commands/',
595 type: 'folder',
596 icon: 'folder',
597 color: '#788C5D',
598 oneLiner: 'Personal single-file commands available in every project',
599 note: commandsNote,
600 when: <>User types <C>/command-name</C> in any project</>,
601 description: 'Same as project commands/ but scoped to your user account. Each markdown file becomes a command available everywhere.',
602 docsLink: '/en/skills',
603 children: []
604 }, {
605 id: 'global-output-styles',
606 label: 'output-styles/',
607 type: 'folder',
608 icon: 'folder',
609 color: '#5AA7A7',
610 oneLiner: 'Custom system-prompt sections that adjust how Claude works',
611 when: 'Applied at session start when selected via the outputStyle setting',
612 description: [<>Each markdown file defines an output style: a section appended to the system prompt that, by default, also drops the built-in software-engineering task instructions. Use this to adapt Claude Code for uses beyond coding, or to add teaching or review modes.</>, <>Select a built-in or custom style with <C>/config</C> or the <C>outputStyle</C> key in settings. Styles here are available in every project; project-level styles with the same name take precedence.</>],
613 tips: ['Built-in styles Explanatory and Learning are included with Claude Code; custom styles go here', <>Set <C>keep-coding-instructions: true</C> in frontmatter to keep the default task instructions alongside your additions</>, 'Changes take effect on the next session since the system prompt is fixed at startup for caching'],
614 docsLink: '/en/output-styles',
615 children: [{
616 id: 'output-style-example',
617 label: 'teaching.md',
618 type: 'file',
619 icon: 'md',
620 color: '#5AA7A7',
621 badge: 'local',
622 oneLiner: 'Example style that adds explanations and leaves small changes for you',
623 when: <>Active when <C>outputStyle</C> in settings is set to <C>teaching</C></>,
624 description: <>This style appends instructions to the system prompt: Claude adds a "Why this approach" note after each task and leaves TODO(human) markers for changes under 10 lines instead of writing them itself. Select it by setting <C>outputStyle</C> to the filename without .md, or to the <C>name</C> field if you set one in frontmatter.</>,
625 example: `---
626description: Explains reasoning and asks you to implement small pieces
627keep-coding-instructions: true
628---
629
630After completing each task, add a brief "Why this approach" note
631explaining the key design decision.
632
633When a change is under 10 lines, ask the user to implement it
634themselves by leaving a TODO(human) marker instead of writing it.`
635 }]
636 }, {
637 id: 'global-agents',
638 label: 'agents/',
639 type: 'folder',
640 icon: 'folder',
641 color: '#C46686',
642 oneLiner: 'Personal subagents available in every project',
643 when: 'Claude delegates or you @-mention in any project',
644 description: 'Subagents defined here are available across all your projects. Same format as project agents.',
645 docsLink: '/en/sub-agents',
646 children: []
647 }, {
648 id: 'global-agent-memory',
649 label: 'agent-memory/',
650 type: 'folder',
651 icon: 'folder',
652 color: '#C46686',
653 autogen: true,
654 oneLiner: <>Persistent memory for subagents with <C>memory: user</C></>,
655 when: 'Loaded into the subagent system prompt when the subagent starts',
656 description: <>Subagents with <C>memory: user</C> in their frontmatter store knowledge here that persists across all projects. For project-scoped subagent memory, see <C>.claude/agent-memory/</C> instead.</>,
657 docsLink: '/en/sub-agents#enable-persistent-memory',
658 children: []
659 }]
660 }]
661 }
662 }), []);
663 const BADGE_STYLES = useMemo(() => ({
664 committed: {
665 bg: 'rgba(85,138,66,0.08)',
666 color: 'var(--ce-badge-committed)',
667 border: 'rgba(85,138,66,0.15)',
668 label: 'committed'
669 },
670 gitignored: {
671 bg: 'rgba(217,119,87,0.06)',
672 color: 'var(--ce-badge-gitignored)',
673 border: 'rgba(217,119,87,0.15)',
674 label: 'gitignored'
675 },
676 local: {
677 bg: 'rgba(115,114,108,0.06)',
678 color: 'var(--ce-badge-local)',
679 border: 'rgba(115,114,108,0.12)',
680 label: 'local only'
681 },
682 autogen: {
683 bg: 'rgba(232,164,92,0.1)',
684 color: 'var(--ce-badge-autogen)',
685 border: 'rgba(232,164,92,0.2)',
686 label: 'Claude writes'
687 }
688 }), []);
689 const allNodes = useMemo(() => {
690 const flatten = (nodes, acc, path, parentId) => {
691 for (const node of nodes) {
692 const nextPath = [...path, node.label];
693 acc[node.id] = {
694 ...node,
695 path: nextPath,
696 parentId
697 };
698 if (node.children) flatten(node.children, acc, nextPath, node.id);
699 }
700 return acc;
701 };
702 const project = flatten(FILE_TREE.project.children, {}, [FILE_TREE.project.label]);
703 const global = flatten(FILE_TREE.global.children, {}, [FILE_TREE.global.label]);
704 for (const id in project) project[id].root = 'project';
705 for (const id in global) global[id].root = 'global';
706 return {
707 ...project,
708 ...global
709 };
710 }, [FILE_TREE]);
711 const allFolderIds = useMemo(() => Object.keys(allNodes).filter(id => allNodes[id].type === 'folder'), [allNodes]);
712 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'];
713 const [mounted, setMounted] = useState(false);
714 const [activeRoot, setActiveRoot] = useState('project');
715 const [selectedId, setSelectedId] = useState('claude-md');
716 const [expandedFolders, setExpandedFolders] = useState(() => new Set(DEFAULT_EXPANDED));
717 const [forceMobile, setForceMobile] = useState(false);
718 const [copiedId, setCopiedId] = useState(null);
719 const [isFullscreen, setIsFullscreen] = useState(false);
720 const copyTimeoutRef = useRef(null);
721 const rootRef = useRef(null);
722 useEffect(() => {
723 setMounted(true);
724 const applyHash = scroll => {
725 const hash = window.location.hash.slice(1);
726 if (!hash.startsWith('ce-')) return;
727 const id = hash.slice(3);
728 const node = allNodes[id];
729 if (!node) return;
730 setActiveRoot(node.root);
731 setSelectedId(id);
732 setExpandedFolders(new Set(allFolderIds));
733 if (scroll && rootRef.current) rootRef.current.scrollIntoView({
734 behavior: 'smooth',
735 block: 'start'
736 });
737 };
738 applyHash(false);
739 const onHashChange = () => applyHash(true);
740 const onFsChange = () => setIsFullscreen(!!document.fullscreenElement);
741 window.addEventListener('hashchange', onHashChange);
742 document.addEventListener('fullscreenchange', onFsChange);
743 return () => {
744 if (copyTimeoutRef.current) clearTimeout(copyTimeoutRef.current);
745 window.removeEventListener('hashchange', onHashChange);
746 document.removeEventListener('fullscreenchange', onFsChange);
747 };
748 }, []);
749 useEffect(() => {
750 if (!mounted || !rootRef.current) return;
751 const hash = window.location.hash.slice(1);
752 if (hash.startsWith('ce-') && allNodes[hash.slice(3)]) {
753 rootRef.current.scrollIntoView({
754 behavior: 'smooth',
755 block: 'start'
756 });
757 }
758 }, [mounted]);
759 if (!mounted) return null;
760 const selected = allNodes[selectedId];
761 const tree = FILE_TREE[activeRoot];
762 const isCopied = copiedId === selected.id;
763 const toggleFolder = id => {
764 const next = new Set(expandedFolders);
765 next.has(id) ? next.delete(id) : next.add(id);
766 setExpandedFolders(next);
767 };
768 const switchRoot = root => {
769 if (root === activeRoot) return;
770 setActiveRoot(root);
771 const firstId = FILE_TREE[root].children[0].id;
772 setSelectedId(firstId);
773 try {
774 history.replaceState(null, '', '#ce-' + firstId);
775 } catch (e) {}
776 };
777 const toggleFullscreen = () => {
778 if (!rootRef.current) return;
779 if (document.fullscreenElement) document.exitFullscreen(); else rootRef.current.requestFullscreen().catch(() => {});
780 };
781 const selectNode = n => {
782 setSelectedId(n.id);
783 if (n.type === 'folder' && !expandedFolders.has(n.id)) toggleFolder(n.id);
784 try {
785 history.replaceState(null, '', '#ce-' + n.id);
786 } catch (e) {}
787 };
788 const iconBtn = {
789 width: 28,
790 flexShrink: 0,
791 borderRadius: '6px',
792 border: 'none',
793 cursor: 'pointer',
794 background: 'transparent',
795 color: 'var(--ce-text-4)',
796 display: 'flex',
797 alignItems: 'center',
798 justifyContent: 'center'
799 };
800 const visibleFolderIds = allFolderIds.filter(id => allNodes[id].root === activeRoot);
801 const allExpanded = visibleFolderIds.every(id => expandedFolders.has(id));
802 const toggleAllFolders = () => {
803 const next = new Set(expandedFolders);
804 visibleFolderIds.forEach(id => allExpanded ? next.delete(id) : next.add(id));
805 setExpandedFolders(next);
806 };
807 const onTreeKeyDown = e => {
808 if (!['ArrowDown', 'ArrowUp', 'ArrowRight', 'ArrowLeft'].includes(e.key)) return;
809 const visible = [];
810 const walk = nodes => {
811 for (const n of nodes) {
812 visible.push(n.id);
813 if (n.children && expandedFolders.has(n.id)) walk(n.children);
814 }
815 };
816 walk(tree.children);
817 const i = visible.indexOf(selectedId);
818 if (i === -1) return;
819 e.preventDefault();
820 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') {
821 if (!expandedFolders.has(selectedId)) toggleFolder(selectedId); else if (selected.children && selected.children.length) selectNode(allNodes[selected.children[0].id]);
822 } else if (e.key === 'ArrowLeft') {
823 if (selected.type === 'folder' && expandedFolders.has(selectedId)) toggleFolder(selectedId); else if (selected.parentId) selectNode(allNodes[selected.parentId]);
824 }
825 };
826 const copyExample = (id, text) => {
827 const done = () => {
828 setCopiedId(id);
829 if (copyTimeoutRef.current) clearTimeout(copyTimeoutRef.current);
830 copyTimeoutRef.current = setTimeout(() => setCopiedId(null), 2000);
831 };
832 const fallback = () => {
833 const ta = document.createElement('textarea');
834 ta.value = text;
835 ta.style.position = 'fixed';
836 ta.style.opacity = '0';
837 document.body.appendChild(ta);
838 ta.select();
839 try {
840 if (document.execCommand('copy')) done();
841 } catch (e) {}
842 document.body.removeChild(ta);
843 };
844 if (navigator.clipboard) {
845 navigator.clipboard.writeText(text).then(done, fallback);
846 } else {
847 fallback();
848 }
849 };
850 const renderIcon = (icon, color, size) => {
851 const sz = size || 14;
852 if (icon === 'folder') {
853 return <svg width={sz} height={sz} viewBox="0 0 14 14" fill="none">
854 <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" />
855 </svg>;
856 }
857 if (icon === 'json') {
858 return <svg width={sz} height={sz} viewBox="0 0 14 14" fill="none">
859 <rect x="2" y="1.5" width="10" height="11" rx="1.5" fill={color} fillOpacity="0.15" stroke={color} strokeWidth="1" />
860 <text x="7" y="9" fontSize="6" fontFamily="monospace" fill={color} textAnchor="middle" fontWeight="700">{'{}'}</text>
861 </svg>;
862 }
863 return <svg width={sz} height={sz} viewBox="0 0 14 14" fill="none">
864 <rect x="2" y="1.5" width="10" height="11" rx="1.5" fill={color} fillOpacity="0.15" stroke={color} strokeWidth="1" />
865 <line x1="4.5" y1="5" x2="9.5" y2="5" stroke={color} strokeWidth="1" />
866 <line x1="4.5" y1="7" x2="9.5" y2="7" stroke={color} strokeWidth="1" />
867 <line x1="4.5" y1="9" x2="8" y2="9" stroke={color} strokeWidth="1" />
868 </svg>;
869 };
870 const renderNode = (node, depth) => {
871 const isFolder = node.type === 'folder';
872 const isExpanded = expandedFolders.has(node.id);
873 const isSelected = selectedId === node.id;
874 return <div key={node.id}>
875 <button role="treeitem" tabIndex={-1} onClick={() => selectNode(node)} aria-selected={isSelected} aria-expanded={isFolder ? isExpanded : undefined} style={{
876 display: 'flex',
877 alignItems: 'center',
878 gap: '5px',
879 width: '100%',
880 padding: `4px 8px 4px ${8 + depth * 16}px`,
881 background: isSelected ? 'var(--ce-accent-bg)' : 'transparent',
882 borderTop: 'none',
883 borderRight: 'none',
884 borderBottom: 'none',
885 borderLeft: isSelected ? '2px solid var(--ce-accent)' : '2px solid transparent',
886 outline: 'none',
887 cursor: 'pointer',
888 textAlign: 'left',
889 fontFamily: 'var(--ce-mono)',
890 fontSize: '13.5px',
891 color: isSelected ? 'var(--ce-accent)' : 'var(--ce-text-2)',
892 fontWeight: isSelected ? 550 : 400,
893 transition: 'all 0.1s'
894 }}>
895 {isFolder ? <span onClick={e => {
896 e.stopPropagation();
897 toggleFolder(node.id);
898 }} style={{
899 fontSize: '14px',
900 color: 'var(--ce-text-4)',
901 width: '20px',
902 height: '20px',
903 display: 'inline-flex',
904 alignItems: 'center',
905 justifyContent: 'center',
906 cursor: 'pointer',
907 borderRadius: '4px',
908 marginLeft: '-6px',
909 flexShrink: 0
910 }} onMouseEnter={e => {
911 e.currentTarget.style.background = 'var(--ce-arrow-hover)';
912 e.currentTarget.style.color = 'var(--ce-text-2)';
913 }} onMouseLeave={e => {
914 e.currentTarget.style.background = 'transparent';
915 e.currentTarget.style.color = 'var(--ce-text-4)';
916 }}>{isExpanded ? '▾' : '▸'}</span> : <span style={{
917 width: '14px',
918 flexShrink: 0
919 }} />}
920 {renderIcon(node.icon, node.color)}
921 <span style={{
922 flex: 1,
923 overflow: 'hidden',
924 textOverflow: 'ellipsis',
925 whiteSpace: 'nowrap'
926 }}>{node.label}</span>
927 {node.badge && BADGE_STYLES[node.badge] && <span title={BADGE_STYLES[node.badge].label} style={{
928 width: 6,
929 height: 6,
930 borderRadius: '50%',
931 background: BADGE_STYLES[node.badge].color,
932 flexShrink: 0,
933 opacity: 0.7
934 }} />}
935 </button>
936 {isFolder && isExpanded && node.children && <div role="group">{node.children.map(child => renderNode(child, depth + 1))}</div>}
937 </div>;
938 };
939 return <>
940 <style>{`
941 .ce-root {
942 --ce-mono: var(--font-mono, ui-monospace, monospace);
943 --ce-accent: #D97757;
944 --ce-accent-bg: rgba(217,119,87,0.06);
945 --ce-accent-border: rgba(217,119,87,0.12);
946 --ce-bg: #fff;
947 --ce-surface: #FAFAF7;
948 --ce-surface-hover: #F0EEE6;
949 --ce-border: #E8E6DC;
950 --ce-border-subtle: #F0EEE6;
951 --ce-text: #141413;
952 --ce-text-2: #5E5D59;
953 --ce-text-3: #73726C;
954 --ce-text-4: #9C9A92;
955 --ce-text-5: #B8B6AE;
956 --ce-sep: #D1CFC5;
957 --ce-code-header: #F5F4ED;
958 --ce-code-bg: #1A1918;
959 --ce-arrow-hover: rgba(0,0,0,0.08);
960 --ce-badge-committed: #3d6b2e;
961 --ce-badge-gitignored: #b85c3a;
962 --ce-badge-local: #5e5d59;
963 --ce-badge-autogen: #b07520;
964 --ce-when-text: #4a7fb5;
965 }
966 .dark .ce-root {
967 --ce-bg: #1a1918;
968 --ce-surface: #232221;
969 --ce-surface-hover: #2e2d2b;
970 --ce-border: #3a3936;
971 --ce-border-subtle: #2e2d2b;
972 --ce-text: #e8e6dc;
973 --ce-text-2: #c4c2b8;
974 --ce-text-3: #9c9a92;
975 --ce-text-4: #73726c;
976 --ce-text-5: #5e5d59;
977 --ce-sep: #4a4946;
978 --ce-code-header: #2e2d2b;
979 --ce-code-bg: #0d0d0c;
980 --ce-arrow-hover: rgba(255,255,255,0.08);
981 --ce-badge-committed: #6fa85c;
982 --ce-badge-gitignored: #e08a60;
983 --ce-badge-local: #9c9a92;
984 --ce-badge-autogen: #e8a45c;
985 --ce-when-text: #8bb4e0;
986 }
987 .ce-mobile-fallback { display: none; border: 1px solid rgba(0,0,0,0.1); background: rgba(0,0,0,0.03); }
988 .dark .ce-mobile-fallback { border-color: rgba(255,255,255,0.15); background: rgba(255,255,255,0.04); }
989 @media (max-width: 700px) {
990 .ce-root:not(.ce-force) { display: none !important; }
991 .ce-mobile-fallback { display: block; }
992 }
993 `}</style>
994 {!forceMobile && <div className="ce-mobile-fallback" style={{
995 padding: '14px 16px',
996 borderRadius: '8px',
997 fontSize: '14px'
998 }}>
999 The interactive explorer works best on a larger screen. See the <a href="#file-reference" style={{
1000 color: '#D97757'
1001 }}>file reference table</a> below, or <button onClick={() => setForceMobile(true)} style={{
1002 border: 'none',
1003 background: 'none',
1004 padding: 0,
1005 color: '#D97757',
1006 textDecoration: 'underline',
1007 cursor: 'pointer',
1008 font: 'inherit'
1009 }}>show the explorer anyway</button>.
1010 </div>}
1011 <div ref={rootRef} className={forceMobile ? 'ce-root ce-force' : 'ce-root'} style={{
1012 borderRadius: isFullscreen ? 0 : '12px',
1013 border: '1px solid var(--ce-border)',
1014 background: 'var(--ce-bg)',
1015 display: 'flex',
1016 alignItems: 'stretch',
1017 overflow: 'hidden',
1018 fontFamily: 'var(--font-sans, -apple-system, sans-serif)',
1019 ...isFullscreen && ({
1020 height: '100vh'
1021 })
1022 }}>
1023 {}
1024 <div style={{
1025 width: 'min(240px, 35%)',
1026 minWidth: '180px',
1027 flexShrink: 0,
1028 borderRight: '1px solid var(--ce-border-subtle)',
1029 background: 'var(--ce-surface)',
1030 display: 'flex',
1031 flexDirection: 'column'
1032 }}>
1033 <div style={{
1034 padding: '8px 8px 4px',
1035 borderBottom: '1px solid var(--ce-border-subtle)',
1036 display: 'flex',
1037 gap: '4px'
1038 }}>
1039 {['project', 'global'].map(root => <button key={root} onClick={() => switchRoot(root)} style={{
1040 flex: 1,
1041 padding: '6px 0',
1042 borderRadius: '6px',
1043 border: 'none',
1044 cursor: 'pointer',
1045 fontFamily: 'var(--ce-mono)',
1046 fontSize: '11.5px',
1047 background: activeRoot === root ? 'var(--ce-accent-bg)' : 'transparent',
1048 color: activeRoot === root ? 'var(--ce-accent)' : 'var(--ce-text-4)',
1049 fontWeight: activeRoot === root ? 600 : 430
1050 }}>
1051 {root === 'project' ? 'Project' : 'Global (~/)'}
1052 </button>)}
1053 <button onClick={toggleAllFolders} title={allExpanded ? 'Collapse all' : 'Expand all'} style={{
1054 ...iconBtn,
1055 fontSize: 11
1056 }}>
1057 {allExpanded ? '⊟' : '⊞'}
1058 </button>
1059 <button onClick={toggleFullscreen} title={isFullscreen ? 'Exit fullscreen' : 'Fullscreen'} style={{
1060 ...iconBtn,
1061 fontSize: 13
1062 }}>
1063 {isFullscreen ? '⤡' : '⛶'}
1064 </button>
1065 </div>
1066 <div role="tree" aria-label="Configuration files" tabIndex={0} onKeyDown={onTreeKeyDown} style={{
1067 padding: '6px 0',
1068 overflowY: 'auto',
1069 flex: 1,
1070 outline: 'none'
1071 }}>
1072 {tree.children.map(node => renderNode(node, 0))}
1073 </div>
1074 </div>
1075
1076 {}
1077 <div style={{
1078 flex: 1,
1079 minWidth: 0,
1080 padding: '20px 24px',
1081 minHeight: '400px',
1082 overflowY: 'auto'
1083 }}>
1084 <span aria-live="polite" style={{
1085 position: 'absolute',
1086 width: 1,
1087 height: 1,
1088 overflow: 'hidden',
1089 clip: 'rect(0 0 0 0)'
1090 }}>{selected.label} selected</span>
1091 {}
1092 <div style={{
1093 fontFamily: 'var(--ce-mono)',
1094 fontSize: '11px',
1095 color: 'var(--ce-text-4)',
1096 marginBottom: '10px',
1097 cursor: 'default'
1098 }}>
1099 {selected.path.map((seg, i) => <span key={i}>
1100 <span style={{
1101 color: i === selected.path.length - 1 ? 'var(--ce-accent)' : 'var(--ce-text-4)'
1102 }}>{seg.replace(/\/$/, '')}</span>
1103 {i < selected.path.length - 1 && <span style={{
1104 color: 'var(--ce-sep)'
1105 }}> / </span>}
1106 </span>)}
1107 </div>
1108
1109 {}
1110 <div style={{
1111 display: 'flex',
1112 alignItems: 'flex-start',
1113 gap: '10px',
1114 marginBottom: '10px'
1115 }}>
1116 <span style={{
1117 flexShrink: 0,
1118 display: 'flex'
1119 }}>{renderIcon(selected.icon, selected.color, 24)}</span>
1120 <div style={{
1121 flex: 1,
1122 minWidth: 0
1123 }}>
1124 <div style={{
1125 fontSize: '22px',
1126 fontWeight: 600,
1127 color: 'var(--ce-text)',
1128 letterSpacing: '-0.3px',
1129 lineHeight: '26px'
1130 }}>{selected.label}</div>
1131 {selected.oneLiner && <div style={{
1132 fontSize: '15px',
1133 color: 'var(--ce-text-3)',
1134 marginTop: '3px'
1135 }}>{selected.oneLiner}</div>}
1136 </div>
1137 <div style={{
1138 display: 'flex',
1139 gap: '4px',
1140 flexShrink: 0
1141 }}>
1142 {[selected.autogen && 'autogen', selected.badge].filter(Boolean).map(k => {
1143 const s = BADGE_STYLES[k];
1144 if (!s) return null;
1145 return <span key={k} style={{
1146 fontFamily: 'var(--ce-mono)',
1147 fontSize: '10px',
1148 fontWeight: 600,
1149 textTransform: 'uppercase',
1150 letterSpacing: '0.3px',
1151 padding: '2px 6px',
1152 borderRadius: '4px',
1153 background: s.bg,
1154 color: s.color,
1155 border: `0.5px solid ${s.border}`
1156 }}>{s.label}</span>;
1157 })}
1158 </div>
1159 </div>
1160
1161 {}
1162 {selected.note && <div style={{
1163 padding: '10px 12px',
1164 borderRadius: '8px',
1165 marginBottom: '14px',
1166 background: 'rgba(217,119,87,0.06)',
1167 border: '1px solid rgba(217,119,87,0.2)',
1168 borderLeft: '3px solid var(--ce-accent)',
1169 fontSize: '15px',
1170 color: 'var(--ce-text-2)',
1171 lineHeight: 1.6
1172 }}>
1173 {selected.note}
1174 </div>}
1175
1176 {}
1177 {selected.when && <div style={{
1178 padding: '8px 12px',
1179 borderRadius: '6px',
1180 background: 'rgba(106,155,204,0.06)',
1181 border: '0.5px solid rgba(106,155,204,0.12)',
1182 fontSize: '15px',
1183 color: 'var(--ce-when-text)',
1184 marginBottom: '16px'
1185 }}>
1186 <div style={{
1187 fontSize: '10px',
1188 fontWeight: 700,
1189 textTransform: 'uppercase',
1190 letterSpacing: '0.4px',
1191 opacity: 0.65,
1192 marginBottom: '3px'
1193 }}>When it loads</div>
1194 <div style={{
1195 fontWeight: 500
1196 }}>{selected.when}</div>
1197 </div>}
1198
1199 {}
1200 {selected.description && <div style={{
1201 fontSize: '16px',
1202 color: 'var(--ce-text-2)',
1203 lineHeight: 1.65,
1204 marginBottom: '16px'
1205 }}>
1206 {Array.isArray(selected.description) ? selected.description.map((para, i) => <div key={i} style={{
1207 marginBottom: i < selected.description.length - 1 ? '12px' : 0
1208 }}>{para}</div>) : selected.description}
1209 </div>}
1210
1211 {}
1212 {selected.contains && selected.contains.length > 0 && <div style={{
1213 marginBottom: '16px'
1214 }}>
1215 <div style={{
1216 fontSize: '11px',
1217 fontWeight: 700,
1218 color: 'var(--ce-text-4)',
1219 textTransform: 'uppercase',
1220 letterSpacing: '0.4px',
1221 marginBottom: '8px'
1222 }}>Common keys</div>
1223 {selected.contains.map((item, i) => <div key={i} style={{
1224 display: 'flex',
1225 gap: '7px',
1226 fontSize: '15px',
1227 color: 'var(--ce-text-2)',
1228 lineHeight: 1.5,
1229 marginBottom: '5px'
1230 }}>
1231 <span style={{
1232 fontSize: '7px',
1233 color: 'var(--ce-text-4)',
1234 marginTop: '6px'
1235 }}>●</span>
1236 <span>{item}</span>
1237 </div>)}
1238 </div>}
1239
1240 {}
1241 {selected.tips && selected.tips.length > 0 && <div style={{
1242 padding: '12px 14px',
1243 borderRadius: '8px',
1244 background: 'var(--ce-surface)',
1245 border: '1px solid var(--ce-border-subtle)',
1246 marginBottom: '16px'
1247 }}>
1248 <div style={{
1249 fontSize: '11px',
1250 fontWeight: 700,
1251 color: 'var(--ce-accent)',
1252 textTransform: 'uppercase',
1253 letterSpacing: '0.4px',
1254 marginBottom: '6px'
1255 }}>Tips</div>
1256 {selected.tips.map((tip, i) => <div key={i} style={{
1257 display: 'flex',
1258 gap: '7px',
1259 fontSize: '14.5px',
1260 color: 'var(--ce-text-2)',
1261 marginBottom: i < selected.tips.length - 1 ? '5px' : 0
1262 }}>
1263 <span style={{
1264 fontSize: '7px',
1265 color: 'var(--ce-accent)',
1266 marginTop: '6px'
1267 }}>●</span>
1268 <span>{tip}</span>
1269 </div>)}
1270 </div>}
1271
1272 {}
1273 {selected.example && <div style={{
1274 marginBottom: '16px'
1275 }}>
1276 {selected.exampleIntro && <div style={{
1277 fontSize: '15px',
1278 color: 'var(--ce-text-2)',
1279 lineHeight: 1.6,
1280 marginBottom: '10px'
1281 }}>
1282 {selected.exampleIntro}
1283 </div>}
1284 <div style={{
1285 display: 'flex',
1286 justifyContent: 'space-between',
1287 alignItems: 'center',
1288 padding: '6px 10px',
1289 background: 'var(--ce-code-header)',
1290 border: '1px solid var(--ce-border)',
1291 borderRadius: '8px 8px 0 0'
1292 }}>
1293 <span style={{
1294 fontFamily: 'var(--ce-mono)',
1295 fontSize: '11px',
1296 fontWeight: 600,
1297 color: 'var(--ce-text-3)'
1298 }}>{selected.label}</span>
1299 <button onClick={() => copyExample(selected.id, selected.example)} style={{
1300 padding: '3px 8px',
1301 borderRadius: '4px',
1302 fontSize: '11px',
1303 fontWeight: 600,
1304 cursor: 'pointer',
1305 transition: 'all 0.15s',
1306 background: isCopied ? 'rgba(85,138,66,0.08)' : 'var(--ce-code-header)',
1307 border: isCopied ? '0.5px solid rgba(85,138,66,0.2)' : '0.5px solid var(--ce-border)',
1308 color: isCopied ? '#558A42' : 'var(--ce-text-3)'
1309 }}>
1310 {isCopied ? '✓ Copied' : 'Copy'}
1311 </button>
1312 </div>
1313 <pre style={{
1314 margin: 0,
1315 padding: '12px 14px',
1316 background: 'var(--ce-code-bg)',
1317 color: '#E8E6DC',
1318 fontFamily: 'var(--ce-mono)',
1319 fontSize: '13px',
1320 lineHeight: 1.65,
1321 borderRadius: '0 0 8px 8px',
1322 overflowX: 'auto',
1323 whiteSpace: 'pre'
1324 }}>{selected.example}</pre>
1325 </div>}
1326
1327 {}
1328 {selected.docsLink && <a href={selected.docsLink} style={{
1329 display: 'inline-flex',
1330 padding: '5px 12px',
1331 borderRadius: '6px',
1332 background: 'var(--ce-accent-bg)',
1333 border: '1px solid var(--ce-accent-border)',
1334 color: 'var(--ce-accent)',
1335 fontSize: '12px',
1336 fontWeight: 600,
1337 textDecoration: 'none'
1338 }}>Full docs →</a>}
1339
1340 {}
1341 {selected.children && selected.children.length > 0 && <div style={{
1342 marginTop: '20px'
1343 }}>
1344 <div style={{
1345 fontSize: '11px',
1346 fontWeight: 700,
1347 color: 'var(--ce-text-4)',
1348 textTransform: 'uppercase',
1349 letterSpacing: '0.4px',
1350 marginBottom: '8px'
1351 }}>Contents</div>
1352 <div style={{
1353 display: 'flex',
1354 flexDirection: 'column',
1355 gap: '4px'
1356 }}>
1357 {selected.children.map(child => <button key={child.id} onClick={() => selectNode(child)} style={{
1358 display: 'flex',
1359 alignItems: 'center',
1360 gap: '8px',
1361 padding: '6px 8px',
1362 width: '100%',
1363 background: 'var(--ce-surface)',
1364 borderRadius: '6px',
1365 border: 'none',
1366 cursor: 'pointer',
1367 textAlign: 'left',
1368 transition: 'background 0.1s'
1369 }} onMouseEnter={e => e.currentTarget.style.background = 'var(--ce-surface-hover)'} onMouseLeave={e => e.currentTarget.style.background = 'var(--ce-surface)'}>
1370 {renderIcon(child.icon, child.color, 13)}
1371 <span style={{
1372 fontFamily: 'var(--ce-mono)',
1373 fontSize: '12px',
1374 color: 'var(--ce-text-2)'
1375 }}>{child.label}</span>
1376 {child.oneLiner && <span style={{
1377 fontSize: '11px',
1378 color: 'var(--ce-text-4)',
1379 overflow: 'hidden',
1380 textOverflow: 'ellipsis',
1381 whiteSpace: 'nowrap'
1382 }}>{child.oneLiner}</span>}
1383 </button>)}
1384 </div>
1385 </div>}
1386 </div>
1387 </div>
1388 </>;
1389};
1390
1391Claude Code reads instructions, settings, skills, subagents, and memory from your project directory and from `~/.claude` in your home directory. Commit project files to git to share them with your team; files in `~/.claude` are personal configuration that applies across all your projects.
1392
1393Most users only edit `CLAUDE.md` and `settings.json`. The rest of the directory is optional: add skills, rules, or subagents as you need them.
1394
1395This page is an interactive explorer: click files in the tree to see what each one does, when it loads, and an example. For a quick reference, see the [file reference table](#file-reference) below.
1396
1397<ClaudeExplorer />
1398
1399## What's not shown
1400
1401The explorer covers the files you'll interact with most. A few things live elsewhere:
1402
1403| File | Location | Purpose |
1404| ----------------------- | -------------------------- | --------------------------------------------------------------------------------------------------------------------- |
1405| `managed-settings.json` | System-level, varies by OS | Enterprise-enforced settings that you can't override. See [server-managed settings](/en/server-managed-settings). |
1406| `CLAUDE.local.md` | Project root | Your private preferences for this project, loaded alongside CLAUDE.md. Create it manually and add it to `.gitignore`. |
1407
1408## File reference
1409
1410This table lists every file the explorer covers. Project-scope files live in your repo under `.claude/` (or at the root for `CLAUDE.md`, `.mcp.json`, and `.worktreeinclude`). Global-scope files live in `~/.claude/` and apply across all projects.
1411
1412<Note>
1413 Several things can override what you put in these files:
1414
1415 * [Managed settings](/en/server-managed-settings) deployed by your organization take precedence over everything
1416 * CLI flags like `--permission-mode` or `--settings` override `settings.json` for that session
1417 * Some environment variables take precedence over their equivalent setting, but this varies: check the [environment variables reference](/en/env-vars) for each one
1418
1419 See [settings precedence](/en/settings#settings-precedence) for the full order.
1420</Note>
1421
1422Click a filename to open that node in the explorer above.
1423
1424| File | Scope | Commit | What it does | Reference |
1425| --------------------------------------------------- | ------------------ | ------ | ----------------------------------------------------- | -------------------------------------------------------------------- |
1426| [`CLAUDE.md`](#ce-claude-md) | Project and global | ✓ | Instructions loaded every session | [Memory](/en/memory) |
1427| [`rules/*.md`](#ce-rules) | Project and global | ✓ | Topic-scoped instructions, optionally path-gated | [Rules](/en/memory#organize-rules-with-claude/rules/) |
1428| [`settings.json`](#ce-settings-json) | Project and global | ✓ | Permissions, hooks, env vars, model defaults | [Settings](/en/settings) |
1429| [`settings.local.json`](#ce-settings-local-json) | Project only | | Your personal overrides, auto-gitignored | [Settings scopes](/en/settings#settings-files) |
1430| [`.mcp.json`](#ce-mcp-json) | Project only | ✓ | Team-shared MCP servers | [MCP scopes](/en/mcp#mcp-installation-scopes) |
1431| [`.worktreeinclude`](#ce-worktreeinclude) | Project only | ✓ | Gitignored files to copy into new worktrees | [Worktrees](/en/common-workflows#copy-gitignored-files-to-worktrees) |
1432| [`skills/<name>/SKILL.md`](#ce-skills) | Project and global | ✓ | Reusable prompts invoked with `/name` or auto-invoked | [Skills](/en/skills) |
1433| [`commands/*.md`](#ce-commands) | Project and global | ✓ | Single-file prompts; same mechanism as skills | [Skills](/en/skills) |
1434| [`output-styles/*.md`](#ce-output-styles) | Project and global | ✓ | Custom system-prompt sections | [Output styles](/en/output-styles) |
1435| [`agents/*.md`](#ce-agents) | Project and global | ✓ | Subagent definitions with their own prompt and tools | [Subagents](/en/sub-agents) |
1436| [`agent-memory/<name>/`](#ce-agent-memory) | Project and global | ✓ | Persistent memory for subagents | [Persistent memory](/en/sub-agents#enable-persistent-memory) |
1437| [`~/.claude.json`](#ce-claude-json) | Global only | | App state, OAuth, UI toggles, personal MCP servers | [Global config](/en/settings#global-config-settings) |
1438| [`projects/<project>/memory/`](#ce-global-projects) | Global only | | Auto memory: Claude's notes to itself across sessions | [Auto memory](/en/memory#auto-memory) |
1439| [`keybindings.json`](#ce-keybindings) | Global only | | Custom keyboard shortcuts | [Keybindings](/en/keybindings) |
1440
1441## Check what loaded
1442
1443The explorer shows what files can exist. To see what actually loaded in your current session, use these commands:
1444
1445| Command | Shows |
1446| -------------- | ------------------------------------------------------------------------------------- |
1447| `/context` | Token usage by category: system prompt, memory files, skills, MCP tools, and messages |
1448| `/memory` | Which CLAUDE.md and rules files loaded, plus auto-memory entries |
1449| `/agents` | Configured subagents and their settings |
1450| `/hooks` | Active hook configurations |
1451| `/mcp` | Connected MCP servers and their status |
1452| `/skills` | Available skills from project, user, and plugin sources |
1453| `/permissions` | Current allow and deny rules |
1454| `/doctor` | Installation and configuration diagnostics |
1455
1456Run `/context` first for the overview, then the specific command for the area you want to investigate.
1457
1458## Related resources
1459
1460* [Manage Claude's memory](/en/memory): write and organize CLAUDE.md, rules, and auto memory
1461* [Configure settings](/en/settings): set permissions, hooks, environment variables, and model defaults
1462* [Create skills](/en/skills): build reusable prompts and workflows
1463* [Configure subagents](/en/sub-agents): define specialized agents with their own context