8 8
9Claude 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.9Claude 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.
10 10
11On Windows, `~/.claude` resolves to `%USERPROFILE%\.claude`. If you set [`CLAUDE_CONFIG_DIR`](/docs/en/env-vars), every `~/.claude` path on this page lives under that directory instead.11On Windows, `~/.claude` resolves to `%USERPROFILE%\.claude`. If you set [`CLAUDE_CONFIG_DIR`](https://code.claude.com/docs/en/env-vars), every `~/.claude` path on this page lives under that directory instead.
12 12
13Most users only edit `CLAUDE.md` and `settings.json`. If your repository already has an `AGENTS.md` for other coding agents, Claude Code [can read that](/docs/en/memory.md#agents-md) in place of a `CLAUDE.md`. The rest of the directory is optional: add skills, rules, or subagents as you need them.13Most users only edit `CLAUDE.md` and `settings.json`. If your repository already has an `AGENTS.md` for other coding agents, Claude Code [can read that](https://code.claude.com/docs/en/memory.md#agents-md) in place of a `CLAUDE.md`. The rest of the directory is optional: add skills, rules, or subagents as you need them.
14 14
15## Explore the directory15## Explore the directory
16 16
22 22
23| File | Location | Purpose |23| File | Location | Purpose |
24| - | - | - |24| - | - | - |
25| `managed-settings.json` | System-level, varies by OS | Enterprise-enforced settings that your own settings files and `--settings` values can't override, apart from [narrow exceptions](/docs/en/settings.md#exceptions-to-managed-settings-precedence). See [where to save the file](/docs/en/managed-settings.md#deploy-a-managed-settings-file) and [which managed source Claude Code uses](/docs/en/managed-settings.md#precedence-within-the-managed-tier). |25| `managed-settings.json` | System-level, varies by OS | Enterprise-enforced settings that your own settings files and `--settings` values can't override, apart from [narrow exceptions](https://code.claude.com/docs/en/settings.md#exceptions-to-managed-settings-precedence). See [where to save the file](https://code.claude.com/docs/en/managed-settings.md#deploy-a-managed-settings-file) and [which managed source Claude Code uses](https://code.claude.com/docs/en/managed-settings.md#precedence-within-the-managed-tier). |
26| `CLAUDE.local.md` | Project root | Your private preferences for this project, loaded alongside CLAUDE.md. Create it manually and add it to `.gitignore`. |26| `CLAUDE.local.md` | Project root | Your private preferences for this project, loaded alongside CLAUDE.md. Create it manually and add it to `.gitignore`. |
27| `AGENTS.md` | Project root, `.claude/`, or any directory | Project instructions you write for AI coding agents. Claude Code can [load it](/docs/en/memory.md#agents-md) in place of a `CLAUDE.md`. |27| `AGENTS.md` | Project root, `.claude/`, or any directory | Project instructions you write for AI coding agents. Claude Code can [load it](https://code.claude.com/docs/en/memory.md#agents-md) in place of a `CLAUDE.md`. |
28| Installed plugins | `~/.claude/plugins` | Cloned marketplaces, installed plugin versions, the `installed_plugins.json` install record, and per-plugin data, managed by `claude plugin` commands. Plugins [synced from your claude.ai account](/docs/en/plugins/loading.md#synced-plugins) download into `~/.claude/plugins/synced/`. For a plugin installed from a marketplace [`command` source](/docs/en/plugins/marketplace-reference#command-plugin-source) in link mode, Claude Code stores links here instead of a copy, and the plugin's files stay in the directory the command prints. A `command` source requires Claude Code v2.1.229 or later. A plugin listed by relative path in a marketplace you added from a local path also [loads in place](/docs/en/plugins/loading.md#find-plugins-on-disk) from its source directory rather than from a cache copy. See [plugin caching](/docs/en/plugins/loading.md#find-plugins-on-disk) for how orphaned versions are cleaned up. |28| Installed plugins | `~/.claude/plugins` | Cloned marketplaces, installed plugin versions, the `installed_plugins.json` install record, and per-plugin data, managed by `claude plugin` commands. Plugins [synced from your claude.ai account](https://code.claude.com/docs/en/plugins/loading.md#synced-plugins) download into `~/.claude/plugins/synced/`. For a plugin installed from a marketplace [`command` source](https://code.claude.com/docs/en/plugins/marketplace-reference#command-plugin-source) in link mode, Claude Code stores links here instead of a copy, and the plugin's files stay in the directory the command prints. A `command` source requires Claude Code v2.1.229 or later. A plugin listed by relative path in a marketplace you added from a local path also [loads in place](https://code.claude.com/docs/en/plugins/loading.md#find-plugins-on-disk) from its source directory rather than from a cache copy. See [plugin caching](https://code.claude.com/docs/en/plugins/loading.md#find-plugins-on-disk) for how orphaned versions are cleaned up. |
29 29
30`~/.claude` also holds data Claude Code writes as you work: transcripts, prompt history, file snapshots, caches, and logs. See [application data](#application-data) below.30`~/.claude` also holds data Claude Code writes as you work: transcripts, prompt history, file snapshots, caches, and logs. See [application data](#application-data) below.
31 31
35 35
36| You want to | Edit | Scope | Reference |36| You want to | Edit | Scope | Reference |
37| :- | :- | :- | :- |37| :- | :- | :- | :- |
38| Give Claude project context and conventions | `CLAUDE.md` | project or global | [Memory](/docs/en/memory.md) |38| Give Claude project context and conventions | `CLAUDE.md` | project or global | [Memory](https://code.claude.com/docs/en/memory.md) |
39| Allow or block specific tool calls | `settings.json` `permissions` or `hooks` | project or global | [Permissions](/docs/en/permissions.md), [Hooks](/docs/en/hooks.md) |39| Allow or block specific tool calls | `settings.json` `permissions` or `hooks` | project or global | [Permissions](https://code.claude.com/docs/en/permissions.md), [Hooks](https://code.claude.com/docs/en/hooks.md) |
40| Run a script before or after tool calls | `settings.json` `hooks` | project or global | [Hooks](/docs/en/hooks.md) |40| Run a script before or after tool calls | `settings.json` `hooks` | project or global | [Hooks](https://code.claude.com/docs/en/hooks.md) |
41| Set environment variables for the session | `settings.json` `env` | project or global | [Settings](/docs/en/settings-reference.md#all-settings) |41| Set environment variables for the session | `settings.json` `env` | project or global | [Settings](https://code.claude.com/docs/en/settings-reference.md#all-settings) |
42| Keep personal overrides out of git | `settings.local.json` | project only | [Settings scopes](/docs/en/settings.md#where-settings-live) |42| Keep personal overrides out of git | `settings.local.json` | project only | [Settings scopes](https://code.claude.com/docs/en/settings.md#where-settings-live) |
43| Add a prompt or capability you invoke with `/name` | `skills/<name>/SKILL.md` | project or global | [Skills](/docs/en/skills.md) |43| Add a prompt or capability you invoke with `/name` | `skills/<name>/SKILL.md` | project or global | [Skills](https://code.claude.com/docs/en/skills.md) |
44| Define a specialized subagent with its own tools | `agents/*.md` | project or global | [Subagents](/docs/en/sub-agents.md) |44| Define a specialized subagent with its own tools | `agents/*.md` | project or global | [Subagents](https://code.claude.com/docs/en/sub-agents.md) |
45| Orchestrate many subagents from a script | `workflows/*.js` | project or global | [Dynamic workflows](/docs/en/workflows.md) |45| Orchestrate many subagents from a script | `workflows/*.js` | project or global | [Dynamic workflows](https://code.claude.com/docs/en/workflows.md) |
46| Connect external tools over MCP | `.mcp.json` | project only | [MCP](/docs/en/mcp.md) |46| Connect external tools over MCP | `.mcp.json` | project only | [MCP](https://code.claude.com/docs/en/mcp.md) |
47| Change how Claude formats responses | `output-styles/*.md` | project or global | [Output styles](/docs/en/output-styles.md) |47| Change how Claude formats responses | `output-styles/*.md` | project or global | [Output styles](https://code.claude.com/docs/en/output-styles.md) |
48 48
49## File reference49## File reference
50 50
54>54>
55> Several things can override what you put in these files:55> Several things can override what you put in these files:
56>56>
57> * [Managed settings](/docs/en/server-managed-settings.md) deployed by your organization take precedence over every settings file and `--settings` value, apart from the [exceptions under Settings precedence](/docs/en/settings.md#exceptions-to-managed-settings-precedence)57> * [Managed settings](https://code.claude.com/docs/en/server-managed-settings.md) deployed by your organization take precedence over every settings file and `--settings` value, apart from the [exceptions under Settings precedence](https://code.claude.com/docs/en/settings.md#exceptions-to-managed-settings-precedence)
58> * CLI flags like `--permission-mode` or `--settings` override `settings.json` for that session58> * CLI flags like `--permission-mode` or `--settings` override `settings.json` for that session
59> * Some environment variables take precedence over their equivalent setting, but this varies: check the [environment variables reference](/docs/en/env-vars.md) for each one59> * Some environment variables take precedence over their equivalent setting, but this varies: check the [environment variables reference](https://code.claude.com/docs/en/env-vars.md) for each one
60>60>
61> See [settings precedence](/docs/en/settings.md#settings-precedence) for the full order.61> See [settings precedence](https://code.claude.com/docs/en/settings.md#settings-precedence) for the full order.
62 62
63Click a filename to open that node in the explorer above.63Click a filename to open that node in the explorer above.
64 64
65| File | Scope | Commit | What it does | Reference |65| File | Scope | Commit | What it does | Reference |
66| - | - | - | - | - |66| - | - | - | - | - |
67| [`CLAUDE.md`](#ce-claude-md) | Project and global | ✓ | Instructions loaded every session | [Memory](/docs/en/memory.md) |67| [`CLAUDE.md`](#ce-claude-md) | Project and global | ✓ | Instructions loaded every session | [Memory](https://code.claude.com/docs/en/memory.md) |
68| [`rules/*.md`](#ce-rules) | Project and global | ✓ | Topic-scoped instructions, optionally path-gated | [Rules](/docs/en/memory.md#organize-rules-with-claude/rules/) |68| [`rules/*.md`](#ce-rules) | Project and global | ✓ | Topic-scoped instructions, optionally path-gated | [Rules](https://code.claude.com/docs/en/memory.md#organize-rules-with-claude/rules/) |
69| [`settings.json`](#ce-settings-json) | Project and global | ✓ | Permissions, hooks, env vars, model defaults | [Settings](/docs/en/settings.md) |69| [`settings.json`](#ce-settings-json) | Project and global | ✓ | Permissions, hooks, env vars, model defaults | [Settings](https://code.claude.com/docs/en/settings.md) |
70| [`settings.local.json`](#ce-settings-local-json) | Project only | | Your personal overrides, gitignored when Claude Code saves a setting to it | [Settings scopes](/docs/en/settings.md#where-settings-live) |70| [`settings.local.json`](#ce-settings-local-json) | Project only | | Your personal overrides, gitignored when Claude Code saves a setting to it | [Settings scopes](https://code.claude.com/docs/en/settings.md#where-settings-live) |
71| [`.mcp.json`](#ce-mcp-json) | Project only | ✓ | Team-shared MCP servers | [MCP scopes](/docs/en/mcp.md#mcp-installation-scopes) |71| [`.mcp.json`](#ce-mcp-json) | Project only | ✓ | Team-shared MCP servers | [MCP scopes](https://code.claude.com/docs/en/mcp.md#mcp-installation-scopes) |
72| [`.worktreeinclude`](#ce-worktreeinclude) | Project only | ✓ | Gitignored files to copy into new worktrees | [Worktrees](/docs/en/worktrees.md#copy-gitignored-files-into-worktrees) |72| [`.worktreeinclude`](#ce-worktreeinclude) | Project only | ✓ | Gitignored files to copy into new worktrees | [Worktrees](https://code.claude.com/docs/en/worktrees.md#copy-gitignored-files-into-worktrees) |
73| [`skills/<name>/SKILL.md`](#ce-skills) | Project and global | ✓ | Reusable prompts invoked with `/name` or auto-invoked | [Skills](/docs/en/skills.md) |73| [`skills/<name>/SKILL.md`](#ce-skills) | Project and global | ✓ | Reusable prompts invoked with `/name` or auto-invoked | [Skills](https://code.claude.com/docs/en/skills.md) |
74| [`commands/*.md`](#ce-commands) | Project and global | ✓ | Single-file prompts; same mechanism as skills | [Skills](/docs/en/skills.md) |74| [`commands/*.md`](#ce-commands) | Project and global | ✓ | Single-file prompts; same mechanism as skills | [Skills](https://code.claude.com/docs/en/skills.md) |
75| [`output-styles/*.md`](#ce-output-styles) | Project and global | ✓ | Custom instruction sets that adjust how Claude works | [Output styles](/docs/en/output-styles.md) |75| [`output-styles/*.md`](#ce-output-styles) | Project and global | ✓ | Custom instruction sets that adjust how Claude works | [Output styles](https://code.claude.com/docs/en/output-styles.md) |
76| [`agents/*.md`](#ce-agents) | Project and global | ✓ | Subagent definitions with their own prompt and tools | [Subagents](/docs/en/sub-agents.md) |76| [`agents/*.md`](#ce-agents) | Project and global | ✓ | Subagent definitions with their own prompt and tools | [Subagents](https://code.claude.com/docs/en/sub-agents.md) |
77| [`workflows/*.js`](#ce-workflows) | Project and global | ✓ | Dynamic workflow scripts written by Claude and saved from `/workflows`; each file becomes a `/<name>` command | [Dynamic workflows](/docs/en/workflows.md) |77| [`workflows/*.js`](#ce-workflows) | Project and global | ✓ | Dynamic workflow scripts written by Claude and saved from `/workflows`; each file becomes a `/<name>` command | [Dynamic workflows](https://code.claude.com/docs/en/workflows.md) |
78| [`agent-memory/<name>/`](#ce-agent-memory) | Project and global | ✓ | Persistent memory for subagents | [Persistent memory](/docs/en/sub-agents.md#enable-persistent-memory) |78| [`agent-memory/<name>/`](#ce-agent-memory) | Project and global | ✓ | Persistent memory for subagents | [Persistent memory](https://code.claude.com/docs/en/sub-agents.md#enable-persistent-memory) |
79| [`~/.claude.json`](#ce-claude-json) | Global only | | App state, account details, UI toggles, personal MCP servers | [Global config](/docs/en/settings-reference.md#global-config-settings) |79| [`~/.claude.json`](#ce-claude-json) | Global only | | App state, account details, UI toggles, personal MCP servers | [Global config](https://code.claude.com/docs/en/settings-reference.md#global-config-settings) |
80| [`projects/<project>/memory/`](#ce-global-projects) | Global only | | Auto memory: Claude's notes to itself across sessions | [Auto memory](/docs/en/memory.md#auto-memory) |80| [`projects/<project>/memory/`](#ce-global-projects) | Global only | | Auto memory: Claude's notes to itself across sessions | [Auto memory](https://code.claude.com/docs/en/memory.md#auto-memory) |
81| [`keybindings.json`](#ce-keybindings) | Global only | | Custom keyboard shortcuts | [Keybindings](/docs/en/keybindings.md) |81| [`keybindings.json`](#ce-keybindings) | Global only | | Custom keyboard shortcuts | [Keybindings](https://code.claude.com/docs/en/keybindings.md) |
82| [`themes/*.json`](#ce-themes) | Global only | | Custom color themes | [Custom themes](/docs/en/terminal-config.md#create-a-custom-theme) |82| [`themes/*.json`](#ce-themes) | Global only | | Custom color themes | [Custom themes](https://code.claude.com/docs/en/terminal-config.md#create-a-custom-theme) |
83 83
84## Frontmatter fields by file84## Frontmatter fields by file
85 85
86Skills, command files, subagents, output styles, and rules read their configuration from YAML [frontmatter](/docs/en/glossary.md#frontmatter) at the top of the file, and each accepts its own set of fields. This table lists the field names for each file and links to the reference that describes them.86Skills, command files, subagents, output styles, and rules read their configuration from YAML [frontmatter](https://code.claude.com/docs/en/glossary.md#frontmatter) at the top of the file, and each accepts its own set of fields. This table lists the field names for each file and links to the reference that describes them.
87 87
88| File | Frontmatter fields | Reference |88| File | Frontmatter fields | Reference |
89| - | - | - |89| - | - | - |
90| `skills/<name>/SKILL.md` | `name`, `description`, `when_to_use`, `argument-hint`, `arguments`, `disable-model-invocation`, `user-invocable`, `allowed-tools`, `disallowed-tools`, `model`, `effort`, `context`, `agent`, `background`, `hooks`, `paths`, `shell`, `metadata`, `license`, `compatibility` | [Skill frontmatter](/docs/en/skills.md#frontmatter-reference) |90| `skills/<name>/SKILL.md` | `name`, `description`, `when_to_use`, `argument-hint`, `arguments`, `disable-model-invocation`, `user-invocable`, `allowed-tools`, `disallowed-tools`, `model`, `effort`, `context`, `agent`, `background`, `hooks`, `paths`, `shell`, `metadata`, `license`, `compatibility` | [Skill frontmatter](https://code.claude.com/docs/en/skills.md#frontmatter-reference) |
91| `commands/*.md` | The skill fields except `name` and `paths` | [Skill frontmatter](/docs/en/skills.md#frontmatter-reference) |91| `commands/*.md` | The skill fields except `name` and `paths` | [Skill frontmatter](https://code.claude.com/docs/en/skills.md#frontmatter-reference) |
92| `agents/*.md` | `name`, `description`, `tools`, `disallowedTools`, `model`, `permissionMode`, `maxTurns`, `autoCompactWindow`, `skills`, `mcpServers`, `hooks`, `memory`, `background`, `effort`, `isolation`, `color`, `initialPrompt`, `omitClaudeMd`, `experimental` | [Subagent frontmatter](/docs/en/sub-agents.md#supported-frontmatter-fields) |92| `agents/*.md` | `name`, `description`, `tools`, `disallowedTools`, `model`, `permissionMode`, `maxTurns`, `autoCompactWindow`, `skills`, `mcpServers`, `hooks`, `memory`, `background`, `effort`, `isolation`, `color`, `initialPrompt`, `omitClaudeMd`, `experimental` | [Subagent frontmatter](https://code.claude.com/docs/en/sub-agents.md#supported-frontmatter-fields) |
93| `output-styles/*.md` | `name`, `description`, `keep-coding-instructions`, `force-for-plugin` | [Output style frontmatter](/docs/en/output-styles.md#frontmatter) |93| `output-styles/*.md` | `name`, `description`, `keep-coding-instructions`, `force-for-plugin` | [Output style frontmatter](https://code.claude.com/docs/en/output-styles.md#frontmatter) |
94| `rules/*.md` | `paths` | [Rule frontmatter](/docs/en/memory.md#rules-frontmatter-reference) |94| `rules/*.md` | `paths` | [Rule frontmatter](https://code.claude.com/docs/en/memory.md#rules-frontmatter-reference) |
95 95
96Agents shipped in a [plugin](/docs/en/plugins/components.md#agents) honor a subset of the subagent fields.96Agents shipped in a [plugin](https://code.claude.com/docs/en/plugins/components.md#agents) honor a subset of the subagent fields.
97 97
98## Troubleshoot configuration98## Troubleshoot configuration
99 99
100If a setting, hook, or file isn't taking effect, see [Debug your configuration](/docs/en/debug-your-config.md) for the inspection commands and a symptom-first lookup table.100If a setting, hook, or file isn't taking effect, see [Debug your configuration](https://code.claude.com/docs/en/debug-your-config.md) for the inspection commands and a symptom-first lookup table.
101 101
102## Application data102## Application data
103 103
105 105
106### Cleaned up automatically106### Cleaned up automatically
107 107
108Claude Code deletes the files in the paths below once they're older than [`cleanupPeriodDays`](/docs/en/settings-reference#cleanupperioddays), as long as it can safely determine the retention period. The default is 30 days and the minimum is 1; setting `0` fails with a validation error. The same age cutoff applies to automatic removal of [orphaned worktrees](/docs/en/worktrees.md#clean-up-subagent-and-background-session-worktrees).108Claude Code deletes the files in the paths below once they're older than [`cleanupPeriodDays`](https://code.claude.com/docs/en/settings-reference#cleanupperioddays), as long as it can safely determine the retention period. The default is 30 days and the minimum is 1; setting `0` fails with a validation error. The same age cutoff applies to automatic removal of [orphaned worktrees](https://code.claude.com/docs/en/worktrees.md#clean-up-subagent-and-background-session-worktrees).
109 109
110| Path under `~/.claude/` | Contents |110| Path under `~/.claude/` | Contents |
111| - | - |111| - | - |
112| `projects/<project>/<session>.jsonl` | Full conversation transcript: every message, tool call, and tool result |112| `projects/<project>/<session>.jsonl` | Full conversation transcript: every message, tool call, and tool result |
113| `projects/<project>/<session>.orphaned-<timestamp>-<suffix>.jsonl`, `projects/<project>/<session>.jsonl.superseded-<timestamp>` | A previous transcript for the session that Claude Code set aside instead of overwriting or deleting it. It doesn't appear in the session picker |113| `projects/<project>/<session>.orphaned-<timestamp>-<suffix>.jsonl`, `projects/<project>/<session>.jsonl.superseded-<timestamp>` | A previous transcript for the session that Claude Code set aside instead of overwriting or deleting it. It doesn't appear in the session picker |
114| `projects/<project>/<session>/subagents/` | [Subagent](/docs/en/sub-agents.md) conversation transcripts, removed with the parent session transcript when it ages out |114| `projects/<project>/<session>/subagents/` | [Subagent](https://code.claude.com/docs/en/sub-agents.md) conversation transcripts, removed with the parent session transcript when it ages out |
115| `projects/<project>/<session>/tool-results/` | Large tool outputs spilled to separate files, and full-size copies of [images that MCP tools return](/docs/en/mcp.md#images-in-tool-results) |115| `projects/<project>/<session>/tool-results/` | Large tool outputs spilled to separate files, and full-size copies of [images that MCP tools return](https://code.claude.com/docs/en/mcp.md#images-in-tool-results) |
116| `file-history/<session>/` | Pre-edit snapshots of files Claude changed, used for [checkpoint restore](/docs/en/checkpointing.md). Holds snapshots for the 100 most recent checkpoints; snapshot files that no retained checkpoint references are deleted, except each file's first snapshot |116| `projects/<project>/<session>/mcp-tasks/` | What a resumed session needs to follow its running [MCP tasks](https://code.claude.com/docs/en/mcp.md#mcp-tasks-that-run-on-the-server) again, and the results of finished tasks that Claude hasn't read yet |
117| `plans/` | Plan files written during [plan mode](/docs/en/permission-modes.md#analyze-before-you-edit-with-plan-mode) |117| `file-history/<session>/` | Pre-edit snapshots of files Claude changed, used for [checkpoint restore](https://code.claude.com/docs/en/checkpointing.md). Holds snapshots for the 100 most recent checkpoints; snapshot files that no retained checkpoint references are deleted, except each file's first snapshot |
118| `debug/` | Per-session debug logs, written while debug logging is on, such as when you start with [`--debug`](/docs/en/cli-reference#cli-flags) or run `/debug` |118| `plans/` | Plan files written during [plan mode](https://code.claude.com/docs/en/permission-modes.md#analyze-before-you-edit-with-plan-mode) |
119| `debug/` | Per-session debug logs, written while debug logging is on, such as when you start with [`--debug`](https://code.claude.com/docs/en/cli-reference#cli-flags) or run `/debug` |
119| `paste-cache/` | Contents of large pastes |120| `paste-cache/` | Contents of large pastes |
120| `image-cache/<session>/` | Attached images saved by Claude Code v2.1.274 and earlier. Later versions save pasted and attached images outside `~/.claude`, in an `images/` directory for each session under the temp directory that [`CLAUDE_CODE_TMPDIR`](/docs/en/env-vars) controls. The sweep removes other sessions' leftover directories here, whatever their age. |121| `image-cache/<session>/` | Attached images saved by Claude Code v2.1.274 and earlier. Later versions save pasted and attached images outside `~/.claude`, in an `images/` directory for each session under the temp directory that [`CLAUDE_CODE_TMPDIR`](https://code.claude.com/docs/en/env-vars) controls. The sweep removes other sessions' leftover directories here, whatever their age. |
121| `uploads/<session>/` | Files you attach from the web or mobile app, and photos you attach from the mobile app, when messaging a [Remote Control](/docs/en/remote-control.md) session. An attachment to a [cloud session](/docs/en/claude-code-on-the-web.md) is saved in that session's own cloud environment instead, not on your machine. |122| `uploads/<session>/` | Files you attach from the web or mobile app, and photos you attach from the mobile app, when messaging a [Remote Control](https://code.claude.com/docs/en/remote-control.md) session. An attachment to a [cloud session](https://code.claude.com/docs/en/claude-code-on-the-web.md) is saved in that session's own cloud environment instead, not on your machine. |
122| `dev-mods/<session>/` | [Mods that Claude wrote](/docs/en/plugins/mods/create.md#ask-claude-for-a-mod) during the session |123| `dev-mods/<session>/` | [Mods that Claude wrote](https://code.claude.com/docs/en/plugins/mods/create.md#ask-claude-for-a-mod) during the session |
123| `session-env/` | Per-session environment metadata |124| `session-env/` | Per-session environment metadata |
124| `tasks/` | Task lists written by the task tools, one directory per list |125| `tasks/` | Task lists written by the task tools, one directory per list |
125| `shell-snapshots/` | Aliases, functions, and shell options captured at startup and applied by the [Bash tool](/docs/en/tools-reference.md#bash-tool-behavior) to each command. Removed on clean exit. The sweep clears any left after a crash. |126| `shell-snapshots/` | Aliases, functions, and shell options captured at startup and applied by the [Bash tool](https://code.claude.com/docs/en/tools-reference.md#bash-tool-behavior) to each command. Removed on clean exit. The sweep clears any left after a crash. |
126| `backups/` | Earlier versions of `~/.claude.json`, copied when Claude Code rewrites the file. Claude Code keeps the five newest, plus a copy of any version it couldn't parse. |127| `backups/` | Earlier versions of `~/.claude.json`, copied when Claude Code rewrites the file. Claude Code keeps the five newest, plus a copy of any version it couldn't parse. |
127| `feedback-bundles/` | Redacted transcript archives written by `/feedback` on third-party providers or when no Anthropic credentials are configured, for sending to your Anthropic account team |128| `feedback-bundles/` | Redacted transcript archives written by `/feedback` on third-party providers or when no Anthropic credentials are configured, for sending to your Anthropic account team |
128| `feedback/drafts/` | Queued [Claude-drafted feedback](/docs/en/tools-reference.md#sendfeedback-tool-behavior) awaiting your review in `/feedback`. Swept after `cleanupPeriodDays` or 30 days, whichever is shorter. When the queue is at its 10-draft limit, Claude Code deletes the oldest draft to make room. |129| `feedback/drafts/` | Queued [Claude-drafted feedback](https://code.claude.com/docs/en/tools-reference.md#sendfeedback-tool-behavior) awaiting your review in `/feedback`. Swept after `cleanupPeriodDays` or 30 days, whichever is shorter. When the queue is at its 10-draft limit, Claude Code deletes the oldest draft to make room. |
129| `usage-data/` | `report.html` and timestamped report copies written by [`/insights`](/docs/en/costs#analyze-your-usage-patterns), plus cached per-session analysis data used to build them |130| `usage-data/` | `report.html` and timestamped report copies written by [`/insights`](https://code.claude.com/docs/en/costs#analyze-your-usage-patterns), plus cached per-session analysis data used to build them |
130| `skills/.trash/`, `plugins/.trash/` | [Skills](/docs/en/skills.md#how-synced-skills-behave) and [plugins](/docs/en/plugins/loading.md#synced-plugins) that the claude.ai sync removed, such as after you turn one off on claude.ai or stop syncing. The files stay here so you can recover them until the sweep deletes them |131| `skills/.trash/`, `plugins/.trash/` | [Skills](https://code.claude.com/docs/en/skills.md#how-synced-skills-behave) and [plugins](https://code.claude.com/docs/en/plugins/loading.md#synced-plugins) that the claude.ai sync removed, such as after you turn one off on claude.ai or stop syncing. The files stay here so you can recover them until the sweep deletes them |
131| `plugins/installed_plugins.set-aside.<date>.<hash>.json`, `plugins/installed_plugins.unreadable.<date>.<hash>.kept` | Dated copies Claude Code makes before rewriting [`installed_plugins.json`](/docs/en/plugins/loading#find-plugins-on-disk): install records it dropped, and the contents of a file it couldn't read. |132| `plugins/installed_plugins.set-aside.<date>.<hash>.json`, `plugins/installed_plugins.unreadable.<date>.<hash>.kept` | Dated copies Claude Code makes before rewriting [`installed_plugins.json`](https://code.claude.com/docs/en/plugins/loading#find-plugins-on-disk): install records it dropped, and the contents of a file it couldn't read. |
132| `todos/`, `statsig/`, `logs/` | Legacy directories from older versions. No longer written. The sweep removes their contents and then the empty directory. |133| `todos/`, `statsig/`, `logs/` | Legacy directories from older versions. No longer written. The sweep removes their contents and then the empty directory. |
133 134
134Session files in `sessions/`, auto memory, and Claude Desktop and Cowork transcripts each follow their own retention rule:135Session files in `sessions/`, auto memory, and Claude Desktop and Cowork transcripts each follow their own retention rule:
135 136
136* **`sessions/`**: holds one small file per running session, used to detect concurrent sessions and crashes. It isn't part of the age-based sweep: Claude Code removes each file when its session exits and clears crash leftovers on the next launch.137* **`sessions/`**: holds one small file per running session, used to detect concurrent sessions and crashes. It isn't part of the age-based sweep: Claude Code removes each file when its session exits and clears crash leftovers on the next launch.
137* **Auto memory**: the sweep doesn't delete the memory files in a project's [auto memory](/docs/en/memory.md#auto-memory) directory, `projects/<project>/memory/`. Claude Code removes that directory only if it has been empty for the whole retention period. Before v2.1.228, the sweep treated folders inside the memory directory as session data and could delete old files beneath it.138* **Auto memory**: the sweep doesn't delete the memory files in a project's [auto memory](https://code.claude.com/docs/en/memory.md#auto-memory) directory, `projects/<project>/memory/`. Claude Code removes that directory only if it has been empty for the whole retention period. Before v2.1.228, the sweep treated folders inside the memory directory as session data and could delete old files beneath it.
138* **Claude Desktop and Cowork transcripts**: Claude Code keeps the transcript of a session you started or most recently continued in Claude Desktop or Cowork at any age. To give these transcripts an age limit, set [`desktopSessionCleanupPeriodDays`](/docs/en/settings-reference#desktopsessioncleanupperioddays). Requires Claude Code v2.1.248 or later; earlier versions delete them after `cleanupPeriodDays`.139* **Claude Desktop and Cowork transcripts**: Claude Code keeps the transcript of a session you started or most recently continued in Claude Desktop or Cowork at any age. To give these transcripts an age limit, set [`desktopSessionCleanupPeriodDays`](https://code.claude.com/docs/en/settings-reference#desktopsessioncleanupperioddays). Requires Claude Code v2.1.248 or later; earlier versions delete them after `cleanupPeriodDays`.
139 140
140 Claude Code deletes these transcripts after `cleanupPeriodDays` instead in either of these cases:141 Claude Code deletes these transcripts after `cleanupPeriodDays` instead in either of these cases:
141 142
142 * [Managed settings](/docs/en/managed-settings.md) set `cleanupPeriodDays`143 * [Managed settings](https://code.claude.com/docs/en/managed-settings.md) set `cleanupPeriodDays`
143 * The [HIPAA configuration applies to your sessions](/docs/en/hipaa-setup.md#check-how-developers-sign-in-and-connect)144 * The [HIPAA configuration applies to your sessions](https://code.claude.com/docs/en/hipaa-setup.md#check-how-developers-sign-in-and-connect)
144 145
145Claude Code skips the age-based sweep in these cases:146Claude Code skips the age-based sweep in these cases:
146 147
147* **Bare mode**: when you run `claude -p` with [`--bare`](/docs/en/headless#start-faster-with-bare-mode), Claude Code doesn't run the sweep in that session.148* **Bare mode**: when you run `claude -p` with [`--bare`](https://code.claude.com/docs/en/headless#start-faster-with-bare-mode), Claude Code doesn't run the sweep in that session.
148* **Paused sweep**: if Claude Code can't safely determine the retention period, it pauses the retention cleanup sweep; the [`retention_sweep` event](/docs/en/monitoring-usage#retention-sweep-event) lists each configuration that pauses it. When the cause is a settings file that can't be read or parsed, or settings errors with `cleanupPeriodDays` or `desktopSessionCleanupPeriodDays` explicitly set, Claude Code also shows a warning in `/status` until you fix the settings errors. When [managed settings](/docs/en/server-managed-settings.md) provide `cleanupPeriodDays`, Claude Code runs the sweep at the managed value in either case.149* **Paused sweep**: if Claude Code can't safely determine the retention period, it pauses the retention cleanup sweep; the [`retention_sweep` event](https://code.claude.com/docs/en/monitoring-usage#retention-sweep-event) lists each configuration that pauses it. When the cause is a settings file that can't be read or parsed, or settings errors with `cleanupPeriodDays` or `desktopSessionCleanupPeriodDays` explicitly set, Claude Code also shows a warning in `/status` until you fix the settings errors. When [managed settings](https://code.claude.com/docs/en/server-managed-settings.md) provide `cleanupPeriodDays`, Claude Code runs the sweep at the managed value in either case.
149 150
150To check that the machines in your organization run the sweep with the retention period you set, see [Check the retention sweep](/docs/en/monitoring-usage.md#check-the-retention-sweep).151To check that the machines in your organization run the sweep with the retention period you set, see [Check the retention sweep](https://code.claude.com/docs/en/monitoring-usage.md#check-the-retention-sweep).
151 152
152### Session scratchpad directory153### Session scratchpad directory
153 154
159* **Linux**: `/tmp/claude-<uid>/<project>/<session-id>/scratchpad/`, or the same shape under `$TMPDIR` when your system sets one160* **Linux**: `/tmp/claude-<uid>/<project>/<session-id>/scratchpad/`, or the same shape under `$TMPDIR` when your system sets one
160* **Windows**: `%TEMP%\claude\<project>\<session-id>\scratchpad\`161* **Windows**: `%TEMP%\claude\<project>\<session-id>\scratchpad\`
161 162
162`<project>` is your working directory path with every character other than letters and digits replaced by `-`, such as `-Users-you-my-project`. If you set [`CLAUDE_CODE_TMPDIR`](/docs/en/env-vars), the tree moves under that directory instead. Hooks receive the current session's path as [`scratchpad_dir`](/docs/en/hooks#common-input-fields).163`<project>` is your working directory path with every character other than letters and digits replaced by `-`, such as `-Users-you-my-project`. If you set [`CLAUDE_CODE_TMPDIR`](https://code.claude.com/docs/en/env-vars), the tree moves under that directory instead. Hooks receive the current session's path as [`scratchpad_dir`](https://code.claude.com/docs/en/hooks#common-input-fields).
163 164
164Scratchpad files last as long as the session's transcript: the [retention sweep](#cleaned-up-automatically) deletes the directory when it deletes the transcript, and [`claude purge`](#clear-local-data) doesn't touch the temp directory. Because the directory sits under the system temp location, your operating system can also clear it, such as on restart. To keep something Claude wrote there, ask Claude to move it into your project.165Scratchpad files last as long as the session's transcript: the [retention sweep](#cleaned-up-automatically) deletes the directory when it deletes the transcript, and [`claude purge`](#clear-local-data) doesn't touch the temp directory. Because the directory sits under the system temp location, your operating system can also clear it, such as on restart. To keep something Claude wrote there, ask Claude to move it into your project.
165 166
167 168
168* You're signed in with a claude.ai account rather than an API key169* You're signed in with a claude.ai account rather than an API key
169* The session uses the Anthropic API, not Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry170* The session uses the Anthropic API, not Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry
170* [`enableArtifact`](/docs/en/settings-reference#enableartifact) isn't set to `false`171* [`enableArtifact`](https://code.claude.com/docs/en/settings-reference#enableartifact) isn't set to `false`
171 172
172### Kept until you delete them173### Kept until you delete them
173 174
175 176
176| Path under `~/.claude/` | Contents |177| Path under `~/.claude/` | Contents |
177| - | - |178| - | - |
178| `history.jsonl` | Prompts you've typed, with timestamp and project path. Used for up-arrow recall, `Ctrl+R` history search, and `!` shell-command completion. Each sweep removes the entries older than `cleanupPeriodDays` when the [HIPAA configuration applies to your sessions](/docs/en/hipaa-setup.md#check-how-developers-sign-in-and-connect). |179| `history.jsonl` | Prompts you've typed, with timestamp and project path. Used for up-arrow recall, `Ctrl+R` history search, and `!` shell-command completion. Each sweep removes the entries older than `cleanupPeriodDays` when the [HIPAA configuration applies to your sessions](https://code.claude.com/docs/en/hipaa-setup.md#check-how-developers-sign-in-and-connect). |
179| `stats-cache.json` | Aggregated token and cost counts shown by `/usage` |180| `stats-cache.json` | Aggregated token and cost counts shown by `/usage` |
180| `remote-settings.json` | Cached copy of [server-managed settings](/docs/en/server-managed-settings.md) for your organization, or `{}` when your organization has configured none. Only present when the session [fetches them](/docs/en/server-managed-settings.md#platform-availability). Claude Code checks for updates at startup and hourly during a session. Claude Code deletes it when you log out. |181| `remote-settings.json` | Cached copy of [server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md) for your organization, or `{}` when your organization has configured none. Only present when the session [fetches them](https://code.claude.com/docs/en/server-managed-settings.md#platform-availability). Claude Code checks for updates at startup and hourly during a session. Claude Code deletes it when you log out. |
181| `cache/changelog.md` | Cached copy of the Claude Code changelog, shown by `/release-notes`. Refreshed in the background. |182| `cache/changelog.md` | Cached copy of the Claude Code changelog, shown by `/release-notes`. Refreshed in the background. |
182| `policy-limits.json` | Cached feature policy settings for your organization. Only present for some account types. Refreshed automatically. A `policy-limits.json.stamp.json` sidecar records which account or API key the cache belongs to. Claude Code deletes both files when you log out. |183| `policy-limits.json` | Cached feature policy settings for your organization. Only present for some account types. Refreshed automatically. A `policy-limits.json.stamp.json` sidecar records which account or API key the cache belongs to. Claude Code deletes both files when you log out. |
183 184
185 186
186Depending on which features you use, `~/.claude/` also holds files that the tables under [Application data](#application-data) don't list. Of those, caches and lock files are safe to delete. Keep these state files:187Depending on which features you use, `~/.claude/` also holds files that the tables under [Application data](#application-data) don't list. Of those, caches and lock files are safe to delete. Keep these state files:
187 188
188* `.credentials.json`: your [login credentials](/docs/en/authentication.md#credential-management)189* `.credentials.json`: your [login credentials](https://code.claude.com/docs/en/authentication.md#credential-management)
189* `agent-memory/`: [subagent memory](/docs/en/sub-agents.md#enable-persistent-memory)190* `agent-memory/`: [subagent memory](https://code.claude.com/docs/en/sub-agents.md#enable-persistent-memory)
190* `jobs/` and `daemon/`: [background session](/docs/en/agent-view.md#where-state-is-stored) state191* `jobs/` and `daemon/`: [background session](https://code.claude.com/docs/en/agent-view.md#where-state-is-stored) state
191 192
192### Plaintext storage193### Plaintext storage
193 194
194Transcripts 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:195Transcripts 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:
195 196
196* Lower `cleanupPeriodDays` to shorten how long Claude Code keeps transcripts197* Lower `cleanupPeriodDays` to shorten how long Claude Code keeps transcripts
197* Set [`desktopSessionCleanupPeriodDays`](/docs/en/settings-reference#desktopsessioncleanupperioddays) to give Claude Desktop and Cowork transcripts an age limit too198* Set [`desktopSessionCleanupPeriodDays`](https://code.claude.com/docs/en/settings-reference#desktopsessioncleanupperioddays) to give Claude Desktop and Cowork transcripts an age limit too
198* Set the [`CLAUDE_CODE_SKIP_PROMPT_HISTORY`](/docs/en/env-vars) environment variable to skip writing transcripts and prompt history in any mode. In non-interactive mode, you can instead pass `--no-session-persistence` alongside `-p`, or set `persistSession: false` in the TypeScript Agent SDK; the Python SDK has no equivalent option.199* Set the [`CLAUDE_CODE_SKIP_PROMPT_HISTORY`](https://code.claude.com/docs/en/env-vars) environment variable to skip writing transcripts and prompt history in any mode. In non-interactive mode, you can instead pass `--no-session-persistence` alongside `-p`, or set `persistSession: false` in the TypeScript Agent SDK; the Python SDK has no equivalent option.
199* Use [permission rules](/docs/en/permissions.md) to deny reads of credential files200* Use [permission rules](https://code.claude.com/docs/en/permissions.md) to deny reads of credential files
200 201
201### Clear local data202### Clear local data
202 203
259* Pass `--all` instead of a path to purge state for every project at once, which deletes `history.jsonl` outright rather than filtering it.260* Pass `--all` instead of a path to purge state for every project at once, which deletes `history.jsonl` outright rather than filtering it.
260* Pass `-i` to step through the deletion plan one item at a time.261* Pass `-i` to step through the deletion plan one item at a time.
261 262
262The command leaves `shell-snapshots/` and `backups/` alone because those are not project-scoped, and warns about them in the plan output. If anyone ran [`/heapdump`](/docs/en/troubleshooting#high-cpu-or-memory-usage) on the machine, delete the `.heapsnapshot` files it wrote too. A heap snapshot contains the full conversation and any credentials the process held, and neither the retention sweep nor the purge touches it.263The command leaves `shell-snapshots/` and `backups/` alone because those are not project-scoped, and warns about them in the plan output. If anyone ran [`/heapdump`](https://code.claude.com/docs/en/troubleshooting#high-cpu-or-memory-usage) on the machine, delete the `.heapsnapshot` files it wrote too. A heap snapshot contains the full conversation and any credentials the process held, and neither the retention sweep nor the purge touches it.
263 264
264You can also delete any of the application-data paths above yourself, apart from the [state files to keep](#state-files-to-keep).265You can also delete any of the application-data paths above yourself, apart from the [state files to keep](#state-files-to-keep).
265 266
267| - | - |268| - | - |
268| `~/.claude/projects/` | Resume, continue, and rewind for past sessions, and auto memory for every project |269| `~/.claude/projects/` | Resume, continue, and rewind for past sessions, and auto memory for every project |
269| `~/.claude/history.jsonl` | Up-arrow prompt recall, `Ctrl+R` history search, and `!` shell-command completion |270| `~/.claude/history.jsonl` | Up-arrow prompt recall, `Ctrl+R` history search, and `!` shell-command completion |
270| `~/.claude/paste-cache/` | Pasted text in recalled prompts; see [paste large content](/docs/en/terminal-config.md#paste-large-content) |271| `~/.claude/paste-cache/` | Pasted text in recalled prompts; see [paste large content](https://code.claude.com/docs/en/terminal-config.md#paste-large-content) |
271| `~/.claude/uploads/` | Attachments that past [Remote Control](/docs/en/remote-control.md) sessions refer to by path |272| `~/.claude/uploads/` | Attachments that past [Remote Control](https://code.claude.com/docs/en/remote-control.md) sessions refer to by path |
272| `~/.claude/file-history/` | Checkpoint restore for past sessions |273| `~/.claude/file-history/` | Checkpoint restore for past sessions |
273| `~/.claude/stats-cache.json` | Historical totals shown by `/usage` |274| `~/.claude/stats-cache.json` | Historical totals shown by `/usage` |
274| `~/.claude/usage-data/` | Past [`/insights`](/docs/en/costs#analyze-your-usage-patterns) reports and the cached analysis data used to build them |275| `~/.claude/usage-data/` | Past [`/insights`](https://code.claude.com/docs/en/costs#analyze-your-usage-patterns) reports and the cached analysis data used to build them |
275| `~/.claude/feedback-bundles/` | Feedback and bug-report archives you haven't yet sent to your Anthropic account team |276| `~/.claude/feedback-bundles/` | Feedback and bug-report archives you haven't yet sent to your Anthropic account team |
276| `~/.claude/feedback/drafts/` | [Claude-drafted feedback](/docs/en/tools-reference.md#sendfeedback-tool-behavior) you haven't sent |277| `~/.claude/feedback/drafts/` | [Claude-drafted feedback](https://code.claude.com/docs/en/tools-reference.md#sendfeedback-tool-behavior) you haven't sent |
277| `~/.claude/remote-settings.json` | Nothing. Re-fetched on next launch. |278| `~/.claude/remote-settings.json` | Nothing. Re-fetched on next launch. |
278| `~/.claude/cache/changelog.md` | Nothing. Refreshed in the background. |279| `~/.claude/cache/changelog.md` | Nothing. Refreshed in the background. |
279| `~/.claude/policy-limits.json` | Nothing. Refreshed automatically. |280| `~/.claude/policy-limits.json` | Nothing. Refreshed automatically. |
280| `~/.claude/tasks/` | Your [task lists](/docs/en/interactive-mode.md#task-list), including any still in use |281| `~/.claude/tasks/` | Your [task lists](https://code.claude.com/docs/en/interactive-mode.md#task-list), including any still in use |
281| `~/.claude/skills/.trash/`, `~/.claude/plugins/.trash/` | The chance to recover [synced skills](/docs/en/skills.md#how-synced-skills-behave) and [synced plugins](/docs/en/plugins/loading.md#synced-plugins) that Claude Code removed |282| `~/.claude/skills/.trash/`, `~/.claude/plugins/.trash/` | The chance to recover [synced skills](https://code.claude.com/docs/en/skills.md#how-synced-skills-behave) and [synced plugins](https://code.claude.com/docs/en/plugins/loading.md#synced-plugins) that Claude Code removed |
282| `~/.claude/plugins/installed_plugins.set-aside.<date>.<hash>.json`, `~/.claude/plugins/installed_plugins.unreadable.<date>.<hash>.kept` | The copies of plugin install records that Claude Code dropped or couldn't read. Nothing reads them back |283| `~/.claude/plugins/installed_plugins.set-aside.<date>.<hash>.json`, `~/.claude/plugins/installed_plugins.unreadable.<date>.<hash>.kept` | The copies of plugin install records that Claude Code dropped or couldn't read. Nothing reads them back |
283| `~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/session-env/`, `~/.claude/shell-snapshots/`, `~/.claude/backups/` | Nothing user-facing |284| `~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/session-env/`, `~/.claude/shell-snapshots/`, `~/.claude/backups/` | Nothing user-facing |
284| `~/.claude/todos/`, `~/.claude/statsig/`, `~/.claude/logs/`, `~/.claude/image-cache/` | Nothing. Legacy directories not written by current versions. |285| `~/.claude/todos/`, `~/.claude/statsig/`, `~/.claude/logs/`, `~/.claude/image-cache/` | Nothing. Legacy directories not written by current versions. |
287 288
288## Related resources289## Related resources
289 290
290* [Manage Claude's memory](/docs/en/memory.md): write and organize CLAUDE.md, rules, and auto memory291* [Manage Claude's memory](https://code.claude.com/docs/en/memory.md): write and organize CLAUDE.md, rules, and auto memory
291* [Configure settings](/docs/en/settings.md): set permissions, hooks, environment variables, and model defaults292* [Configure settings](https://code.claude.com/docs/en/settings.md): set permissions, hooks, environment variables, and model defaults
292* [Create skills](/docs/en/skills.md): build reusable prompts and workflows293* [Create skills](https://code.claude.com/docs/en/skills.md): build reusable prompts and workflows
293* [Configure subagents](/docs/en/sub-agents.md): define specialized agents with their own context294* [Configure subagents](https://code.claude.com/docs/en/sub-agents.md): define specialized agents with their own context