Explore the .claude directory

Tags

official-docs claude-code-cli

Content

Documentation Index

Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt Use this file to discover all available pages before exploring further.

Explore the .claude directory

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.

export const ClaudeExplorer = () => { const A = useMemo(() => ({href, children}) => {children}, []); const C = useMemo(() => ({children}) => {children}, []); const commandsNote = useMemo(() => <>Commands and skills are now the same mechanism. For new workflows, use skills/ instead: same /name invocation, plus you can bundle supporting files.</>, []); const FILE_TREE = useMemo(() => ({ project: { label: 'your-project/', children: [{ id: 'claude-md', label: 'CLAUDE.md', type: 'file', icon: 'md', color: '#6A9BCC', badge: 'committed', oneLiner: 'Project instructions Claude reads every session', when: 'Loaded into context at the start of every session', 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.', 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 skill or a path-scoped rule 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 /memory to open and edit CLAUDE.md from within a session</>, <>Also works at .claude/CLAUDE.md if you prefer to keep the project root clean</>], 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.', example: `# Project conventions

Commands

Stack

Rules

API credentials

config/secrets.json, docsLink: '/en/common-workflows#copy-gitignored-files-to-worktrees' }, { id: 'dot-claude', label: '.claude/', type: 'folder', icon: 'folder', color: 'var(--ce-accent)', oneLiner: 'Project-level configuration, rules, and extensions', 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.', children: [{ id: 'settings-json', label: 'settings.json', type: 'file', icon: 'json', color: 'var(--ce-text-3)', badge: 'committed', oneLiner: 'Permissions, hooks, and configuration', when: <>Overrides global <C>~/.claude/settings.json</C>. Local settings, CLI flags, and managed settings override this</>, 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.', 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/</>], 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</>], 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.</>, example:{ "permissions": { "allow": [ "Bash(npm test )", "Bash(npm run )" ], "deny": [ "Bash(rm -rf )" ] }, "hooks": { "PostToolUse": [{ "matcher": "Edit|Write", "hooks": [{ "type": "command", "command": "jq -r '.tool_input.file_path' | xargs npx prettier --write" }] }] } }, docsLink: '/en/settings' }, { id: 'settings-local-json', label: 'settings.local.json', type: 'file', icon: 'json', color: 'var(--ce-text-3)', badge: 'gitignored', oneLiner: 'Your personal settings overrides for this project', when: 'Highest of the user-editable settings files; CLI flags and managed settings still take precedence', 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.', 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></>], exampleIntro: 'This example adds Docker permissions on top of whatever the team settings.json allows.', example:{ "permissions": { "allow": [ "Bash(docker )" ] } }, docsLink: '/en/settings' }, { id: 'rules', label: 'rules/', type: 'folder', icon: 'folder', color: '#9B7BC4', oneLiner: 'Topic-scoped instructions, optionally gated by file paths', when: <>Rules without <C>paths:</C> load at session start. Rules with <C>paths:</C> load when a matching file enters context</>, 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>.</>], 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'], docsLink: '/en/memory#organize-rules-with-claude/rules/', children: [{ id: 'rule-testing', label: 'testing.md', type: 'file', icon: 'md', color: '#9B7BC4', badge: 'committed', oneLiner: 'Test conventions scoped to test files', when: <>Loaded when Claude reads a file matching the <C>paths:</C> globs below</>, 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.</>, example:--- paths: - "/*.test.ts" - "/*.test.tsx"


Testing Rules


API Design Rules


Diff to review

!`git diff $ARGUMENTS`

Audit the changes above for:

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

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

Report findings with severity ratings and remediation steps.}, { id: 'skill-checklist', label: 'checklist.md', type: 'file', icon: 'md', color: '#D4A843', badge: 'committed', oneLiner: 'Supporting file bundled with the skill', when: 'Claude reads it on demand while running the skill', 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.</>, example:# Security Review Checklist

Input Validation

Authentication


!`gh issue view $ARGUMENTS`

Investigate and fix the issue above.

  1. Trace the bug to its root cause
  2. Implement the fix
  3. Write or update tests
  4. Summarize what you changed and why}] }, { id: 'output-styles', label: 'output-styles/', type: 'folder', icon: 'folder', color: '#5AA7A7', oneLiner: 'Project-scoped output styles, if your team shares any', when: 'Applied at session start when selected via the outputStyle setting', 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.</>, docsLink: '/en/output-styles', children: [] }, { id: 'agents', label: 'agents/', type: 'folder', icon: 'folder', color: '#C46686', oneLiner: 'Specialized subagents with their own context window', when: 'Runs in its own context window when you or Claude invoke it', 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.', 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'], docsLink: '/en/sub-agents', children: [{ id: 'agent-reviewer', label: 'code-reviewer.md', type: 'file', icon: 'md', color: '#C46686', badge: 'committed', oneLiner: 'Subagent for isolated code review', when: 'Claude spawns it for review tasks, or you @-mention it from the autocomplete', 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.</>, example:--- name: code-reviewer description: Reviews code for correctness, security, and maintainability tools: Read, Grep, Glob

You are a senior code reviewer. Review for:

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

Every finding must include a concrete fix.}] }, { id: 'agent-memory', label: 'agent-memory/', type: 'folder', icon: 'folder', color: '#C46686', badge: 'committed', autogen: true, oneLiner: 'Subagent persistent memory, separate from your main session auto memory', when: 'First 200 lines (capped at 25KB) of MEMORY.md loaded into the subagent system prompt when it runs', 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.</>, 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</>], docsLink: '/en/sub-agents#enable-persistent-memory', children: [{ id: 'agent-memory-sub', label: '<agent-name>/', type: 'folder', icon: 'folder', color: '#C46686', autogen: true, children: [{ id: 'agent-memory-md', label: 'MEMORY.md', type: 'file', icon: 'md', color: '#C46686', badge: 'committed', autogen: true, oneLiner: 'The subagent writes and maintains this file automatically', when: 'Loaded into the subagent system prompt when the subagent starts', 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.</>, example:# code-reviewer memory

Patterns seen

Recurring issues

Project

Reference


Auth Token Issues

Database Connection Drops


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

When a change is under 10 lines, ask the user to implement it themselves by leaving a TODO(human) marker instead of writing it.}] }, { id: 'global-agents', label: 'agents/', type: 'folder', icon: 'folder', color: '#C46686', oneLiner: 'Personal subagents available in every project', when: 'Claude delegates or you @-mention in any project', description: 'Subagents defined here are available across all your projects. Same format as project agents.', docsLink: '/en/sub-agents', children: [] }, { id: 'global-agent-memory', label: 'agent-memory/', type: 'folder', icon: 'folder', color: '#C46686', autogen: true, oneLiner: <>Persistent memory for subagents with <C>memory: user</C></>, when: 'Loaded into the subagent system prompt when the subagent starts', 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.</>, docsLink: '/en/sub-agents#enable-persistent-memory', children: [] }] }] } }), []); const BADGE_STYLES = useMemo(() => ({ committed: { bg: 'rgba(85,138,66,0.08)', color: 'var(--ce-badge-committed)', border: 'rgba(85,138,66,0.15)', label: 'committed' }, gitignored: { bg: 'rgba(217,119,87,0.06)', color: 'var(--ce-badge-gitignored)', border: 'rgba(217,119,87,0.15)', label: 'gitignored' }, local: { bg: 'rgba(115,114,108,0.06)', color: 'var(--ce-badge-local)', border: 'rgba(115,114,108,0.12)', label: 'local only' }, autogen: { bg: 'rgba(232,164,92,0.1)', color: 'var(--ce-badge-autogen)', border: 'rgba(232,164,92,0.2)', label: 'Claude writes' } }), []); const allNodes = useMemo(() => { const flatten = (nodes, acc, path, parentId) => { for (const node of nodes) { const nextPath = [...path, node.label]; acc[node.id] = { ...node, path: nextPath, parentId }; if (node.children) flatten(node.children, acc, nextPath, node.id); } return acc; }; const project = flatten(FILE_TREE.project.children, {}, [FILE_TREE.project.label]); const global = flatten(FILE_TREE.global.children, {}, [FILE_TREE.global.label]); for (const id in project) project[id].root = 'project'; for (const id in global) global[id].root = 'global'; return { ...project, ...global }; }, [FILE_TREE]); const allFolderIds = useMemo(() => Object.keys(allNodes).filter(id => allNodes[id].type === 'folder'), [allNodes]); const DEFAULT_EXPANDED = ['dot-claude', 'rules', 'skills', 'skill-review', 'commands', 'agents', 'agent-memory', 'agent-memory-sub', 'global-dot-claude', 'global-output-styles', 'global-projects', 'memory-dir']; const [mounted, setMounted] = useState(false); const [activeRoot, setActiveRoot] = useState('project'); const [selectedId, setSelectedId] = useState('claude-md'); const [expandedFolders, setExpandedFolders] = useState(() => new Set(DEFAULT_EXPANDED)); const [forceMobile, setForceMobile] = useState(false); const [copiedId, setCopiedId] = useState(null); const [isFullscreen, setIsFullscreen] = useState(false); const copyTimeoutRef = useRef(null); const rootRef = useRef(null); useEffect(() => { setMounted(true); const applyHash = scroll => { const hash = window.location.hash.slice(1); if (!hash.startsWith('ce-')) return; const id = hash.slice(3); const node = allNodes[id]; if (!node) return; setActiveRoot(node.root); setSelectedId(id); setExpandedFolders(new Set(allFolderIds)); if (scroll && rootRef.current) rootRef.current.scrollIntoView({ behavior: 'smooth', block: 'start' }); }; applyHash(false); const onHashChange = () => applyHash(true); const onFsChange = () => setIsFullscreen(!!document.fullscreenElement); window.addEventListener('hashchange', onHashChange); document.addEventListener('fullscreenchange', onFsChange); return () => { if (copyTimeoutRef.current) clearTimeout(copyTimeoutRef.current); window.removeEventListener('hashchange', onHashChange); document.removeEventListener('fullscreenchange', onFsChange); }; }, []); useEffect(() => { if (!mounted || !rootRef.current) return; const hash = window.location.hash.slice(1); if (hash.startsWith('ce-') && allNodes[hash.slice(3)]) { rootRef.current.scrollIntoView({ behavior: 'smooth', block: 'start' }); } }, [mounted]); if (!mounted) return null; const selected = allNodes[selectedId]; const tree = FILE_TREE[activeRoot]; const isCopied = copiedId === selected.id; const toggleFolder = id => { const next = new Set(expandedFolders); next.has(id) ? next.delete(id) : next.add(id); setExpandedFolders(next); }; const switchRoot = root => { if (root === activeRoot) return; setActiveRoot(root); const firstId = FILE_TREE[root].children[0].id; setSelectedId(firstId); try { history.replaceState(null, '', '#ce-' + firstId); } catch (e) {} }; const toggleFullscreen = () => { if (!rootRef.current) return; if (document.fullscreenElement) document.exitFullscreen(); else rootRef.current.requestFullscreen().catch(() => {}); }; const selectNode = n => { setSelectedId(n.id); if (n.type === 'folder' && !expandedFolders.has(n.id)) toggleFolder(n.id); try { history.replaceState(null, '', '#ce-' + n.id); } catch (e) {} }; const iconBtn = { width: 28, flexShrink: 0, borderRadius: '6px', border: 'none', cursor: 'pointer', background: 'transparent', color: 'var(--ce-text-4)', display: 'flex', alignItems: 'center', justifyContent: 'center' }; const visibleFolderIds = allFolderIds.filter(id => allNodes[id].root === activeRoot); const allExpanded = visibleFolderIds.every(id => expandedFolders.has(id)); const toggleAllFolders = () => { const next = new Set(expandedFolders); visibleFolderIds.forEach(id => allExpanded ? next.delete(id) : next.add(id)); setExpandedFolders(next); }; const onTreeKeyDown = e => { if (!['ArrowDown', 'ArrowUp', 'ArrowRight', 'ArrowLeft'].includes(e.key)) return; const visible = []; const walk = nodes => { for (const n of nodes) { visible.push(n.id); if (n.children && expandedFolders.has(n.id)) walk(n.children); } }; walk(tree.children); const i = visible.indexOf(selectedId); if (i === -1) return; e.preventDefault(); if (e.key === 'ArrowDown' && i < visible.length - 1) selectNode(allNodes[visible[i + 1]]); else if (e.key === 'ArrowUp' && i > 0) selectNode(allNodes[visible[i - 1]]); else if (e.key === 'ArrowRight' && selected.type === 'folder') { if (!expandedFolders.has(selectedId)) toggleFolder(selectedId); else if (selected.children && selected.children.length) selectNode(allNodes[selected.children[0].id]); } else if (e.key === 'ArrowLeft') { if (selected.type === 'folder' && expandedFolders.has(selectedId)) toggleFolder(selectedId); else if (selected.parentId) selectNode(allNodes[selected.parentId]); } }; const copyExample = (id, text) => { const done = () => { setCopiedId(id); if (copyTimeoutRef.current) clearTimeout(copyTimeoutRef.current); copyTimeoutRef.current = setTimeout(() => setCopiedId(null), 2000); }; const fallback = () => { const ta = document.createElement('textarea'); ta.value = text; ta.style.position = 'fixed'; ta.style.opacity = '0'; document.body.appendChild(ta); ta.select(); try { if (document.execCommand('copy')) done(); } catch (e) {} document.body.removeChild(ta); }; if (navigator.clipboard) { navigator.clipboard.writeText(text).then(done, fallback); } else { fallback(); } }; const renderIcon = (icon, color, size) => { const sz = size || 14; if (icon === 'folder') { return <svg width={sz} height={sz} viewBox="0 0 14 14" fill="none"> <path d="M1.5 3.5a1 1 0 0 1 1-1h2.6l1 1.2h5.4a1 1 0 0 1 1 1v5.8a1 1 0 0 1-1 1h-9a1 1 0 0 1-1-1V3.5z" fill={color} fillOpacity="0.15" stroke={color} strokeWidth="1" /> </svg>; } if (icon === 'json') { return <svg width={sz} height={sz} viewBox="0 0 14 14" fill="none"> <rect x="2" y="1.5" width="10" height="11" rx="1.5" fill={color} fillOpacity="0.15" stroke={color} strokeWidth="1" /> <text x="7" y="9" fontSize="6" fontFamily="monospace" fill={color} textAnchor="middle" fontWeight="700">{'{}'}</text> </svg>; } return <svg width={sz} height={sz} viewBox="0 0 14 14" fill="none"> <rect x="2" y="1.5" width="10" height="11" rx="1.5" fill={color} fillOpacity="0.15" stroke={color} strokeWidth="1" /> <line x1="4.5" y1="5" x2="9.5" y2="5" stroke={color} strokeWidth="1" /> <line x1="4.5" y1="7" x2="9.5" y2="7" stroke={color} strokeWidth="1" /> <line x1="4.5" y1="9" x2="8" y2="9" stroke={color} strokeWidth="1" /> </svg>; }; const renderNode = (node, depth) => { const isFolder = node.type === 'folder'; const isExpanded = expandedFolders.has(node.id); const isSelected = selectedId === node.id; return <div key={node.id}> <button role="treeitem" tabIndex={-1} onClick={() => selectNode(node)} aria-selected={isSelected} aria-expanded={isFolder ? isExpanded : undefined} style={{ display: 'flex', alignItems: 'center', gap: '5px', width: '100%', padding:4px 8px 4px ${8 + depth * 16}px, background: isSelected ? 'var(--ce-accent-bg)' : 'transparent', borderTop: 'none', borderRight: 'none', borderBottom: 'none', borderLeft: isSelected ? '2px solid var(--ce-accent)' : '2px solid transparent', outline: 'none', cursor: 'pointer', textAlign: 'left', fontFamily: 'var(--ce-mono)', fontSize: '13.5px', color: isSelected ? 'var(--ce-accent)' : 'var(--ce-text-2)', fontWeight: isSelected ? 550 : 400, transition: 'all 0.1s' }}> {isFolder ? <span onClick={e => { e.stopPropagation(); toggleFolder(node.id); }} style={{ fontSize: '14px', color: 'var(--ce-text-4)', width: '20px', height: '20px', display: 'inline-flex', alignItems: 'center', justifyContent: 'center', cursor: 'pointer', borderRadius: '4px', marginLeft: '-6px', flexShrink: 0 }} onMouseEnter={e => { e.currentTarget.style.background = 'var(--ce-arrow-hover)'; e.currentTarget.style.color = 'var(--ce-text-2)'; }} onMouseLeave={e => { e.currentTarget.style.background = 'transparent'; e.currentTarget.style.color = 'var(--ce-text-4)'; }}>{isExpanded ? '▾' : '▸'}</span> : <span style={{ width: '14px', flexShrink: 0 }} />} {renderIcon(node.icon, node.color)} <span style={{ flex: 1, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{node.label}</span> {node.badge && BADGE_STYLES[node.badge] && <span title={BADGE_STYLES[node.badge].label} style={{ width: 6, height: 6, borderRadius: '50%', background: BADGE_STYLES[node.badge].color, flexShrink: 0, opacity: 0.7 }} />} </button> {isFolder && isExpanded && node.children && <div role="group">{node.children.map(child => renderNode(child, depth + 1))}</div>} </div>; }; return <> <style>{ .ce-root { --ce-mono: var(--font-mono, ui-monospace, monospace); --ce-accent: #D97757; --ce-accent-bg: rgba(217,119,87,0.06); --ce-accent-border: rgba(217,119,87,0.12); --ce-bg: #fff; --ce-surface: #FAFAF7; --ce-surface-hover: #F0EEE6; --ce-border: #E8E6DC; --ce-border-subtle: #F0EEE6; --ce-text: #141413; --ce-text-2: #5E5D59; --ce-text-3: #73726C; --ce-text-4: #9C9A92; --ce-text-5: #B8B6AE; --ce-sep: #D1CFC5; --ce-code-header: #F5F4ED; --ce-code-bg: #1A1918; --ce-arrow-hover: rgba(0,0,0,0.08); --ce-badge-committed: #3d6b2e; --ce-badge-gitignored: #b85c3a; --ce-badge-local: #5e5d59; --ce-badge-autogen: #b07520; --ce-when-text: #4a7fb5; } .dark .ce-root { --ce-bg: #1a1918; --ce-surface: #232221; --ce-surface-hover: #2e2d2b; --ce-border: #3a3936; --ce-border-subtle: #2e2d2b; --ce-text: #e8e6dc; --ce-text-2: #c4c2b8; --ce-text-3: #9c9a92; --ce-text-4: #73726c; --ce-text-5: #5e5d59; --ce-sep: #4a4946; --ce-code-header: #2e2d2b; --ce-code-bg: #0d0d0c; --ce-arrow-hover: rgba(255,255,255,0.08); --ce-badge-committed: #6fa85c; --ce-badge-gitignored: #e08a60; --ce-badge-local: #9c9a92; --ce-badge-autogen: #e8a45c; --ce-when-text: #8bb4e0; } .ce-mobile-fallback { display: none; border: 1px solid rgba(0,0,0,0.1); background: rgba(0,0,0,0.03); } .dark .ce-mobile-fallback { border-color: rgba(255,255,255,0.15); background: rgba(255,255,255,0.04); } @media (max-width: 700px) { .ce-root:not(.ce-force) { display: none !important; } .ce-mobile-fallback { display: block; } } `} {!forceMobile &&

The interactive explorer works best on a larger screen. See the file reference table below, or .
}
{}
{['project', 'global'].map(root => )}
{tree.children.map(node => renderNode(node, 0))}

  {}
  <div style={{
flex: 1,
minWidth: 0,
padding: '20px 24px',
minHeight: '400px',
overflowY: 'auto'

}}> {selected.label} selected {}

{selected.path.map((seg, i) => {seg.replace(/\/$/, '')} {i < selected.path.length - 1 && / } )}

        {}
        <div style={{
display: 'flex',
alignItems: 'flex-start',
gap: '10px',
marginBottom: '10px'

}}> {renderIcon(selected.icon, selected.color, 24)}

{selected.label}
{selected.oneLiner &&
{selected.oneLiner}
}
{[selected.autogen && 'autogen', selected.badge].filter(Boolean).map(k => { const s = BADGE_STYLES[k]; if (!s) return null; return 0.5px solid ${s.border} }}>{s.label}; })}

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

}}> {selected.note} }

        {}
        {selected.when && <div style={{
padding: '8px 12px',
borderRadius: '6px',
background: 'rgba(106,155,204,0.06)',
border: '0.5px solid rgba(106,155,204,0.12)',
fontSize: '15px',
color: 'var(--ce-when-text)',
marginBottom: '16px'

}}>

When it loads
{selected.when}
}

        {}
        {selected.description && <div style={{
fontSize: '16px',
color: 'var(--ce-text-2)',
lineHeight: 1.65,
marginBottom: '16px'

}}> {Array.isArray(selected.description) ? selected.description.map((para, i) => <div key={i} style={{ marginBottom: i < selected.description.length - 1 ? '12px' : 0 }}>{para}) : selected.description} }

        {}
        {selected.contains && selected.contains.length > 0 && <div style={{
marginBottom: '16px'

}}>

Common keys
{selected.contains.map((item, i) =>
{item}
)} }

        {}
        {selected.tips && selected.tips.length > 0 && <div style={{
padding: '12px 14px',
borderRadius: '8px',
background: 'var(--ce-surface)',
border: '1px solid var(--ce-border-subtle)',
marginBottom: '16px'

}}>

Tips
{selected.tips.map((tip, i) => <div key={i} style={{ display: 'flex', gap: '7px', fontSize: '14.5px', color: 'var(--ce-text-2)', marginBottom: i < selected.tips.length - 1 ? '5px' : 0 }}> {tip} )} }

        {}
        {selected.example && <div style={{
marginBottom: '16px'

}}> {selected.exampleIntro &&

{selected.exampleIntro}
}
{selected.label}
{selected.example}
}

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

}}>Full docs →}

        {}
        {selected.children && selected.children.length > 0 && <div style={{
marginTop: '20px'

}}>

Contents
{selected.children.map(child => )}
} </>; };

Claude 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.

If you set CLAUDE_CONFIG_DIR, every ~/.claude path on this page lives under that directory instead.

Most users only edit CLAUDE.md and settings.json. The rest of the directory is optional: add skills, rules, or subagents as you need them.

This 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 below.

What's not shown

The explorer covers files you author and edit. A few related files live elsewhere:

File Location Purpose
managed-settings.json System-level, varies by OS Enterprise-enforced settings that you can't override. See server-managed settings.
CLAUDE.local.md Project root Your private preferences for this project, loaded alongside CLAUDE.md. Create it manually and add it to .gitignore.
Installed plugins ~/.claude/plugins/ Cloned marketplaces, installed plugin versions, and per-plugin data, managed by claude plugin commands. Orphaned versions are deleted 7 days after a plugin update or uninstall. See plugin caching.

~/.claude also holds data Claude Code writes as you work: transcripts, prompt history, file snapshots, caches, and logs. See application data below.

File reference

This 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.

Several things can override what you put in these files:

See settings precedence for the full order.

Click a filename to open that node in the explorer above.

File Scope Commit What it does Reference
CLAUDE.md Project and global Instructions loaded every session Memory
rules/*.md Project and global Topic-scoped instructions, optionally path-gated Rules
settings.json Project and global Permissions, hooks, env vars, model defaults Settings
settings.local.json Project only Your personal overrides, auto-gitignored Settings scopes
.mcp.json Project only Team-shared MCP servers MCP scopes
.worktreeinclude Project only Gitignored files to copy into new worktrees Worktrees
skills/<name>/SKILL.md Project and global Reusable prompts invoked with /name or auto-invoked Skills
commands/*.md Project and global Single-file prompts; same mechanism as skills Skills
output-styles/*.md Project and global Custom system-prompt sections Output styles
agents/*.md Project and global Subagent definitions with their own prompt and tools Subagents
agent-memory/<name>/ Project and global Persistent memory for subagents Persistent memory
~/.claude.json Global only App state, OAuth, UI toggles, personal MCP servers Global config
projects/<project>/memory/ Global only Auto memory: Claude's notes to itself across sessions Auto memory
keybindings.json Global only Custom keyboard shortcuts Keybindings

Check what loaded

The explorer shows what files can exist. To see what actually loaded in your current session, use these commands:

Command Shows
/context Token usage by category: system prompt, memory files, skills, MCP tools, and messages
/memory Which CLAUDE.md and rules files loaded, plus auto-memory entries
/agents Configured subagents and their settings
/hooks Active hook configurations
/mcp Connected MCP servers and their status
/skills Available skills from project, user, and plugin sources
/permissions Current allow and deny rules
/doctor Installation and configuration diagnostics

Run /context first for the overview, then the specific command for the area you want to investigate.

Application data

Beyond the config you author, ~/.claude holds data Claude Code writes during sessions. These files are plaintext. Anything that passes through a tool lands in a transcript on disk: file contents, command output, pasted text.

Cleaned up automatically

Files in the paths below are deleted on startup once they're older than cleanupPeriodDays. The default is 30 days.

Path under ~/.claude/ Contents
projects/<project>/<session>.jsonl Full conversation transcript: every message, tool call, and tool result
projects/<project>/<session>/tool-results/ Large tool outputs spilled to separate files
file-history/<session>/ Pre-edit snapshots of files Claude changed, used for checkpoint restore
plans/ Plan files written during plan mode
debug/ Per-session debug logs, written only when you start with --debug or run /debug
paste-cache/, image-cache/ Contents of large pastes and attached images
session-env/ Per-session environment metadata

Kept until you delete them

The following paths are not covered by automatic cleanup and persist indefinitely.

Path under ~/.claude/ Contents
history.jsonl Every prompt you've typed, with timestamp and project path. Used for up-arrow recall.
stats-cache.json Aggregated token and cost counts shown by /cost
backups/ Timestamped copies of ~/.claude.json taken before config migrations
todos/ Legacy per-session task lists. No longer written by current versions; safe to delete.

shell-snapshots/ holds runtime files removed when the session exits cleanly. Other small cache and lock files appear depending on which features you use and are safe to delete.

Plaintext storage

Transcripts and history are not encrypted at rest. OS file permissions are the only protection. If a tool reads a .env file or a command prints a credential, that value is written to projects/<project>/<session>.jsonl. To reduce exposure:

Clear local data

You can delete any of the application-data paths above at any time. New sessions are unaffected. The table below shows what you lose for past sessions.

Delete You lose
~/.claude/projects/ Resume, continue, and rewind for past sessions
~/.claude/history.jsonl Up-arrow prompt recall
~/.claude/file-history/ Checkpoint restore for past sessions
~/.claude/stats-cache.json Historical totals shown by /cost
~/.claude/backups/ Rollback copies of ~/.claude.json from past config migrations
~/.claude/debug/, ~/.claude/plans/, ~/.claude/paste-cache/, ~/.claude/image-cache/, ~/.claude/session-env/ Nothing user-facing
~/.claude/todos/ Nothing. Legacy directory not written by current versions.

Don't delete ~/.claude.json, ~/.claude/settings.json, or ~/.claude/plugins/: those hold your auth, preferences, and installed plugins.