Explore the .claude directory
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -164,6 +164,7 @@
`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#check-how-developers-sign-in-and-connect>).
`stats-cache.json`| Aggregated token and cost counts shown by `/usage`
`remote-settings.json`| Cached copy of [server-managed settings](</docs/en/server-managed-settings>) for your organization, or `{}` when your organization has configured none. Only present when the session [fetches them](</docs/en/server-managed-settings#platform-availability>). Claude Code checks for updates at startup and hourly during a session. Claude Code deletes it when you log out.
+`remote-settings-consent.json`| Per-organization or per-gateway hash of the server-managed settings that need approval, such as hooks, that you [approved](</docs/en/server-managed-settings#approval-memory>) or Claude Code [applied without asking](</docs/en/server-managed-settings#security-approval-dialogs>)
`cache/changelog.md`| Cached copy of the Claude Code changelog, shown by `/release-notes`. Refreshed in the background.
`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.
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -1,4 +1,4 @@
-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. On 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. The same applies to `.claude.json`, which otherwise sits at `~/.claude.json`. Most 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#agents-md>) in place of a `CLAUDE.md`. The rest of the directory is optional: add skills, rules, or subagents as you need them.
+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; files in `~/.claude` are personal configuration that applies across all your projects. On 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. The same applies to `.claude.json`, which otherwise sits at `~/.claude.json`. Most 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#agents-md>) in place of a `CLAUDE.md`. The rest of the directory is optional: add skills, rules, or subagents as you need them.
## Explore the directory
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -119,7 +119,7 @@
`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
`feedback/drafts/`| Queued [Claude-drafted feedback](</docs/en/tools-reference#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.
`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
-`skills/.trash/`, `plugins/.trash/`| [Skills](</docs/en/skills#how-synced-skills-behave>) and [plugins](</docs/en/plugins/loading#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
+`skills/.trash/`, `plugins/.trash/`| [Skills](</docs/en/skills#how-synced-skills-behave>) and [plugins](</docs/en/plugins/loading#synced-plugins>) that the claude.ai sync removed, such as after you turn one off on claude.ai or stop syncing. Recover them here. Claude Code can delete a folder before the age cutoff when it’s over 7 days old and has three newer copies, or when `.trash/` holds over 1,024 folders
`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.
`plugins/data/.set-aside/`| Data directories of plugins from a marketplace that your organization replaced with one of the same name. Their age counts from the day Claude Code moved them, and a shorter `cleanupPeriodDays` in project settings doesn’t apply. To keep one, move it somewhere else before the sweep deletes it.
`plugins/mcpb/`| The files Claude Code extracted from the [MCP bundles](</docs/en/plugins/components#include-a-packaged-mcpb-server>) that plugins declare. A bundle’s age counts from the last session that used it.
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -121,6 +121,7 @@
`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
`skills/.trash/`, `plugins/.trash/`| [Skills](</docs/en/skills#how-synced-skills-behave>) and [plugins](</docs/en/plugins/loading#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
`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.
+`plugins/data/.set-aside/`| Data directories of plugins from a marketplace that your organization replaced with one of the same name. Their age counts from the day Claude Code moved them, and a shorter `cleanupPeriodDays` in project settings doesn’t apply. To keep one, move it somewhere else before the sweep deletes it.
`plugins/mcpb/`| The files Claude Code extracted from the [MCP bundles](</docs/en/plugins/components#include-a-packaged-mcpb-server>) that plugins declare. A bundle’s age counts from the last session that used it.
`todos/`, `statsig/`, `logs/`| Legacy directories from older versions. No longer written. The sweep removes their contents and then the empty directory.
@@ -136,7 +137,7 @@
Claude Code skips the age-based sweep in these cases:
* **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.
- * **Paused sweep** : if Claude Code can’t safely determine the retention period, it pauses the 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` set, `/status` shows a warning until you fix the cause.
+ * **Paused sweep** : if Claude Code can’t safely determine the retention period, it pauses the sweep; the [`retention_sweep` event](</docs/en/monitoring-usage#retention-sweep-event>) reports why. When the cause is a settings file that can’t be read or parsed, or settings errors with `cleanupPeriodDays` or `desktopSessionCleanupPeriodDays` set, `/status` shows a warning until you fix the cause.
When [managed settings](</docs/en/managed-settings>) provide `cleanupPeriodDays`, Claude Code runs the sweep at the managed value even when a lower-priority settings file has errors. To 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#check-the-retention-sweep>).
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -114,7 +114,7 @@
`dev-mods/<session>/`| [Mods that Claude wrote](</docs/en/plugins/mods/create#ask-claude-for-a-mod>) during the session
`session-env/`| Per-session environment metadata
`tasks/`| Task lists written by the task tools, one directory per list
-`shell-snapshots/`| Aliases, functions, and shell options captured at startup and applied by the [Bash tool](</docs/en/tools-reference#bash-tool-behavior>) to each command. Removed on clean exit. The sweep clears any left after a crash.
+`shell-snapshots/`| Aliases, functions, and shell options applied by the [Bash tool](</docs/en/tools-reference#bash-tool-behavior>) to each command. Removed on clean exit. The sweep clears any left after a crash.
`backups/`| Earlier versions of `~/.claude.json`, copied when Claude Code rewrites the file. Claude Code keeps the five newest copies, plus a copy of any version it couldn’t parse. Past the age cutoff, the last copy that holds your configuration is deleted too. If the current file parses, holds your configuration, and is under 8 MiB, you’re left with a new copy of it.
`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
`feedback/drafts/`| Queued [Claude-drafted feedback](</docs/en/tools-reference#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.
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -60,7 +60,7 @@
`commands/*.md`| Project and global| ✓| Single-file prompts; same mechanism as skills| [Skills](</docs/en/skills>)
`output-styles/*.md`| Project and global| ✓| Custom instruction sets that adjust how Claude works| [Output styles](</docs/en/output-styles>)
`agents/*.md`| Project and global| ✓| Subagent definitions with their own prompt and tools| [Subagents](</docs/en/sub-agents>)
-`workflows/*.js`| Project and global| ✓| Dynamic workflow scripts written by Claude and saved from `/workflows`; each file becomes a `/<name>` command| [Dynamic workflows](</docs/en/workflows>)
+`workflows/*.js`| Project and global| ✓| Dynamic workflow scripts written by Claude and saved from `/workflows`; each saved workflow runs as a `/<name>` command| [Dynamic workflows](</docs/en/workflows>)
`agent-memory/<name>/`| Project and global| ✓| Persistent memory for subagents| [Persistent memory](</docs/en/sub-agents#enable-persistent-memory>)
`~/.claude.json`| Global only| | App state, account details, UI toggles, personal MCP servers. If it’s missing, Claude Code creates it when you start a session or run a subcommand such as `claude auth status`, but not for `--version` or `--help`.| [Global config](</docs/en/settings-reference#global-config-settings>)
`projects/<project>/memory/`| Global only| | Auto memory: Claude’s notes to itself across sessions| [Auto memory](</docs/en/memory#auto-memory>)
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -121,6 +121,7 @@
`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
`skills/.trash/`, `plugins/.trash/`| [Skills](</docs/en/skills#how-synced-skills-behave>) and [plugins](</docs/en/plugins/loading#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
`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.
+`plugins/mcpb/`| The files Claude Code extracted from the [MCP bundles](</docs/en/plugins/components#include-a-packaged-mcpb-server>) that plugins declare. A bundle’s age counts from the last session that used it.
`todos/`, `statsig/`, `logs/`| Legacy directories from older versions. No longer written. The sweep removes their contents and then the empty directory.
Session files in `sessions/`, auto memory, and Claude Desktop and Cowork transcripts each follow their own retention rule:
Show diff (175 lines)
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -1,18 +1,10 @@
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. On 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. The same applies to `.claude.json`, which otherwise sits at `~/.claude.json`. Most 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#agents-md>) in place of a `CLAUDE.md`. The rest of the directory is optional: add skills, rules, or subagents as you need them.
-##
-
-
-
-Explore the directory
+## Explore the directory
Click files in the tree to see what each one does, when it loads, and an example.
-##
-
-
-
-What’s not shown
+## What’s not shown
The explorer covers files you author and edit. A few related files live elsewhere:
@@ -25,11 +17,7 @@
`~/.claude` also holds data Claude Code writes as you work: transcripts, prompt history, file snapshots, caches, and logs. See application data below.
-##
-
-
-
-Choose the right file
+## Choose the right file
Different kinds of customization live in different files. Use this table to find where a change belongs.
@@ -46,11 +34,7 @@
Connect external tools over MCP| `.mcp.json`| project only| [MCP](</docs/en/mcp>)
Change how Claude formats responses| `output-styles/*.md`| project or global| [Output styles](</docs/en/output-styles>)
-##
-
-
-
-File reference
+## 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.
@@ -83,11 +67,7 @@
`keybindings.json`| Global only| | Custom keyboard shortcuts| [Keybindings](</docs/en/keybindings>)
`themes/*.json`| Global only| | Custom color themes| [Custom themes](</docs/en/terminal-config#create-a-custom-theme>)
-##
-
-
-
-Frontmatter fields by file
+## Frontmatter fields by file
Skills, command files, subagents, output styles, and rules read their configuration from YAML [frontmatter](</docs/en/glossary#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.
@@ -101,19 +81,11 @@
Agents shipped in a [plugin](</docs/en/plugins/components#agents>) honor a subset of the subagent fields.
-##
-
-
-
-Troubleshoot configuration
+## Troubleshoot configuration
If a setting, hook, or file isn’t taking effect, see [Debug your configuration](</docs/en/debug-your-config>) for the inspection commands and a symptom-first lookup table.
-##
-
-
-
-Application data
+## 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 is written to a transcript on disk: file contents, command output, pasted text. The transcript can also hold what Claude Code sends the model with your messages:
@@ -122,11 +94,7 @@
* Request parameters
* The instruction files it loaded, such as CLAUDE.md
-###
-
-
-
-Cleaned up automatically
+### Cleaned up automatically
Claude 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#clean-up-subagent-and-background-session-worktrees>).
@@ -171,11 +139,7 @@
When [managed settings](</docs/en/managed-settings>) provide `cleanupPeriodDays`, Claude Code runs the sweep at the managed value even when a lower-priority settings file has errors. To 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#check-the-retention-sweep>).
-###
-
-
-
-Session scratchpad directory
+### Session scratchpad directory
The scratchpad is a per-session directory that Claude Code gives Claude for temporary files: intermediate results, helper scripts, and drafts that don’t belong in your project. When Claude says it saved something “to the scratchpad”, the file is there. Claude uses it instead of `/tmp`, and can create, edit, and read files in it without a permission prompt. The scratchpad lives under Claude Code’s temp directory rather than `~/.claude`. Find the current session’s path for your platform:
@@ -189,11 +153,7 @@
* The session uses the Anthropic API, not Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry
* [`enableArtifact`](</docs/en/settings-reference#enableartifact>) isn’t set to `false`
-###
-
-
-
-Kept until you delete them
+### Kept until you delete them
Apart from the rows that say otherwise, the retention cleanup sweep doesn’t remove the paths below, and Claude Code keeps them until you delete them.
@@ -205,11 +165,7 @@
`cache/changelog.md`| Cached copy of the Claude Code changelog, shown by `/release-notes`. Refreshed in the background.
`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.
-####
-
-
-
-State files to keep
+#### State files to keep
Depending on which features you use, `~/.claude/` also holds files that the tables under Application data don’t list. Of those, caches and lock files are safe to delete. Keep these state files:
@@ -217,11 +173,7 @@
* `agent-memory/`: [subagent memory](</docs/en/sub-agents#enable-persistent-memory>)
* `jobs/` and `daemon/`: [background session](</docs/en/agent-view#where-state-is-stored>) state
-###
-
-
-
-Plaintext storage
+### 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:
@@ -230,11 +182,7 @@
* 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.
* Use [permission rules](</docs/en/permissions>) to deny reads of credential files
-###
-
-
-
-Clear local data
+### Clear local data
Run `claude purge` to delete the state Claude Code holds for one project. It deletes:
@@ -300,11 +248,7 @@
Don’t delete `~/.claude.json`, `~/.claude/settings.json`, or `~/.claude/plugins/`: those hold your account details, preferences, and installed plugins.
-##
-
-
-
-Related resources
+## Related resources
* [Manage Claude’s memory](</docs/en/memory>): write and organize CLAUDE.md, rules, and auto memory
* [Configure settings](</docs/en/settings>): set permissions, hooks, environment variables, and model defaults
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -158,17 +158,18 @@
Session files in `sessions/`, auto memory, and Claude Desktop and Cowork transcripts each follow their own retention rule:
* **`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.
+ * **`seed-admin/`** : scratch git directories Claude Code makes while packaging your repository for an [ultrareview](</docs/en/ultrareview>) or a [cloud session upload](</docs/en/claude-code-on-the-web#send-local-repositories-without-github>). When an upload ends, or in a later session if it was interrupted, Claude Code removes that upload’s directory and leaves `seed-admin/` in place.
* **Auto memory** : the sweep doesn’t delete the memory files in a project’s [auto memory](</docs/en/memory#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.
- * **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`. Claude Code deletes these transcripts after `cleanupPeriodDays` instead in either of these cases:
+ * **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`. Claude Code deletes these transcripts after `cleanupPeriodDays` instead in cases such as these:
* [Managed settings](</docs/en/managed-settings>) set `cleanupPeriodDays`
* The [HIPAA configuration applies to your sessions](</docs/en/hipaa-setup#check-how-developers-sign-in-and-connect>)
Claude Code skips the age-based sweep in these cases:
* **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.
- * **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>) provide `cleanupPeriodDays`, Claude Code runs the sweep at the managed value in either case.
-
-To 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#check-the-retention-sweep>).
+ * **Paused sweep** : if Claude Code can’t safely determine the retention period, it pauses the 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` set, `/status` shows a warning until you fix the cause.
+
+When [managed settings](</docs/en/managed-settings>) provide `cleanupPeriodDays`, Claude Code runs the sweep at the managed value even when a lower-priority settings file has errors. To 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#check-the-retention-sweep>).
###
@@ -182,7 +183,7 @@
* **Linux** : `/tmp/claude-<uid>/<project>/<session-id>/scratchpad/`, or the same shape under `$TMPDIR` when your system sets one
* **Windows** : `%TEMP%\claude\<project>\<session-id>\scratchpad\`
-`<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>). Scratchpad files last as long as the session’s transcript: the retention sweep deletes the directory when it deletes the transcript, and `claude purge` 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. A session has a scratchpad only when all of these hold:
+`<project>` is your working directory path with every character other than letters and digits replaced by `-`, such as `-Users-you-my-project`. On Windows, `<project>` is a 16-character hash of that string, such as `73295dabccd14c56`. In a Desktop app session, it can be the string itself. To get the exact path, ask Claude. 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>). Scratchpad files last as long as the session’s transcript: the retention sweep deletes the directory when it deletes the transcript, and `claude purge` 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. A session has a scratchpad only when all of these hold:
* You’re signed in with a claude.ai account rather than an API key
* The session uses the Anthropic API, not Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -147,7 +147,7 @@
`session-env/`| Per-session environment metadata
`tasks/`| Task lists written by the task tools, one directory per list
`shell-snapshots/`| Aliases, functions, and shell options captured at startup and applied by the [Bash tool](</docs/en/tools-reference#bash-tool-behavior>) to each command. Removed on clean exit. The sweep clears any left after a crash.
-`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.
+`backups/`| Earlier versions of `~/.claude.json`, copied when Claude Code rewrites the file. Claude Code keeps the five newest copies, plus a copy of any version it couldn’t parse. Past the age cutoff, the last copy that holds your configuration is deleted too. If the current file parses, holds your configuration, and is under 8 MiB, you’re left with a new copy of it.
`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
`feedback/drafts/`| Queued [Claude-drafted feedback](</docs/en/tools-reference#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.
`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
@@ -293,7 +293,8 @@
`~/.claude/tasks/`| Your [task lists](</docs/en/interactive-mode#task-list>), including any still in use
`~/.claude/skills/.trash/`, `~/.claude/plugins/.trash/`| The chance to recover [synced skills](</docs/en/skills#how-synced-skills-behave>) and [synced plugins](</docs/en/plugins/loading#synced-plugins>) that Claude Code removed
`~/.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
-`~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/session-env/`, `~/.claude/shell-snapshots/`, `~/.claude/backups/`| Nothing user-facing
+`~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/session-env/`, `~/.claude/shell-snapshots/`| Nothing user-facing
+`~/.claude/backups/`| The earlier copies you can [restore `~/.claude.json` from](</docs/en/errors#configuration-error-in-claude-json>)
`~/.claude/todos/`, `~/.claude/statsig/`, `~/.claude/logs/`, `~/.claude/image-cache/`| Nothing. Legacy directories not written by current versions.
Don’t delete `~/.claude.json`, `~/.claude/settings.json`, or `~/.claude/plugins/`: those hold your account details, preferences, and installed plugins.
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -1,4 +1,4 @@
-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. On 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. Most 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#agents-md>) in place of a `CLAUDE.md`. The rest of the directory is optional: add skills, rules, or subagents as you need them.
+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. On 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. The same applies to `.claude.json`, which otherwise sits at `~/.claude.json`. Most 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#agents-md>) in place of a `CLAUDE.md`. The rest of the directory is optional: add skills, rules, or subagents as you need them.
##
@@ -78,7 +78,7 @@
`agents/*.md`| Project and global| ✓| Subagent definitions with their own prompt and tools| [Subagents](</docs/en/sub-agents>)
`workflows/*.js`| Project and global| ✓| Dynamic workflow scripts written by Claude and saved from `/workflows`; each file becomes a `/<name>` command| [Dynamic workflows](</docs/en/workflows>)
`agent-memory/<name>/`| Project and global| ✓| Persistent memory for subagents| [Persistent memory](</docs/en/sub-agents#enable-persistent-memory>)
-`~/.claude.json`| Global only| | App state, account details, UI toggles, personal MCP servers| [Global config](</docs/en/settings-reference#global-config-settings>)
+`~/.claude.json`| Global only| | App state, account details, UI toggles, personal MCP servers. If it’s missing, Claude Code creates it when you start a session or run a subcommand such as `claude auth status`, but not for `--version` or `--help`.| [Global config](</docs/en/settings-reference#global-config-settings>)
`projects/<project>/memory/`| Global only| | Auto memory: Claude’s notes to itself across sessions| [Auto memory](</docs/en/memory#auto-memory>)
`keybindings.json`| Global only| | Custom keyboard shortcuts| [Keybindings](</docs/en/keybindings>)
`themes/*.json`| Global only| | Custom color themes| [Custom themes](</docs/en/terminal-config#create-a-custom-theme>)
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -115,7 +115,12 @@
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 is written to a transcript on disk: file contents, command output, pasted text.
+Beyond the config you author, `~/.claude` holds data Claude Code writes during sessions. These files are plaintext. Anything that passes through a tool is written to a transcript on disk: file contents, command output, pasted text. The transcript can also hold what Claude Code sends the model with your messages:
+
+ * The system prompt
+ * Tool definitions
+ * Request parameters
+ * The instruction files it loaded, such as CLAUDE.md
###
@@ -127,9 +132,9 @@
Path under `~/.claude/`| Contents
---|---
-`projects/<project>/<session>.jsonl`| Full conversation transcript: every message, tool call, and tool result
+`projects/<project>/<session>.jsonl`| Conversation transcript: messages, tool calls, and tool results, plus the system prompt, tool definitions, and parameters of the requests Claude Code sent the model
`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
-`projects/<project>/<session>/subagents/`| [Subagent](</docs/en/sub-agents>) conversation transcripts, removed with the parent session transcript when it ages out
+`projects/<project>/<session>/subagents/`| [Subagent](</docs/en/sub-agents>) transcripts in the same format as the session transcript, removed with the parent session transcript when it ages out
`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#images-in-tool-results>)
`projects/<project>/<session>/mcp-tasks/`| What a resumed session needs to follow its running [MCP tasks](</docs/en/mcp#mcp-tasks-that-run-on-the-server>) again, and the results of finished tasks that Claude hasn’t read yet
`file-history/<session>/`| Pre-edit snapshots of files Claude changed, used for [checkpoint restore](</docs/en/checkpointing>). Holds snapshots for the 100 most recent checkpoints; snapshot files that no retained checkpoint references are deleted, except each file’s first snapshot
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -131,6 +131,7 @@
`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
`projects/<project>/<session>/subagents/`| [Subagent](</docs/en/sub-agents>) conversation transcripts, removed with the parent session transcript when it ages out
`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#images-in-tool-results>)
+`projects/<project>/<session>/mcp-tasks/`| What a resumed session needs to follow its running [MCP tasks](</docs/en/mcp#mcp-tasks-that-run-on-the-server>) again, and the results of finished tasks that Claude hasn’t read yet
`file-history/<session>/`| Pre-edit snapshots of files Claude changed, used for [checkpoint restore](</docs/en/checkpointing>). Holds snapshots for the 100 most recent checkpoints; snapshot files that no retained checkpoint references are deleted, except each file’s first snapshot
`plans/`| Plan files written during [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>)
`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`
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -78,7 +78,7 @@
`agents/*.md`| Project and global| ✓| Subagent definitions with their own prompt and tools| [Subagents](</docs/en/sub-agents>)
`workflows/*.js`| Project and global| ✓| Dynamic workflow scripts written by Claude and saved from `/workflows`; each file becomes a `/<name>` command| [Dynamic workflows](</docs/en/workflows>)
`agent-memory/<name>/`| Project and global| ✓| Persistent memory for subagents| [Persistent memory](</docs/en/sub-agents#enable-persistent-memory>)
-`~/.claude.json`| Global only| | App state, OAuth, UI toggles, personal MCP servers| [Global config](</docs/en/settings-reference#global-config-settings>)
+`~/.claude.json`| Global only| | App state, account details, UI toggles, personal MCP servers| [Global config](</docs/en/settings-reference#global-config-settings>)
`projects/<project>/memory/`| Global only| | Auto memory: Claude’s notes to itself across sessions| [Auto memory](</docs/en/memory#auto-memory>)
`keybindings.json`| Global only| | Custom keyboard shortcuts| [Keybindings](</docs/en/keybindings>)
`themes/*.json`| Global only| | Custom color themes| [Custom themes](</docs/en/terminal-config#create-a-custom-theme>)
@@ -192,7 +192,7 @@
Path under `~/.claude/`| Contents
---|---
-`history.jsonl`| Every prompt 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#check-how-developers-sign-in-and-connect>).
+`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#check-how-developers-sign-in-and-connect>).
`stats-cache.json`| Aggregated token and cost counts shown by `/usage`
`remote-settings.json`| Cached copy of [server-managed settings](</docs/en/server-managed-settings>) for your organization, or `{}` when your organization has configured none. Only present when the session [fetches them](</docs/en/server-managed-settings#platform-availability>). Claude Code checks for updates at startup and hourly during a session. Claude Code deletes it when you log out.
`cache/changelog.md`| Cached copy of the Claude Code changelog, shown by `/release-notes`. Refreshed in the background.
@@ -290,7 +290,7 @@
`~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/session-env/`, `~/.claude/shell-snapshots/`, `~/.claude/backups/`| Nothing user-facing
`~/.claude/todos/`, `~/.claude/statsig/`, `~/.claude/logs/`, `~/.claude/image-cache/`| Nothing. Legacy directories not written by current versions.
-Don’t delete `~/.claude.json`, `~/.claude/settings.json`, or `~/.claude/plugins/`: those hold your auth, preferences, and installed plugins.
+Don’t delete `~/.claude.json`, `~/.claude/settings.json`, or `~/.claude/plugins/`: those hold your account details, preferences, and installed plugins.
##
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -263,7 +263,12 @@
claude purge ~/work/my-repo --yes
-Pass `--all` instead of a path to purge state for every project at once, which deletes `history.jsonl` outright rather than filtering it. Pass `-i` to step through the deletion plan one item at a time. The 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. You can also delete any of the application-data paths above by hand, apart from the state files to keep. New sessions are unaffected. The table below shows what you lose for past sessions.
+Other options:
+
+ * Pass `--all` instead of a path to purge state for every project at once, which deletes `history.jsonl` outright rather than filtering it.
+ * Pass `-i` to step through the deletion plan one item at a time.
+
+The 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. You can also delete any of the application-data paths above yourself, apart from the state files to keep.
Delete| You lose
---|---
@@ -279,7 +284,7 @@
`~/.claude/remote-settings.json`| Nothing. Re-fetched on next launch.
`~/.claude/cache/changelog.md`| Nothing. Refreshed in the background.
`~/.claude/policy-limits.json`| Nothing. Refreshed automatically.
-`~/.claude/tasks/`| Task lists that a resumed session would pick up
+`~/.claude/tasks/`| Your [task lists](</docs/en/interactive-mode#task-list>), including any still in use
`~/.claude/skills/.trash/`, `~/.claude/plugins/.trash/`| The chance to recover [synced skills](</docs/en/skills#how-synced-skills-behave>) and [synced plugins](</docs/en/plugins/loading#synced-plugins>) that Claude Code removed
`~/.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
`~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/session-env/`, `~/.claude/shell-snapshots/`, `~/.claude/backups/`| Nothing user-facing
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -95,7 +95,7 @@
---|---|---
`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#frontmatter-reference>)
`commands/*.md`| The skill fields except `name` and `paths`| [Skill frontmatter](</docs/en/skills#frontmatter-reference>)
-`agents/*.md`| `name`, `description`, `tools`, `disallowedTools`, `model`, `permissionMode`, `maxTurns`, `skills`, `mcpServers`, `hooks`, `memory`, `background`, `effort`, `isolation`, `color`, `initialPrompt`, `omitClaudeMd`, `experimental`| [Subagent frontmatter](</docs/en/sub-agents#supported-frontmatter-fields>)
+`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#supported-frontmatter-fields>)
`output-styles/*.md`| `name`, `description`, `keep-coding-instructions`, `force-for-plugin`| [Output style frontmatter](</docs/en/output-styles#frontmatter>)
`rules/*.md`| `paths`| [Rule frontmatter](</docs/en/memory#rules-frontmatter-reference>)
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -18,7 +18,7 @@
File| Location| Purpose
---|---|---
-`managed-settings.json`| System-level, varies by OS| Enterprise-enforced settings that you can’t override, apart from [narrow exceptions](</docs/en/settings#security-keys-where-the-stricter-value-applies>). See [where to save the file](</docs/en/managed-settings#deploy-a-managed-settings-file>) and [which managed source Claude Code uses](</docs/en/managed-settings#precedence-within-the-managed-tier>).
+`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#exceptions-to-managed-settings-precedence>). See [where to save the file](</docs/en/managed-settings#deploy-a-managed-settings-file>) and [which managed source Claude Code uses](</docs/en/managed-settings#precedence-within-the-managed-tier>).
`CLAUDE.local.md`| Project root| Your private preferences for this project, loaded alongside CLAUDE.md. Create it manually and add it to `.gitignore`.
`AGENTS.md`| Project root, `.claude/`, or any directory| Project instructions you write for AI coding agents. Claude Code can [load it](</docs/en/memory#agents-md>) in place of a `CLAUDE.md`.
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#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#find-plugins-on-disk>) from its source directory rather than from a cache copy. See [plugin caching](</docs/en/plugins/loading#find-plugins-on-disk>) for how orphaned versions are cleaned up.
@@ -56,7 +56,7 @@
Several things can override what you put in these files:
- * [Managed settings](</docs/en/server-managed-settings>) deployed by your organization take precedence over everything, apart from the [exceptions under Settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>)
+ * [Managed settings](</docs/en/server-managed-settings>) deployed by your organization take precedence over every settings file and `--settings` value, apart from the [exceptions under Settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>)
* CLI flags like `--permission-mode` or `--settings` override `settings.json` for that session
* Some environment variables take precedence over their equivalent setting, but this varies: check the [environment variables reference](</docs/en/env-vars>) for each one
@@ -263,7 +263,7 @@
claude purge ~/work/my-repo --yes
-Pass `--all` instead of a path to purge state for every project at once, which deletes `history.jsonl` outright rather than filtering it. Pass `-i` to step through the deletion plan one item at a time. In a script, check the output rather than the exit status alone. A run that deletes everything in its plan ends with `Purged N item(s)`. Treat that line as the sign of success. The 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. You can also delete any of the application-data paths above by hand, apart from the state files to keep. New sessions are unaffected. The table below shows what you lose for past sessions.
+Pass `--all` instead of a path to purge state for every project at once, which deletes `history.jsonl` outright rather than filtering it. Pass `-i` to step through the deletion plan one item at a time. The 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. You can also delete any of the application-data paths above by hand, apart from the state files to keep. New sessions are unaffected. The table below shows what you lose for past sessions.
Delete| You lose
---|---
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -1,4 +1,4 @@
-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. On 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. Most 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#agents-md>) on its own or alongside `CLAUDE.md`. The rest of the directory is optional: add skills, rules, or subagents as you need them.
+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. On 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. Most 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#agents-md>) in place of a `CLAUDE.md`. The rest of the directory is optional: add skills, rules, or subagents as you need them.
##
@@ -20,7 +20,7 @@
---|---|---
`managed-settings.json`| System-level, varies by OS| Enterprise-enforced settings that you can’t override, apart from [narrow exceptions](</docs/en/settings#security-keys-where-the-stricter-value-applies>). See [where to save the file](</docs/en/managed-settings#deploy-a-managed-settings-file>) and [which managed source Claude Code uses](</docs/en/managed-settings#precedence-within-the-managed-tier>).
`CLAUDE.local.md`| Project root| Your private preferences for this project, loaded alongside CLAUDE.md. Create it manually and add it to `.gitignore`.
-`AGENTS.md`| Project root, `.claude/`, or any directory| Project instructions you write for AI coding agents. Claude Code can [load it](</docs/en/memory#agents-md>) on its own or alongside `CLAUDE.md`.
+`AGENTS.md`| Project root, `.claude/`, or any directory| Project instructions you write for AI coding agents. Claude Code can [load it](</docs/en/memory#agents-md>) in place of a `CLAUDE.md`.
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#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#find-plugins-on-disk>) from its source directory rather than from a cache copy. See [plugin caching](</docs/en/plugins/loading#find-plugins-on-disk>) for how orphaned versions are cleaned up.
`~/.claude` also holds data Claude Code writes as you work: transcripts, prompt history, file snapshots, caches, and logs. See application data below.
@@ -162,6 +162,8 @@
* **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.
* **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>) provide `cleanupPeriodDays`, Claude Code runs the sweep at the managed value in either case.
+To 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#check-the-retention-sweep>).
+
###
@@ -261,7 +263,7 @@
claude purge ~/work/my-repo --yes
-Pass `--all` instead of a path to purge state for every project at once, which deletes `history.jsonl` outright rather than filtering it. Pass `-i` to step through the deletion plan one item at a time. The command leaves `shell-snapshots/` and `backups/` alone because those are not project-scoped, and warns about them in the plan output. You can also delete any of the application-data paths above by hand, apart from the state files to keep. New sessions are unaffected. The table below shows what you lose for past sessions.
+Pass `--all` instead of a path to purge state for every project at once, which deletes `history.jsonl` outright rather than filtering it. Pass `-i` to step through the deletion plan one item at a time. In a script, check the output rather than the exit status alone. A run that deletes everything in its plan ends with `Purged N item(s)`. Treat that line as the sign of success. The 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. You can also delete any of the application-data paths above by hand, apart from the state files to keep. New sessions are unaffected. The table below shows what you lose for past sessions.
Delete| You lose
---|---
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -155,7 +155,7 @@
* **Auto memory** : the sweep doesn’t delete the memory files in a project’s [auto memory](</docs/en/memory#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.
* **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`. Claude Code deletes these transcripts after `cleanupPeriodDays` instead in either of these cases:
* [Managed settings](</docs/en/managed-settings>) set `cleanupPeriodDays`
- * Your organization has the HIPAA configuration applied and Claude Code connects directly to the Claude API
+ * The [HIPAA configuration applies to your sessions](</docs/en/hipaa-setup#check-how-developers-sign-in-and-connect>)
Claude Code skips the age-based sweep in these cases:
@@ -190,7 +190,7 @@
Path under `~/.claude/`| Contents
---|---
-`history.jsonl`| Every prompt you’ve typed, with timestamp and project path. Used for up-arrow recall, `Ctrl+R` history search, and `!` shell-command completion. In an organization with the HIPAA configuration applied, each sweep removes the entries older than `cleanupPeriodDays` when Claude Code connects directly to the Claude API.
+`history.jsonl`| Every prompt 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#check-how-developers-sign-in-and-connect>).
`stats-cache.json`| Aggregated token and cost counts shown by `/usage`
`remote-settings.json`| Cached copy of [server-managed settings](</docs/en/server-managed-settings>) for your organization, or `{}` when your organization has configured none. Only present when the session [fetches them](</docs/en/server-managed-settings#platform-availability>). Claude Code checks for updates at startup and hourly during a session. Claude Code deletes it when you log out.
`cache/changelog.md`| Cached copy of the Claude Code changelog, shown by `/release-notes`. Refreshed in the background.
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -153,7 +153,9 @@
* **`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.
* **Auto memory** : the sweep doesn’t delete the memory files in a project’s [auto memory](</docs/en/memory#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.
- * **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>). When [managed settings](</docs/en/managed-settings>) set `cleanupPeriodDays`, Claude Code deletes these transcripts after that period instead. Requires Claude Code v2.1.248 or later; earlier versions delete them after `cleanupPeriodDays`.
+ * **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`. Claude Code deletes these transcripts after `cleanupPeriodDays` instead in either of these cases:
+ * [Managed settings](</docs/en/managed-settings>) set `cleanupPeriodDays`
+ * Your organization has the HIPAA configuration applied and Claude Code connects directly to the Claude API
Claude Code skips the age-based sweep in these cases:
@@ -184,11 +186,11 @@
Kept until you delete them
-The retention cleanup sweep doesn’t remove the paths below. Claude Code keeps them until you delete them, apart from the two caches it deletes when you log out.
+Apart from the rows that say otherwise, the retention cleanup sweep doesn’t remove the paths below, and Claude Code keeps them until you delete them.
Path under `~/.claude/`| Contents
---|---
-`history.jsonl`| Every prompt you’ve typed, with timestamp and project path. Used for up-arrow recall, `Ctrl+R` history search, and `!` shell-command completion.
+`history.jsonl`| Every prompt you’ve typed, with timestamp and project path. Used for up-arrow recall, `Ctrl+R` history search, and `!` shell-command completion. In an organization with the HIPAA configuration applied, each sweep removes the entries older than `cleanupPeriodDays` when Claude Code connects directly to the Claude API.
`stats-cache.json`| Aggregated token and cost counts shown by `/usage`
`remote-settings.json`| Cached copy of [server-managed settings](</docs/en/server-managed-settings>) for your organization, or `{}` when your organization has configured none. Only present when the session [fetches them](</docs/en/server-managed-settings#platform-availability>). Claude Code checks for updates at startup and hourly during a session. Claude Code deletes it when you log out.
`cache/changelog.md`| Cached copy of the Claude Code changelog, shown by `/release-notes`. Refreshed in the background.
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -21,7 +21,7 @@
`managed-settings.json`| System-level, varies by OS| Enterprise-enforced settings that you can’t override, apart from [narrow exceptions](</docs/en/settings#security-keys-where-the-stricter-value-applies>). See [where to save the file](</docs/en/managed-settings#deploy-a-managed-settings-file>) and [which managed source Claude Code uses](</docs/en/managed-settings#precedence-within-the-managed-tier>).
`CLAUDE.local.md`| Project root| Your private preferences for this project, loaded alongside CLAUDE.md. Create it manually and add it to `.gitignore`.
`AGENTS.md`| Project root, `.claude/`, or any directory| Project instructions you write for AI coding agents. Claude Code can [load it](</docs/en/memory#agents-md>) on its own or alongside `CLAUDE.md`.
-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#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 local-directory marketplace also [loads in place](</docs/en/plugins/loading#find-plugins-on-disk>) from its source directory rather than from a cache copy. See [plugin caching](</docs/en/plugins/loading#find-plugins-on-disk>) for how orphaned versions are cleaned up.
+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#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#find-plugins-on-disk>) from its source directory rather than from a cache copy. See [plugin caching](</docs/en/plugins/loading#find-plugins-on-disk>) for how orphaned versions are cleaned up.
`~/.claude` also holds data Claude Code writes as you work: transcripts, prompt history, file snapshots, caches, and logs. See application data below.
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -172,7 +172,7 @@
* **Linux** : `/tmp/claude-<uid>/<project>/<session-id>/scratchpad/`, or the same shape under `$TMPDIR` when your system sets one
* **Windows** : `%TEMP%\claude\<project>\<session-id>\scratchpad\`
-`<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>). Scratchpad files last as long as the session’s transcript: the retention sweep deletes the directory when it deletes the transcript, and `claude project purge` 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. A session has a scratchpad only when all of these hold:
+`<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>). Scratchpad files last as long as the session’s transcript: the retention sweep deletes the directory when it deletes the transcript, and `claude purge` 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. A session has a scratchpad only when all of these hold:
* You’re signed in with a claude.ai account rather than an API key
* The session uses the Anthropic API, not Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry
@@ -225,16 +225,16 @@
Clear local data
-Run `claude project purge` to delete the state Claude Code holds for one project. It deletes:
+Run `claude purge` to delete the state Claude Code holds for one project. It deletes:
* Transcripts and auto memory under `projects/`
* Per-session `tasks/`, `debug/`, and `file-history/` entries
* Matching prompt lines in `history.jsonl`
* The project’s entry in `~/.claude.json`
-Images you pasted or attached in the project’s sessions and each session’s scratchpad are stored under Claude Code’s temp directory rather than `~/.claude`, so the purge doesn’t remove them. The retention sweep still deletes the images once they’re older than `cleanupPeriodDays`; a purged session’s scratchpad stays until you delete it or your operating system clears the temp directory. The command prints the full deletion plan and asks for confirmation before removing anything. The examples below use `~/work/my-repo` as a placeholder. Replace it with the path to your project. If no state matches the path, the command prints an error and exits with status 1. Preview the plan without deleting anything:
-
- claude project purge ~/work/my-repo --dry-run
+Images you pasted or attached in the project’s sessions and each session’s scratchpad are stored under Claude Code’s temp directory rather than `~/.claude`, so the purge doesn’t remove them. The retention sweep still deletes the images once they’re older than `cleanupPeriodDays`; a purged session’s scratchpad stays until you delete it or your operating system clears the temp directory. The command prints the full deletion plan and asks for confirmation before removing anything. Before v2.1.288, the command was `claude project purge`. The examples below use `~/work/my-repo` as a placeholder. Replace it with the path to your project. If no state matches the path, the command prints an error and exits with status 1. Preview the plan without deleting anything:
+
+ claude purge ~/work/my-repo --dry-run
The plan lists each matching item and why it is included:
@@ -253,11 +253,11 @@
Delete with a single confirmation prompt:
- claude project purge ~/work/my-repo
+ claude purge ~/work/my-repo
The command prints the same plan, then asks `Delete 3 item(s) for /home/user/work/my-repo? This cannot be undone. [y/N]` and deletes only if you answer `y`. Omit the path to pick a project from an interactive list. Skip the confirmation prompt for use in scripts:
- claude project purge ~/work/my-repo --yes
+ claude purge ~/work/my-repo --yes
Pass `--all` instead of a path to purge state for every project at once, which deletes `history.jsonl` outright rather than filtering it. Pass `-i` to step through the deletion plan one item at a time. The command leaves `shell-snapshots/` and `backups/` alone because those are not project-scoped, and warns about them in the plan output. You can also delete any of the application-data paths above by hand, apart from the state files to keep. New sessions are unaffected. The table below shows what you lose for past sessions.
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -137,6 +137,7 @@
`paste-cache/`| Contents of large pastes
`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.
`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>) session. An attachment to a [cloud session](</docs/en/claude-code-on-the-web>) is saved in that session’s own cloud environment instead, not on your machine.
+`dev-mods/<session>/`| [Mods that Claude wrote](</docs/en/plugins/mods/create#ask-claude-for-a-mod>) during the session
`session-env/`| Per-session environment metadata
`tasks/`| Task lists written by the task tools, one directory per list
`shell-snapshots/`| Aliases, functions, and shell options captured at startup and applied by the [Bash tool](</docs/en/tools-reference#bash-tool-behavior>) to each command. Removed on clean exit. The sweep clears any left after a crash.
@@ -193,7 +194,13 @@
`cache/changelog.md`| Cached copy of the Claude Code changelog, shown by `/release-notes`. Refreshed in the background.
`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.
-Other files appear depending on which features you use. Caches and lock files are safe to delete. Keep these state files:
+####
+
+
+
+State files to keep
+
+Depending on which features you use, `~/.claude/` also holds files that the tables under Application data don’t list. Of those, caches and lock files are safe to delete. Keep these state files:
* `.credentials.json`: your [login credentials](</docs/en/authentication#credential-management>)
* `agent-memory/`: [subagent memory](</docs/en/sub-agents#enable-persistent-memory>)
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -145,6 +145,7 @@
`feedback/drafts/`| Queued [Claude-drafted feedback](</docs/en/tools-reference#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.
`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
`skills/.trash/`, `plugins/.trash/`| [Skills](</docs/en/skills#how-synced-skills-behave>) and [plugins](</docs/en/plugins/loading#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
+`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.
`todos/`, `statsig/`, `logs/`| Legacy directories from older versions. No longer written. The sweep removes their contents and then the empty directory.
Session files in `sessions/`, auto memory, and Claude Desktop and Cowork transcripts each follow their own retention rule:
@@ -269,6 +270,7 @@
`~/.claude/policy-limits.json`| Nothing. Refreshed automatically.
`~/.claude/tasks/`| Task lists that a resumed session would pick up
`~/.claude/skills/.trash/`, `~/.claude/plugins/.trash/`| The chance to recover [synced skills](</docs/en/skills#how-synced-skills-behave>) and [synced plugins](</docs/en/plugins/loading#synced-plugins>) that Claude Code removed
+`~/.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
`~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/session-env/`, `~/.claude/shell-snapshots/`, `~/.claude/backups/`| Nothing user-facing
`~/.claude/todos/`, `~/.claude/statsig/`, `~/.claude/logs/`, `~/.claude/image-cache/`| Nothing. Legacy directories not written by current versions.
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -130,7 +130,7 @@
`projects/<project>/<session>.jsonl`| Full conversation transcript: every message, tool call, and tool result
`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
`projects/<project>/<session>/subagents/`| [Subagent](</docs/en/sub-agents>) conversation transcripts, removed with the parent session transcript when it ages out
-`projects/<project>/<session>/tool-results/`| Large tool outputs spilled to separate files
+`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#images-in-tool-results>)
`file-history/<session>/`| Pre-edit snapshots of files Claude changed, used for [checkpoint restore](</docs/en/checkpointing>). Holds snapshots for the 100 most recent checkpoints; snapshot files that no retained checkpoint references are deleted, except each file’s first snapshot
`plans/`| Plan files written during [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>)
`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`
@@ -162,6 +162,24 @@
+Session scratchpad directory
+
+The scratchpad is a per-session directory that Claude Code gives Claude for temporary files: intermediate results, helper scripts, and drafts that don’t belong in your project. When Claude says it saved something “to the scratchpad”, the file is there. Claude uses it instead of `/tmp`, and can create, edit, and read files in it without a permission prompt. The scratchpad lives under Claude Code’s temp directory rather than `~/.claude`. Find the current session’s path for your platform:
+
+ * **macOS** : `/private/tmp/claude-<uid>/<project>/<session-id>/scratchpad/`
+ * **Linux** : `/tmp/claude-<uid>/<project>/<session-id>/scratchpad/`, or the same shape under `$TMPDIR` when your system sets one
+ * **Windows** : `%TEMP%\claude\<project>\<session-id>\scratchpad\`
+
+`<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>). Scratchpad files last as long as the session’s transcript: the retention sweep deletes the directory when it deletes the transcript, and `claude project purge` 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. A session has a scratchpad only when all of these hold:
+
+ * You’re signed in with a claude.ai account rather than an API key
+ * The session uses the Anthropic API, not Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry
+ * [`enableArtifact`](</docs/en/settings-reference#enableartifact>) isn’t set to `false`
+
+###
+
+
+
Kept until you delete them
The retention cleanup sweep doesn’t remove the paths below. Claude Code keeps them until you delete them, apart from the two caches it deletes when you log out.
@@ -206,7 +224,7 @@
* Matching prompt lines in `history.jsonl`
* The project’s entry in `~/.claude.json`
-Images you pasted or attached in the project’s sessions are stored under Claude Code’s temp directory rather than `~/.claude`, so the purge doesn’t remove them. The retention sweep deletes them once they’re older than `cleanupPeriodDays`. The command prints the full deletion plan and asks for confirmation before removing anything. The examples below use `~/work/my-repo` as a placeholder. Replace it with the path to your project. If no state matches the path, the command prints an error and exits with status 1. Preview the plan without deleting anything:
+Images you pasted or attached in the project’s sessions and each session’s scratchpad are stored under Claude Code’s temp directory rather than `~/.claude`, so the purge doesn’t remove them. The retention sweep still deletes the images once they’re older than `cleanupPeriodDays`; a purged session’s scratchpad stays until you delete it or your operating system clears the temp directory. The command prints the full deletion plan and asks for confirmation before removing anything. The examples below use `~/work/my-repo` as a placeholder. Replace it with the path to your project. If no state matches the path, the command prints an error and exits with status 1. Preview the plan without deleting anything:
claude project purge ~/work/my-repo --dry-run
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -21,7 +21,7 @@
`managed-settings.json`| System-level, varies by OS| Enterprise-enforced settings that you can’t override, apart from [narrow exceptions](</docs/en/settings#security-keys-where-the-stricter-value-applies>). See [where to save the file](</docs/en/managed-settings#deploy-a-managed-settings-file>) and [which managed source Claude Code uses](</docs/en/managed-settings#precedence-within-the-managed-tier>).
`CLAUDE.local.md`| Project root| Your private preferences for this project, loaded alongside CLAUDE.md. Create it manually and add it to `.gitignore`.
`AGENTS.md`| Project root, `.claude/`, or any directory| Project instructions you write for AI coding agents. Claude Code can [load it](</docs/en/memory#agents-md>) on its own or alongside `CLAUDE.md`.
-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-reference#synced-plugins>) download into `~/.claude/plugins/synced/`. For a plugin installed from a marketplace [`command` source](</docs/en/plugin-marketplaces#command-sources>) 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 local-directory marketplace also [loads in place](</docs/en/plugins-reference#plugin-caching-and-file-resolution>) from its source directory rather than from a cache copy. See [plugin caching](</docs/en/plugins-reference#plugin-caching-and-file-resolution>) for how orphaned versions are cleaned up.
+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#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 local-directory marketplace also [loads in place](</docs/en/plugins/loading#find-plugins-on-disk>) from its source directory rather than from a cache copy. See [plugin caching](</docs/en/plugins/loading#find-plugins-on-disk>) for how orphaned versions are cleaned up.
`~/.claude` also holds data Claude Code writes as you work: transcripts, prompt history, file snapshots, caches, and logs. See application data below.
@@ -99,7 +99,7 @@
`output-styles/*.md`| `name`, `description`, `keep-coding-instructions`, `force-for-plugin`| [Output style frontmatter](</docs/en/output-styles#frontmatter>)
`rules/*.md`| `paths`| [Rule frontmatter](</docs/en/memory#rules-frontmatter-reference>)
-Agents shipped in a [plugin](</docs/en/plugins-reference#plugin-agent-frontmatter>) honor a subset of the subagent fields.
+Agents shipped in a [plugin](</docs/en/plugins/components#agents>) honor a subset of the subagent fields.
##
@@ -144,7 +144,7 @@
`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
`feedback/drafts/`| Queued [Claude-drafted feedback](</docs/en/tools-reference#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.
`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
-`skills/.trash/`, `plugins/.trash/`| [Skills](</docs/en/skills#how-synced-skills-behave>) and [plugins](</docs/en/plugins-reference#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
+`skills/.trash/`, `plugins/.trash/`| [Skills](</docs/en/skills#how-synced-skills-behave>) and [plugins](</docs/en/plugins/loading#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
`todos/`, `statsig/`, `logs/`| Legacy directories from older versions. No longer written. The sweep removes their contents and then the empty directory.
Session files in `sessions/`, auto memory, and Claude Desktop and Cowork transcripts each follow their own retention rule:
@@ -250,7 +250,7 @@
`~/.claude/cache/changelog.md`| Nothing. Refreshed in the background.
`~/.claude/policy-limits.json`| Nothing. Refreshed automatically.
`~/.claude/tasks/`| Task lists that a resumed session would pick up
-`~/.claude/skills/.trash/`, `~/.claude/plugins/.trash/`| The chance to recover [synced skills](</docs/en/skills#how-synced-skills-behave>) and [synced plugins](</docs/en/plugins-reference#synced-plugins>) that Claude Code removed
+`~/.claude/skills/.trash/`, `~/.claude/plugins/.trash/`| The chance to recover [synced skills](</docs/en/skills#how-synced-skills-behave>) and [synced plugins](</docs/en/plugins/loading#synced-plugins>) that Claude Code removed
`~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/session-env/`, `~/.claude/shell-snapshots/`, `~/.claude/backups/`| Nothing user-facing
`~/.claude/todos/`, `~/.claude/statsig/`, `~/.claude/logs/`, `~/.claude/image-cache/`| Nothing. Legacy directories not written by current versions.
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -82,6 +82,24 @@
`projects/<project>/memory/`| Global only| | Auto memory: Claude’s notes to itself across sessions| [Auto memory](</docs/en/memory#auto-memory>)
`keybindings.json`| Global only| | Custom keyboard shortcuts| [Keybindings](</docs/en/keybindings>)
`themes/*.json`| Global only| | Custom color themes| [Custom themes](</docs/en/terminal-config#create-a-custom-theme>)
+
+##
+
+
+
+Frontmatter fields by file
+
+Skills, command files, subagents, output styles, and rules read their configuration from YAML [frontmatter](</docs/en/glossary#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.
+
+File| Frontmatter fields| Reference
+---|---|---
+`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#frontmatter-reference>)
+`commands/*.md`| The skill fields except `name` and `paths`| [Skill frontmatter](</docs/en/skills#frontmatter-reference>)
+`agents/*.md`| `name`, `description`, `tools`, `disallowedTools`, `model`, `permissionMode`, `maxTurns`, `skills`, `mcpServers`, `hooks`, `memory`, `background`, `effort`, `isolation`, `color`, `initialPrompt`, `omitClaudeMd`, `experimental`| [Subagent frontmatter](</docs/en/sub-agents#supported-frontmatter-fields>)
+`output-styles/*.md`| `name`, `description`, `keep-coding-instructions`, `force-for-plugin`| [Output style frontmatter](</docs/en/output-styles#frontmatter>)
+`rules/*.md`| `paths`| [Rule frontmatter](</docs/en/memory#rules-frontmatter-reference>)
+
+Agents shipped in a [plugin](</docs/en/plugins-reference#plugin-agent-frontmatter>) honor a subset of the subagent fields.
##
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -21,7 +21,7 @@
`managed-settings.json`| System-level, varies by OS| Enterprise-enforced settings that you can’t override, apart from [narrow exceptions](</docs/en/settings#security-keys-where-the-stricter-value-applies>). See [where to save the file](</docs/en/managed-settings#deploy-a-managed-settings-file>) and [which managed source Claude Code uses](</docs/en/managed-settings#precedence-within-the-managed-tier>).
`CLAUDE.local.md`| Project root| Your private preferences for this project, loaded alongside CLAUDE.md. Create it manually and add it to `.gitignore`.
`AGENTS.md`| Project root, `.claude/`, or any directory| Project instructions you write for AI coding agents. Claude Code can [load it](</docs/en/memory#agents-md>) on its own or alongside `CLAUDE.md`.
-Installed plugins| `~/.claude/plugins`| Cloned marketplaces, installed plugin versions, and per-plugin data, managed by `claude plugin` commands. For a plugin installed from a marketplace [`command` source](</docs/en/plugin-marketplaces#command-sources>) 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 local-directory marketplace also [loads in place](</docs/en/plugins-reference#plugin-caching-and-file-resolution>) from its source directory rather than from a cache copy. See [plugin caching](</docs/en/plugins-reference#plugin-caching-and-file-resolution>) for how orphaned versions are cleaned up.
+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-reference#synced-plugins>) download into `~/.claude/plugins/synced/`. For a plugin installed from a marketplace [`command` source](</docs/en/plugin-marketplaces#command-sources>) 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 local-directory marketplace also [loads in place](</docs/en/plugins-reference#plugin-caching-and-file-resolution>) from its source directory rather than from a cache copy. See [plugin caching](</docs/en/plugins-reference#plugin-caching-and-file-resolution>) for how orphaned versions are cleaned up.
`~/.claude` also holds data Claude Code writes as you work: transcripts, prompt history, file snapshots, caches, and logs. See application data below.
@@ -117,7 +117,7 @@
`plans/`| Plan files written during [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>)
`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`
`paste-cache/`| Contents of large pastes
-`image-cache/<session>/`| Attached images. On each sweep, Claude Code removes the directories of all other sessions, whatever their age.
+`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.
`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>) session. An attachment to a [cloud session](</docs/en/claude-code-on-the-web>) is saved in that session’s own cloud environment instead, not on your machine.
`session-env/`| Per-session environment metadata
`tasks/`| Task lists written by the task tools, one directory per list
@@ -126,7 +126,7 @@
`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
`feedback/drafts/`| Queued [Claude-drafted feedback](</docs/en/tools-reference#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.
`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
-`skills/.trash/`, `plugins/.trash/`| [Skills](</docs/en/skills#how-synced-skills-behave>) and [plugins](</docs/en/plugins-reference#synced-plugins>) synced from claude.ai that Claude Code removed. Moved here instead of deleted so you can recover the files
+`skills/.trash/`, `plugins/.trash/`| [Skills](</docs/en/skills#how-synced-skills-behave>) and [plugins](</docs/en/plugins-reference#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
`todos/`, `statsig/`, `logs/`| Legacy directories from older versions. No longer written. The sweep removes their contents and then the empty directory.
Session files in `sessions/`, auto memory, and Claude Desktop and Cowork transcripts each follow their own retention rule:
@@ -188,7 +188,7 @@
* Matching prompt lines in `history.jsonl`
* The project’s entry in `~/.claude.json`
-The command prints the full deletion plan and asks for confirmation before removing anything. The examples below use `~/work/my-repo` as a placeholder. Replace it with the path to your project. If no state matches the path, the command prints an error and exits with status 1. Preview the plan without deleting anything:
+Images you pasted or attached in the project’s sessions are stored under Claude Code’s temp directory rather than `~/.claude`, so the purge doesn’t remove them. The retention sweep deletes them once they’re older than `cleanupPeriodDays`. The command prints the full deletion plan and asks for confirmation before removing anything. The examples below use `~/work/my-repo` as a placeholder. Replace it with the path to your project. If no state matches the path, the command prints an error and exits with status 1. Preview the plan without deleting anything:
claude project purge ~/work/my-repo --dry-run
@@ -233,8 +233,8 @@
`~/.claude/policy-limits.json`| Nothing. Refreshed automatically.
`~/.claude/tasks/`| Task lists that a resumed session would pick up
`~/.claude/skills/.trash/`, `~/.claude/plugins/.trash/`| The chance to recover [synced skills](</docs/en/skills#how-synced-skills-behave>) and [synced plugins](</docs/en/plugins-reference#synced-plugins>) that Claude Code removed
-`~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/image-cache/`, `~/.claude/session-env/`, `~/.claude/shell-snapshots/`, `~/.claude/backups/`| Nothing user-facing
-`~/.claude/todos/`, `~/.claude/statsig/`, `~/.claude/logs/`| Nothing. Legacy directories not written by current versions.
+`~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/session-env/`, `~/.claude/shell-snapshots/`, `~/.claude/backups/`| Nothing user-facing
+`~/.claude/todos/`, `~/.claude/statsig/`, `~/.claude/logs/`, `~/.claude/image-cache/`| Nothing. Legacy directories not written by current versions.
Don’t delete `~/.claude.json`, `~/.claude/settings.json`, or `~/.claude/plugins/`: those hold your auth, preferences, and installed plugins.
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -1,4 +1,4 @@
-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. On 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. 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.
+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. On 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. Most 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#agents-md>) on its own or alongside `CLAUDE.md`. The rest of the directory is optional: add skills, rules, or subagents as you need them.
##
@@ -20,6 +20,7 @@
---|---|---
`managed-settings.json`| System-level, varies by OS| Enterprise-enforced settings that you can’t override, apart from [narrow exceptions](</docs/en/settings#security-keys-where-the-stricter-value-applies>). See [where to save the file](</docs/en/managed-settings#deploy-a-managed-settings-file>) and [which managed source Claude Code uses](</docs/en/managed-settings#precedence-within-the-managed-tier>).
`CLAUDE.local.md`| Project root| Your private preferences for this project, loaded alongside CLAUDE.md. Create it manually and add it to `.gitignore`.
+`AGENTS.md`| Project root, `.claude/`, or any directory| Project instructions you write for AI coding agents. Claude Code can [load it](</docs/en/memory#agents-md>) on its own or alongside `CLAUDE.md`.
Installed plugins| `~/.claude/plugins`| Cloned marketplaces, installed plugin versions, and per-plugin data, managed by `claude plugin` commands. For a plugin installed from a marketplace [`command` source](</docs/en/plugin-marketplaces#command-sources>) 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 local-directory marketplace also [loads in place](</docs/en/plugins-reference#plugin-caching-and-file-resolution>) from its source directory rather than from a cache copy. See [plugin caching](</docs/en/plugins-reference#plugin-caching-and-file-resolution>) for how orphaned versions are cleaned up.
`~/.claude` also holds data Claude Code writes as you work: transcripts, prompt history, file snapshots, caches, and logs. See application data below.
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -125,6 +125,7 @@
`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
`feedback/drafts/`| Queued [Claude-drafted feedback](</docs/en/tools-reference#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.
`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
+`skills/.trash/`, `plugins/.trash/`| [Skills](</docs/en/skills#how-synced-skills-behave>) and [plugins](</docs/en/plugins-reference#synced-plugins>) synced from claude.ai that Claude Code removed. Moved here instead of deleted so you can recover the files
`todos/`, `statsig/`, `logs/`| Legacy directories from older versions. No longer written. The sweep removes their contents and then the empty directory.
Session files in `sessions/`, auto memory, and Claude Desktop and Cowork transcripts each follow their own retention rule:
@@ -230,6 +231,7 @@
`~/.claude/cache/changelog.md`| Nothing. Refreshed in the background.
`~/.claude/policy-limits.json`| Nothing. Refreshed automatically.
`~/.claude/tasks/`| Task lists that a resumed session would pick up
+`~/.claude/skills/.trash/`, `~/.claude/plugins/.trash/`| The chance to recover [synced skills](</docs/en/skills#how-synced-skills-behave>) and [synced plugins](</docs/en/plugins-reference#synced-plugins>) that Claude Code removed
`~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/image-cache/`, `~/.claude/session-env/`, `~/.claude/shell-snapshots/`, `~/.claude/backups/`| Nothing user-facing
`~/.claude/todos/`, `~/.claude/statsig/`, `~/.claude/logs/`| Nothing. Legacy directories not written by current versions.
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -20,7 +20,7 @@
---|---|---
`managed-settings.json`| System-level, varies by OS| Enterprise-enforced settings that you can’t override, apart from [narrow exceptions](</docs/en/settings#security-keys-where-the-stricter-value-applies>). See [where to save the file](</docs/en/managed-settings#deploy-a-managed-settings-file>) and [which managed source Claude Code uses](</docs/en/managed-settings#precedence-within-the-managed-tier>).
`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. For a plugin installed from a marketplace [`command` source](</docs/en/plugin-marketplaces#command-sources>) 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. See [plugin caching](</docs/en/plugins-reference#plugin-caching-and-file-resolution>) for how orphaned versions are cleaned up.
+Installed plugins| `~/.claude/plugins`| Cloned marketplaces, installed plugin versions, and per-plugin data, managed by `claude plugin` commands. For a plugin installed from a marketplace [`command` source](</docs/en/plugin-marketplaces#command-sources>) 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 local-directory marketplace also [loads in place](</docs/en/plugins-reference#plugin-caching-and-file-resolution>) from its source directory rather than from a cache copy. See [plugin caching](</docs/en/plugins-reference#plugin-caching-and-file-resolution>) for how orphaned versions are cleaned up.
`~/.claude` also holds data Claude Code writes as you work: transcripts, prompt history, file snapshots, caches, and logs. See application data below.
@@ -96,7 +96,7 @@
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.
+Beyond the config you author, `~/.claude` holds data Claude Code writes during sessions. These files are plaintext. Anything that passes through a tool is written to a transcript on disk: file contents, command output, pasted text.
###
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -20,7 +20,7 @@
---|---|---
`managed-settings.json`| System-level, varies by OS| Enterprise-enforced settings that you can’t override, apart from [narrow exceptions](</docs/en/settings#security-keys-where-the-stricter-value-applies>). See [where to save the file](</docs/en/managed-settings#deploy-a-managed-settings-file>) and [which managed source Claude Code uses](</docs/en/managed-settings#precedence-within-the-managed-tier>).
`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. For a plugin installed from a marketplace [`command` source](</docs/en/plugin-marketplaces#command-sources>) in link mode, Claude Code stores links here instead of a copy, and the plugin’s files stay in the directory the command prints. See [plugin caching](</docs/en/plugins-reference#plugin-caching-and-file-resolution>) for how orphaned versions are cleaned up.
+Installed plugins| `~/.claude/plugins`| Cloned marketplaces, installed plugin versions, and per-plugin data, managed by `claude plugin` commands. For a plugin installed from a marketplace [`command` source](</docs/en/plugin-marketplaces#command-sources>) 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. See [plugin caching](</docs/en/plugins-reference#plugin-caching-and-file-resolution>) for how orphaned versions are cleaned up.
`~/.claude` also holds data Claude Code writes as you work: transcripts, prompt history, file snapshots, caches, and logs. See application data below.
@@ -133,7 +133,7 @@
* **Auto memory** : the sweep doesn’t delete the memory files in a project’s [auto memory](</docs/en/memory#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.
* **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>). When [managed settings](</docs/en/managed-settings>) set `cleanupPeriodDays`, Claude Code deletes these transcripts after that period instead. Requires Claude Code v2.1.248 or later; earlier versions delete them after `cleanupPeriodDays`.
-Claude Code skips the sweep entirely in these cases:
+Claude Code skips the age-based sweep in these cases:
* **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.
* **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>) provide `cleanupPeriodDays`, Claude Code runs the sweep at the managed value in either case.
@@ -152,7 +152,7 @@
`stats-cache.json`| Aggregated token and cost counts shown by `/usage`
`remote-settings.json`| Cached copy of [server-managed settings](</docs/en/server-managed-settings>) for your organization, or `{}` when your organization has configured none. Only present when the session [fetches them](</docs/en/server-managed-settings#platform-availability>). Claude Code checks for updates at startup and hourly during a session. Claude Code deletes it when you log out.
`cache/changelog.md`| Cached copy of the Claude Code changelog, shown by `/release-notes`. Refreshed in the background.
-`policy-limits.json`| Cached feature policy settings for your organization. Only present for some account types. Refreshed automatically. Claude Code deletes it when you log out.
+`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.
Other files appear depending on which features you use. Caches and lock files are safe to delete. Keep these state files:
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -73,7 +73,7 @@
`.worktreeinclude`| Project only| ✓| Gitignored files to copy into new worktrees| [Worktrees](</docs/en/worktrees#copy-gitignored-files-into-worktrees>)
`skills/<name>/SKILL.md`| Project and global| ✓| Reusable prompts invoked with `/name` or auto-invoked| [Skills](</docs/en/skills>)
`commands/*.md`| Project and global| ✓| Single-file prompts; same mechanism as skills| [Skills](</docs/en/skills>)
-`output-styles/*.md`| Project and global| ✓| Custom system-prompt sections| [Output styles](</docs/en/output-styles>)
+`output-styles/*.md`| Project and global| ✓| Custom instruction sets that adjust how Claude works| [Output styles](</docs/en/output-styles>)
`agents/*.md`| Project and global| ✓| Subagent definitions with their own prompt and tools| [Subagents](</docs/en/sub-agents>)
`workflows/*.js`| Project and global| ✓| Dynamic workflow scripts written by Claude and saved from `/workflows`; each file becomes a `/<name>` command| [Dynamic workflows](</docs/en/workflows>)
`agent-memory/<name>/`| Project and global| ✓| Persistent memory for subagents| [Persistent memory](</docs/en/sub-agents#enable-persistent-memory>)
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -114,12 +114,12 @@
`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](</docs/en/checkpointing>). Holds snapshots for the 100 most recent checkpoints; snapshot files that no retained checkpoint references are deleted, except each file’s first snapshot
`plans/`| Plan files written during [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>)
-`debug/`| Per-session debug logs, written only when you start with `--debug` or run `/debug`
+`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`
`paste-cache/`| Contents of large pastes
`image-cache/<session>/`| Attached images. On each sweep, Claude Code removes the directories of all other sessions, whatever their age.
`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>) session. An attachment to a [cloud session](</docs/en/claude-code-on-the-web>) is saved in that session’s own cloud environment instead, not on your machine.
`session-env/`| Per-session environment metadata
-`tasks/`| Per-session task lists written by the task tools
+`tasks/`| Task lists written by the task tools, one directory per list
`shell-snapshots/`| Aliases, functions, and shell options captured at startup and applied by the [Bash tool](</docs/en/tools-reference#bash-tool-behavior>) to each command. Removed on clean exit. The sweep clears any left after a crash.
`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.
`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
@@ -130,7 +130,7 @@
Session files in `sessions/`, auto memory, and Claude Desktop and Cowork transcripts each follow their own retention rule:
* **`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.
- * **Auto memory** : Claude Code excludes a project’s [auto memory](</docs/en/memory#auto-memory>) directory, `projects/<project>/memory/`, from this sweep, and removes the directory itself only after 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.
+ * **Auto memory** : the sweep doesn’t delete the memory files in a project’s [auto memory](</docs/en/memory#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.
* **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>). When [managed settings](</docs/en/managed-settings>) set `cleanupPeriodDays`, Claude Code deletes these transcripts after that period instead. Requires Claude Code v2.1.248 or later; earlier versions delete them after `cleanupPeriodDays`.
Claude Code skips the sweep entirely in these cases:
@@ -144,17 +144,21 @@
Kept until you delete them
-The retention cleanup sweep doesn’t cover the following paths. Claude Code keeps them until you delete them, apart from the two caches whose rows say that logging out deletes them.
+The retention cleanup sweep doesn’t remove the paths below. Claude Code keeps them until you delete them, apart from the two caches it deletes when you log out.
Path under `~/.claude/`| Contents
---|---
-`history.jsonl`| Every prompt you’ve typed, with timestamp and project path. Used for up-arrow recall.
+`history.jsonl`| Every prompt you’ve typed, with timestamp and project path. Used for up-arrow recall, `Ctrl+R` history search, and `!` shell-command completion.
`stats-cache.json`| Aggregated token and cost counts shown by `/usage`
`remote-settings.json`| Cached copy of [server-managed settings](</docs/en/server-managed-settings>) for your organization, or `{}` when your organization has configured none. Only present when the session [fetches them](</docs/en/server-managed-settings#platform-availability>). Claude Code checks for updates at startup and hourly during a session. Claude Code deletes it when you log out.
`cache/changelog.md`| Cached copy of the Claude Code changelog, shown by `/release-notes`. Refreshed in the background.
`policy-limits.json`| Cached feature policy settings for your organization. Only present for some account types. Refreshed automatically. Claude Code deletes it when you log out.
-Other small cache and lock files appear depending on which features you use and are safe to delete.
+Other files appear depending on which features you use. Caches and lock files are safe to delete. Keep these state files:
+
+ * `.credentials.json`: your [login credentials](</docs/en/authentication#credential-management>)
+ * `agent-memory/`: [subagent memory](</docs/en/sub-agents#enable-persistent-memory>)
+ * `jobs/` and `daemon/`: [background session](</docs/en/agent-view#where-state-is-stored>) state
###
@@ -209,12 +213,12 @@
claude project purge ~/work/my-repo --yes
-Pass `--all` instead of a path to purge state for every project at once, which deletes `history.jsonl` outright rather than filtering it. Pass `-i` to step through the deletion plan one item at a time. The command leaves `shell-snapshots/` and `backups/` alone because those are not project-scoped, and warns about them in the plan output. You can also delete any of the application-data paths above by hand. New sessions are unaffected. The table below shows what you lose for past sessions.
+Pass `--all` instead of a path to purge state for every project at once, which deletes `history.jsonl` outright rather than filtering it. Pass `-i` to step through the deletion plan one item at a time. The command leaves `shell-snapshots/` and `backups/` alone because those are not project-scoped, and warns about them in the plan output. You can also delete any of the application-data paths above by hand, apart from the state files to keep. 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, and auto memory for every project
-`~/.claude/history.jsonl`| Up-arrow prompt recall
+`~/.claude/history.jsonl`| Up-arrow prompt recall, `Ctrl+R` history search, and `!` shell-command completion
`~/.claude/paste-cache/`| Pasted text in recalled prompts; see [paste large content](</docs/en/terminal-config#paste-large-content>)
`~/.claude/uploads/`| Attachments that past [Remote Control](</docs/en/remote-control>) sessions refer to by path
`~/.claude/file-history/`| Checkpoint restore for past sessions
@@ -225,7 +229,8 @@
`~/.claude/remote-settings.json`| Nothing. Re-fetched on next launch.
`~/.claude/cache/changelog.md`| Nothing. Refreshed in the background.
`~/.claude/policy-limits.json`| Nothing. Refreshed automatically.
-`~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/image-cache/`, `~/.claude/session-env/`, `~/.claude/tasks/`, `~/.claude/shell-snapshots/`, `~/.claude/backups/`| Nothing user-facing
+`~/.claude/tasks/`| Task lists that a resumed session would pick up
+`~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/image-cache/`, `~/.claude/session-env/`, `~/.claude/shell-snapshots/`, `~/.claude/backups/`| Nothing user-facing
`~/.claude/todos/`, `~/.claude/statsig/`, `~/.claude/logs/`| Nothing. Legacy directories not written by current versions.
Don’t delete `~/.claude.json`, `~/.claude/settings.json`, or `~/.claude/plugins/`: those hold your auth, preferences, and installed plugins.
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -109,6 +109,7 @@
Path under `~/.claude/`| Contents
---|---
`projects/<project>/<session>.jsonl`| Full conversation transcript: every message, tool call, and tool result
+`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
`projects/<project>/<session>/subagents/`| [Subagent](</docs/en/sub-agents>) conversation transcripts, removed with the parent session transcript when it ages out
`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](</docs/en/checkpointing>). Holds snapshots for the 100 most recent checkpoints; snapshot files that no retained checkpoint references are deleted, except each file’s first snapshot
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -126,12 +126,16 @@
`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
`todos/`, `statsig/`, `logs/`| Legacy directories from older versions. No longer written. The sweep removes their contents and then the empty directory.
-Claude Code makes four exceptions to this sweep:
+Session files in `sessions/`, auto memory, and Claude Desktop and Cowork transcripts each follow their own retention rule:
* **`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.
* **Auto memory** : Claude Code excludes a project’s [auto memory](</docs/en/memory#auto-memory>) directory, `projects/<project>/memory/`, from this sweep, and removes the directory itself only after 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.
+ * **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>). When [managed settings](</docs/en/managed-settings>) set `cleanupPeriodDays`, Claude Code deletes these transcripts after that period instead. Requires Claude Code v2.1.248 or later; earlier versions delete them after `cleanupPeriodDays`.
+
+Claude Code skips the sweep entirely in these cases:
+
* **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.
- * **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` explicitly set, Claude Code also shows a warning in `/status` until you fix the settings errors. When [managed settings](</docs/en/server-managed-settings>) provide `cleanupPeriodDays`, Claude Code runs the sweep at the managed value in either case.
+ * **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>) provide `cleanupPeriodDays`, Claude Code runs the sweep at the managed value in either case.
###
@@ -159,7 +163,8 @@
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:
- * Lower `cleanupPeriodDays` to shorten how long transcripts are kept
+ * Lower `cleanupPeriodDays` to shorten how long Claude Code keeps transcripts
+ * Set [`desktopSessionCleanupPeriodDays`](</docs/en/settings-reference#desktopsessioncleanupperioddays>) to give Claude Desktop and Cowork transcripts an age limit too
* 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.
* Use [permission rules](</docs/en/permissions>) to deny reads of credential files
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -146,7 +146,7 @@
`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 `/usage`
`remote-settings.json`| Cached copy of [server-managed settings](</docs/en/server-managed-settings>) for your organization, or `{}` when your organization has configured none. Only present when the session [fetches them](</docs/en/server-managed-settings#platform-availability>). Claude Code checks for updates at startup and hourly during a session. Claude Code deletes it when you log out.
-`cache/changelog.md`| Cached copy of the Claude Code changelog, used to show release notes after an update. Refreshed in the background.
+`cache/changelog.md`| Cached copy of the Claude Code changelog, shown by `/release-notes`. Refreshed in the background.
`policy-limits.json`| Cached feature policy settings for your organization. Only present for some account types. Refreshed automatically. Claude Code deletes it when you log out.
Other small cache and lock files appear depending on which features you use and are safe to delete.
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -122,6 +122,7 @@
`shell-snapshots/`| Aliases, functions, and shell options captured at startup and applied by the [Bash tool](</docs/en/tools-reference#bash-tool-behavior>) to each command. Removed on clean exit. The sweep clears any left after a crash.
`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.
`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
+`feedback/drafts/`| Queued [Claude-drafted feedback](</docs/en/tools-reference#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.
`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
`todos/`, `statsig/`, `logs/`| Legacy directories from older versions. No longer written. The sweep removes their contents and then the empty directory.
@@ -214,6 +215,7 @@
`~/.claude/stats-cache.json`| Historical totals shown by `/usage`
`~/.claude/usage-data/`| Past [`/insights`](</docs/en/costs#analyze-your-usage-patterns>) reports and the cached analysis data used to build them
`~/.claude/feedback-bundles/`| Feedback and bug-report archives you haven’t yet sent to your Anthropic account team
+`~/.claude/feedback/drafts/`| [Claude-drafted feedback](</docs/en/tools-reference#sendfeedback-tool-behavior>) you haven’t sent
`~/.claude/remote-settings.json`| Nothing. Re-fetched on next launch.
`~/.claude/cache/changelog.md`| Nothing. Refreshed in the background.
`~/.claude/policy-limits.json`| Nothing. Refreshed automatically.
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -18,7 +18,7 @@
File| Location| Purpose
---|---|---
-`managed-settings.json`| System-level, varies by OS| Enterprise-enforced settings that you can’t override, apart from [narrow exceptions](</docs/en/settings#exceptions-to-managed-settings-precedence>). See [server-managed settings](</docs/en/server-managed-settings>).
+`managed-settings.json`| System-level, varies by OS| Enterprise-enforced settings that you can’t override, apart from [narrow exceptions](</docs/en/settings#security-keys-where-the-stricter-value-applies>). See [where to save the file](</docs/en/managed-settings#deploy-a-managed-settings-file>) and [which managed source Claude Code uses](</docs/en/managed-settings#precedence-within-the-managed-tier>).
`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. For a plugin installed from a marketplace [`command` source](</docs/en/plugin-marketplaces#command-sources>) in link mode, Claude Code stores links here instead of a copy, and the plugin’s files stay in the directory the command prints. See [plugin caching](</docs/en/plugins-reference#plugin-caching-and-file-resolution>) for how orphaned versions are cleaned up.
@@ -37,8 +37,8 @@
Give Claude project context and conventions| `CLAUDE.md`| project or global| [Memory](</docs/en/memory>)
Allow or block specific tool calls| `settings.json` `permissions` or `hooks`| project or global| [Permissions](</docs/en/permissions>), [Hooks](</docs/en/hooks>)
Run a script before or after tool calls| `settings.json` `hooks`| project or global| [Hooks](</docs/en/hooks>)
-Set environment variables for the session| `settings.json` `env`| project or global| [Settings](</docs/en/settings#available-settings>)
-Keep personal overrides out of git| `settings.local.json`| project only| [Settings scopes](</docs/en/settings#settings-files>)
+Set environment variables for the session| `settings.json` `env`| project or global| [Settings](</docs/en/settings-reference#all-settings>)
+Keep personal overrides out of git| `settings.local.json`| project only| [Settings scopes](</docs/en/settings#where-settings-live>)
Add a prompt or capability you invoke with `/name`| `skills/<name>/SKILL.md`| project or global| [Skills](</docs/en/skills>)
Define a specialized subagent with its own tools| `agents/*.md`| project or global| [Subagents](</docs/en/sub-agents>)
Orchestrate many subagents from a script| `workflows/*.js`| project or global| [Dynamic workflows](</docs/en/workflows>)
@@ -68,7 +68,7 @@
`CLAUDE.md`| Project and global| ✓| Instructions loaded every session| [Memory](</docs/en/memory>)
`rules/*.md`| Project and global| ✓| Topic-scoped instructions, optionally path-gated| [Rules](</docs/en/memory#organize-rules-with-claude/rules/>)
`settings.json`| Project and global| ✓| Permissions, hooks, env vars, model defaults| [Settings](</docs/en/settings>)
-`settings.local.json`| Project only| | Your personal overrides, gitignored when Claude Code saves a setting to it| [Settings scopes](</docs/en/settings#settings-files>)
+`settings.local.json`| Project only| | Your personal overrides, gitignored when Claude Code saves a setting to it| [Settings scopes](</docs/en/settings#where-settings-live>)
`.mcp.json`| Project only| ✓| Team-shared MCP servers| [MCP scopes](</docs/en/mcp#mcp-installation-scopes>)
`.worktreeinclude`| Project only| ✓| Gitignored files to copy into new worktrees| [Worktrees](</docs/en/worktrees#copy-gitignored-files-into-worktrees>)
`skills/<name>/SKILL.md`| Project and global| ✓| Reusable prompts invoked with `/name` or auto-invoked| [Skills](</docs/en/skills>)
@@ -77,7 +77,7 @@
`agents/*.md`| Project and global| ✓| Subagent definitions with their own prompt and tools| [Subagents](</docs/en/sub-agents>)
`workflows/*.js`| Project and global| ✓| Dynamic workflow scripts written by Claude and saved from `/workflows`; each file becomes a `/<name>` command| [Dynamic workflows](</docs/en/workflows>)
`agent-memory/<name>/`| Project and global| ✓| Persistent memory for subagents| [Persistent memory](</docs/en/sub-agents#enable-persistent-memory>)
-`~/.claude.json`| Global only| | App state, OAuth, UI toggles, personal MCP servers| [Global config](</docs/en/settings#global-config-settings>)
+`~/.claude.json`| Global only| | App state, OAuth, UI toggles, personal MCP servers| [Global config](</docs/en/settings-reference#global-config-settings>)
`projects/<project>/memory/`| Global only| | Auto memory: Claude’s notes to itself across sessions| [Auto memory](</docs/en/memory#auto-memory>)
`keybindings.json`| Global only| | Custom keyboard shortcuts| [Keybindings](</docs/en/keybindings>)
`themes/*.json`| Global only| | Custom color themes| [Custom themes](</docs/en/terminal-config#create-a-custom-theme>)
@@ -104,7 +104,7 @@
Cleaned up automatically
-Claude Code deletes the files in the paths below once they’re older than [`cleanupPeriodDays`](</docs/en/settings#available-settings>), 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#clean-up-subagent-and-background-session-worktrees>).
+Claude 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#clean-up-subagent-and-background-session-worktrees>).
Path under `~/.claude/`| Contents
---|---
@@ -114,11 +114,13 @@
`file-history/<session>/`| Pre-edit snapshots of files Claude changed, used for [checkpoint restore](</docs/en/checkpointing>). Holds snapshots for the 100 most recent checkpoints; snapshot files that no retained checkpoint references are deleted, except each file’s first snapshot
`plans/`| Plan files written during [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-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
+`paste-cache/`| Contents of large pastes
+`image-cache/<session>/`| Attached images. On each sweep, Claude Code removes the directories of all other sessions, whatever their age.
+`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>) session. An attachment to a [cloud session](</docs/en/claude-code-on-the-web>) is saved in that session’s own cloud environment instead, not on your machine.
`session-env/`| Per-session environment metadata
`tasks/`| Per-session task lists written by the task tools
`shell-snapshots/`| Aliases, functions, and shell options captured at startup and applied by the [Bash tool](</docs/en/tools-reference#bash-tool-behavior>) to each command. Removed on clean exit. The sweep clears any left after a crash.
-`backups/`| Timestamped copies of `~/.claude.json` taken before config migrations
+`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.
`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
`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
`todos/`, `statsig/`, `logs/`| Legacy directories from older versions. No longer written. The sweep removes their contents and then the empty directory.
@@ -136,15 +138,15 @@
Kept until you delete them
-The following paths are not covered by automatic cleanup and persist indefinitely.
+The retention cleanup sweep doesn’t cover the following paths. Claude Code keeps them until you delete them, apart from the two caches whose rows say that logging out deletes them.
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 `/usage`
-`remote-settings.json`| Cached copy of [server-managed settings](</docs/en/server-managed-settings>) for your organization. Only present when your organization has configured them. Refreshed on each launch.
+`remote-settings.json`| Cached copy of [server-managed settings](</docs/en/server-managed-settings>) for your organization, or `{}` when your organization has configured none. Only present when the session [fetches them](</docs/en/server-managed-settings#platform-availability>). Claude Code checks for updates at startup and hourly during a session. Claude Code deletes it when you log out.
`cache/changelog.md`| Cached copy of the Claude Code changelog, used to show release notes after an update. Refreshed in the background.
-`policy-limits.json`| Cached feature policy settings for your organization. Only present for some account types. Refreshed automatically.
+`policy-limits.json`| Cached feature policy settings for your organization. Only present for some account types. Refreshed automatically. Claude Code deletes it when you log out.
Other small cache and lock files appear depending on which features you use and are safe to delete.
@@ -207,6 +209,7 @@
`~/.claude/projects/`| Resume, continue, and rewind for past sessions, and auto memory for every project
`~/.claude/history.jsonl`| Up-arrow prompt recall
`~/.claude/paste-cache/`| Pasted text in recalled prompts; see [paste large content](</docs/en/terminal-config#paste-large-content>)
+`~/.claude/uploads/`| Attachments that past [Remote Control](</docs/en/remote-control>) sessions refer to by path
`~/.claude/file-history/`| Checkpoint restore for past sessions
`~/.claude/stats-cache.json`| Historical totals shown by `/usage`
`~/.claude/usage-data/`| Past [`/insights`](</docs/en/costs#analyze-your-usage-patterns>) reports and the cached analysis data used to build them
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -18,9 +18,9 @@
File| Location| Purpose
---|---|---
-`managed-settings.json`| System-level, varies by OS| Enterprise-enforced settings that you can’t override, apart from [narrow exceptions](</docs/en/settings#settings-precedence>). See [server-managed settings](</docs/en/server-managed-settings>).
+`managed-settings.json`| System-level, varies by OS| Enterprise-enforced settings that you can’t override, apart from [narrow exceptions](</docs/en/settings#exceptions-to-managed-settings-precedence>). See [server-managed settings](</docs/en/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. See [plugin caching](</docs/en/plugins-reference#plugin-caching-and-file-resolution>) for how orphaned versions are cleaned up.
+Installed plugins| `~/.claude/plugins`| Cloned marketplaces, installed plugin versions, and per-plugin data, managed by `claude plugin` commands. For a plugin installed from a marketplace [`command` source](</docs/en/plugin-marketplaces#command-sources>) in link mode, Claude Code stores links here instead of a copy, and the plugin’s files stay in the directory the command prints. See [plugin caching](</docs/en/plugins-reference#plugin-caching-and-file-resolution>) for how orphaned versions are cleaned up.
`~/.claude` also holds data Claude Code writes as you work: transcripts, prompt history, file snapshots, caches, and logs. See application data below.
@@ -55,7 +55,7 @@
Several things can override what you put in these files:
- * [Managed settings](</docs/en/server-managed-settings>) deployed by your organization take precedence over everything, apart from the [exceptions under Settings precedence](</docs/en/settings#settings-precedence>)
+ * [Managed settings](</docs/en/server-managed-settings>) deployed by your organization take precedence over everything, apart from the [exceptions under Settings precedence](</docs/en/settings#exceptions-to-managed-settings-precedence>)
* CLI flags like `--permission-mode` or `--settings` override `settings.json` for that session
* Some environment variables take precedence over their equivalent setting, but this varies: check the [environment variables reference](</docs/en/env-vars>) for each one
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -123,7 +123,12 @@
`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
`todos/`, `statsig/`, `logs/`| Legacy directories from older versions. No longer written. The sweep removes their contents and then the empty directory.
-`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. 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. 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` explicitly set, Claude Code also shows a warning in `/status` until you fix the settings errors. When [managed settings](</docs/en/server-managed-settings>) provide `cleanupPeriodDays`, Claude Code runs the sweep at the managed value in either case.
+Claude Code makes four exceptions to this sweep:
+
+ * **`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.
+ * **Auto memory** : Claude Code excludes a project’s [auto memory](</docs/en/memory#auto-memory>) directory, `projects/<project>/memory/`, from this sweep, and removes the directory itself only after 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.
+ * **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.
+ * **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` explicitly set, Claude Code also shows a warning in `/status` until you fix the settings errors. When [managed settings](</docs/en/server-managed-settings>) provide `cleanupPeriodDays`, Claude Code runs the sweep at the managed value in either case.
###
@@ -199,7 +204,7 @@
Delete| You lose
---|---
-`~/.claude/projects/`| Resume, continue, and rewind for past sessions
+`~/.claude/projects/`| Resume, continue, and rewind for past sessions, and auto memory for every project
`~/.claude/history.jsonl`| Up-arrow prompt recall
`~/.claude/paste-cache/`| Pasted text in recalled prompts; see [paste large content](</docs/en/terminal-config#paste-large-content>)
`~/.claude/file-history/`| Checkpoint restore for past sessions
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -20,7 +20,7 @@
---|---|---
`managed-settings.json`| System-level, varies by OS| Enterprise-enforced settings that you can’t override, apart from [narrow exceptions](</docs/en/settings#settings-precedence>). See [server-managed settings](</docs/en/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 14 days after a plugin update or uninstall. See [plugin caching](</docs/en/plugins-reference#plugin-caching-and-file-resolution>).
+Installed plugins| `~/.claude/plugins`| Cloned marketplaces, installed plugin versions, and per-plugin data, managed by `claude plugin` commands. See [plugin caching](</docs/en/plugins-reference#plugin-caching-and-file-resolution>) for how orphaned versions are cleaned up.
`~/.claude` also holds data Claude Code writes as you work: transcripts, prompt history, file snapshots, caches, and logs. See application data below.
@@ -104,7 +104,7 @@
Cleaned up automatically
-Files in the paths below are deleted on startup once they’re older than [`cleanupPeriodDays`](</docs/en/settings#available-settings>). 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#clean-up-subagent-and-background-session-worktrees>).
+Claude Code deletes the files in the paths below once they’re older than [`cleanupPeriodDays`](</docs/en/settings#available-settings>), 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#clean-up-subagent-and-background-session-worktrees>).
Path under `~/.claude/`| Contents
---|---
@@ -120,9 +120,10 @@
`shell-snapshots/`| Aliases, functions, and shell options captured at startup and applied by the [Bash tool](</docs/en/tools-reference#bash-tool-behavior>) to each command. Removed on clean exit. The sweep clears any left after a crash.
`backups/`| Timestamped copies of `~/.claude.json` taken before config migrations
`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
+`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
`todos/`, `statsig/`, `logs/`| Legacy directories from older versions. No longer written. The sweep removes their contents and then the empty directory.
-`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. If Claude Code can’t read or parse a settings file, it pauses the retention cleanup sweep and shows a warning in `/status` until you fix the file, unless [managed settings](</docs/en/server-managed-settings>) provide `cleanupPeriodDays`, in which case the sweep runs at the managed value. Before v2.1.203, cleanup ran at the 30-day default in that state and could delete transcripts a longer `cleanupPeriodDays` was meant to keep; files newer than 30 days were never removed.
+`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. 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. 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` explicitly set, Claude Code also shows a warning in `/status` until you fix the settings errors. When [managed settings](</docs/en/server-managed-settings>) provide `cleanupPeriodDays`, Claude Code runs the sweep at the managed value in either case.
###
@@ -203,6 +204,8 @@
`~/.claude/paste-cache/`| Pasted text in recalled prompts; see [paste large content](</docs/en/terminal-config#paste-large-content>)
`~/.claude/file-history/`| Checkpoint restore for past sessions
`~/.claude/stats-cache.json`| Historical totals shown by `/usage`
+`~/.claude/usage-data/`| Past [`/insights`](</docs/en/costs#analyze-your-usage-patterns>) reports and the cached analysis data used to build them
+`~/.claude/feedback-bundles/`| Feedback and bug-report archives you haven’t yet sent to your Anthropic account team
`~/.claude/remote-settings.json`| Nothing. Re-fetched on next launch.
`~/.claude/cache/changelog.md`| Nothing. Refreshed in the background.
`~/.claude/policy-limits.json`| Nothing. Refreshed automatically.
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -104,7 +104,7 @@
Cleaned up automatically
-Files in the paths below are deleted on startup once they’re older than [`cleanupPeriodDays`](</docs/en/settings#available-settings>). The default is 30 days.
+Files in the paths below are deleted on startup once they’re older than [`cleanupPeriodDays`](</docs/en/settings#available-settings>). 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#clean-up-subagent-and-background-session-worktrees>).
Path under `~/.claude/`| Contents
---|---
@@ -122,7 +122,7 @@
`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
`todos/`, `statsig/`, `logs/`| Legacy directories from older versions. No longer written. The sweep removes their contents and then the empty directory.
-`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.
+`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. If Claude Code can’t read or parse a settings file, it pauses the retention cleanup sweep and shows a warning in `/status` until you fix the file, unless [managed settings](</docs/en/server-managed-settings>) provide `cleanupPeriodDays`, in which case the sweep runs at the managed value. Before v2.1.203, cleanup ran at the 30-day default in that state and could delete transcripts a longer `cleanupPeriodDays` was meant to keep; files newer than 30 days were never removed.
###
@@ -151,7 +151,7 @@
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:
* Lower `cleanupPeriodDays` to shorten how long transcripts are kept
- * 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 Agent SDK.
+ * 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.
* Use [permission rules](</docs/en/permissions>) to deny reads of credential files
###
@@ -200,12 +200,13 @@
---|---
`~/.claude/projects/`| Resume, continue, and rewind for past sessions
`~/.claude/history.jsonl`| Up-arrow prompt recall
+`~/.claude/paste-cache/`| Pasted text in recalled prompts; see [paste large content](</docs/en/terminal-config#paste-large-content>)
`~/.claude/file-history/`| Checkpoint restore for past sessions
`~/.claude/stats-cache.json`| Historical totals shown by `/usage`
`~/.claude/remote-settings.json`| Nothing. Re-fetched on next launch.
`~/.claude/cache/changelog.md`| Nothing. Refreshed in the background.
`~/.claude/policy-limits.json`| Nothing. Refreshed automatically.
-`~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/paste-cache/`, `~/.claude/image-cache/`, `~/.claude/session-env/`, `~/.claude/tasks/`, `~/.claude/shell-snapshots/`, `~/.claude/backups/`| Nothing user-facing
+`~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/image-cache/`, `~/.claude/session-env/`, `~/.claude/tasks/`, `~/.claude/shell-snapshots/`, `~/.claude/backups/`| Nothing user-facing
`~/.claude/todos/`, `~/.claude/statsig/`, `~/.claude/logs/`| Nothing. Legacy directories not written by current versions.
Don’t delete `~/.claude.json`, `~/.claude/settings.json`, or `~/.claude/plugins/`: those hold your auth, preferences, and installed plugins.
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -160,7 +160,7 @@
Clear local data
-Run `claude project purge` to delete the state Claude Code holds for one project. The command requires Claude Code v2.1.124 or later. It deletes:
+Run `claude project purge` to delete the state Claude Code holds for one project. It deletes:
* Transcripts and auto memory under `projects/`
* Per-session `tasks/`, `debug/`, and `file-history/` entries
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -18,7 +18,7 @@
File| Location| Purpose
---|---|---
-`managed-settings.json`| System-level, varies by OS| Enterprise-enforced settings that you can’t override. See [server-managed settings](</docs/en/server-managed-settings>).
+`managed-settings.json`| System-level, varies by OS| Enterprise-enforced settings that you can’t override, apart from [narrow exceptions](</docs/en/settings#settings-precedence>). See [server-managed settings](</docs/en/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 14 days after a plugin update or uninstall. See [plugin caching](</docs/en/plugins-reference#plugin-caching-and-file-resolution>).
@@ -55,7 +55,7 @@
Several things can override what you put in these files:
- * [Managed settings](</docs/en/server-managed-settings>) deployed by your organization take precedence over everything
+ * [Managed settings](</docs/en/server-managed-settings>) deployed by your organization take precedence over everything, apart from the [exceptions under Settings precedence](</docs/en/settings#settings-precedence>)
* CLI flags like `--permission-mode` or `--settings` override `settings.json` for that session
* Some environment variables take precedence over their equivalent setting, but this varies: check the [environment variables reference](</docs/en/env-vars>) for each one
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -68,7 +68,7 @@
`CLAUDE.md`| Project and global| ✓| Instructions loaded every session| [Memory](</docs/en/memory>)
`rules/*.md`| Project and global| ✓| Topic-scoped instructions, optionally path-gated| [Rules](</docs/en/memory#organize-rules-with-claude/rules/>)
`settings.json`| Project and global| ✓| Permissions, hooks, env vars, model defaults| [Settings](</docs/en/settings>)
-`settings.local.json`| Project only| | Your personal overrides, gitignored when Claude Code creates it| [Settings scopes](</docs/en/settings#settings-files>)
+`settings.local.json`| Project only| | Your personal overrides, gitignored when Claude Code saves a setting to it| [Settings scopes](</docs/en/settings#settings-files>)
`.mcp.json`| Project only| ✓| Team-shared MCP servers| [MCP scopes](</docs/en/mcp#mcp-installation-scopes>)
`.worktreeinclude`| Project only| ✓| Gitignored files to copy into new worktrees| [Worktrees](</docs/en/worktrees#copy-gitignored-files-into-worktrees>)
`skills/<name>/SKILL.md`| Project and global| ✓| Reusable prompts invoked with `/name` or auto-invoked| [Skills](</docs/en/skills>)
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -20,7 +20,7 @@
---|---|---
`managed-settings.json`| System-level, varies by OS| Enterprise-enforced settings that you can’t override. See [server-managed settings](</docs/en/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](</docs/en/plugins-reference#plugin-caching-and-file-resolution>).
+Installed plugins| `~/.claude/plugins`| Cloned marketplaces, installed plugin versions, and per-plugin data, managed by `claude plugin` commands. Orphaned versions are deleted 14 days after a plugin update or uninstall. See [plugin caching](</docs/en/plugins-reference#plugin-caching-and-file-resolution>).
`~/.claude` also holds data Claude Code writes as you work: transcripts, prompt history, file snapshots, caches, and logs. See application data below.
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -122,6 +122,8 @@
`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
`todos/`, `statsig/`, `logs/`| Legacy directories from older versions. No longer written. The sweep removes their contents and then the empty directory.
+`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.
+
###
@@ -135,6 +137,8 @@
`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 `/usage`
`remote-settings.json`| Cached copy of [server-managed settings](</docs/en/server-managed-settings>) for your organization. Only present when your organization has configured them. Refreshed on each launch.
+`cache/changelog.md`| Cached copy of the Claude Code changelog, used to show release notes after an update. Refreshed in the background.
+`policy-limits.json`| Cached feature policy settings for your organization. Only present for some account types. Refreshed automatically.
Other small cache and lock files appear depending on which features you use and are safe to delete.
@@ -163,19 +167,34 @@
* Matching prompt lines in `history.jsonl`
* The project’s entry in `~/.claude.json`
-The command prints the full deletion plan and asks for confirmation before removing anything. Preview the plan without deleting anything:
+The command prints the full deletion plan and asks for confirmation before removing anything. The examples below use `~/work/my-repo` as a placeholder. Replace it with the path to your project. If no state matches the path, the command prints an error and exits with status 1. Preview the plan without deleting anything:
claude project purge ~/work/my-repo --dry-run
+The plan lists each matching item and why it is included:
+
+ Purge plan for /home/user/work/my-repo:
+
+ dir: /home/user/.claude/projects/-home-user-work-my-repo
+ project transcripts (.jsonl) and memory/
+ config: projects["/home/user/work/my-repo"]
+ project entry in ~/.claude.json (trust, history, MCP servers)
+ filter: /home/user/.claude/history.jsonl
+ 12 prompt(s) typed in this project
+
+ shell-snapshots/ are not project-scoped and will not be touched
+ backups/ may still contain this project entry in old .claude.json snapshots (/home/user/.claude/backups); at most 5 are kept and they rotate out automatically
+ Dry run: 3 item(s) would be deleted.
+
Delete with a single confirmation prompt:
claude project purge ~/work/my-repo
-Omit the path to pick a project from an interactive list. Skip the confirmation prompt for use in scripts:
+The command prints the same plan, then asks `Delete 3 item(s) for /home/user/work/my-repo? This cannot be undone. [y/N]` and deletes only if you answer `y`. Omit the path to pick a project from an interactive list. Skip the confirmation prompt for use in scripts:
claude project purge ~/work/my-repo --yes
-Pass `--all` instead of a path to purge state for every project at once, which deletes `history.jsonl` outright rather than filtering it. Pass `-i` to step through the deletion plan one item at a time. The command leaves `shell-snapshots/` and `backups/` alone because those are not project-scoped, and warns about them in the plan output. It exits with status 1 if no state matches the given path. You can also delete any of the application-data paths above by hand. New sessions are unaffected. The table below shows what you lose for past sessions.
+Pass `--all` instead of a path to purge state for every project at once, which deletes `history.jsonl` outright rather than filtering it. Pass `-i` to step through the deletion plan one item at a time. The command leaves `shell-snapshots/` and `backups/` alone because those are not project-scoped, and warns about them in the plan output. You can also delete any of the application-data paths above by hand. New sessions are unaffected. The table below shows what you lose for past sessions.
Delete| You lose
---|---
@@ -184,6 +203,8 @@
`~/.claude/file-history/`| Checkpoint restore for past sessions
`~/.claude/stats-cache.json`| Historical totals shown by `/usage`
`~/.claude/remote-settings.json`| Nothing. Re-fetched on next launch.
+`~/.claude/cache/changelog.md`| Nothing. Refreshed in the background.
+`~/.claude/policy-limits.json`| Nothing. Refreshed automatically.
`~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/paste-cache/`, `~/.claude/image-cache/`, `~/.claude/session-env/`, `~/.claude/tasks/`, `~/.claude/shell-snapshots/`, `~/.claude/backups/`| Nothing user-facing
`~/.claude/todos/`, `~/.claude/statsig/`, `~/.claude/logs/`| Nothing. Legacy directories not written by current versions.
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -117,7 +117,7 @@
`paste-cache/`, `image-cache/`| Contents of large pastes and attached images
`session-env/`| Per-session environment metadata
`tasks/`| Per-session task lists written by the task tools
-`shell-snapshots/`| Captured shell environment used by the Bash tool. Removed on clean exit. The sweep clears any left after a crash.
+`shell-snapshots/`| Aliases, functions, and shell options captured at startup and applied by the [Bash tool](</docs/en/tools-reference#bash-tool-behavior>) to each command. Removed on clean exit. The sweep clears any left after a crash.
`backups/`| Timestamped copies of `~/.claude.json` taken before config migrations
`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
`todos/`, `statsig/`, `logs/`| Legacy directories from older versions. No longer written. The sweep removes their contents and then the empty directory.
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -111,7 +111,7 @@
`projects/<project>/<session>.jsonl`| Full conversation transcript: every message, tool call, and tool result
`projects/<project>/<session>/subagents/`| [Subagent](</docs/en/sub-agents>) conversation transcripts, removed with the parent session transcript when it ages out
`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](</docs/en/checkpointing>)
+`file-history/<session>/`| Pre-edit snapshots of files Claude changed, used for [checkpoint restore](</docs/en/checkpointing>). Holds snapshots for the 100 most recent checkpoints; snapshot files that no retained checkpoint references are deleted, except each file’s first snapshot
`plans/`| Plan files written during [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-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
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -119,7 +119,7 @@
`tasks/`| Per-session task lists written by the task tools
`shell-snapshots/`| Captured shell environment used by the Bash tool. Removed on clean exit. The sweep clears any left after a crash.
`backups/`| Timestamped copies of `~/.claude.json` taken before config migrations
-`feedback-bundles/`| Redacted transcript archives written by `/feedback` on third-party providers, for sending to your Anthropic account team
+`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
`todos/`, `statsig/`, `logs/`| Legacy directories from older versions. No longer written. The sweep removes their contents and then the empty directory.
###
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -68,7 +68,7 @@
`CLAUDE.md`| Project and global| ✓| Instructions loaded every session| [Memory](</docs/en/memory>)
`rules/*.md`| Project and global| ✓| Topic-scoped instructions, optionally path-gated| [Rules](</docs/en/memory#organize-rules-with-claude/rules/>)
`settings.json`| Project and global| ✓| Permissions, hooks, env vars, model defaults| [Settings](</docs/en/settings>)
-`settings.local.json`| Project only| | Your personal overrides, auto-gitignored| [Settings scopes](</docs/en/settings#settings-files>)
+`settings.local.json`| Project only| | Your personal overrides, gitignored when Claude Code creates it| [Settings scopes](</docs/en/settings#settings-files>)
`.mcp.json`| Project only| ✓| Team-shared MCP servers| [MCP scopes](</docs/en/mcp#mcp-installation-scopes>)
`.worktreeinclude`| Project only| ✓| Gitignored files to copy into new worktrees| [Worktrees](</docs/en/worktrees#copy-gitignored-files-into-worktrees>)
`skills/<name>/SKILL.md`| Project and global| ✓| Reusable prompts invoked with `/name` or auto-invoked| [Skills](</docs/en/skills>)
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -1,9 +1,3 @@
-> ## 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.
-
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. On 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. 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.
##
@@ -162,7 +156,7 @@
Clear local data
-Run `claude project purge` to delete the state Claude Code holds for one project:
+Run `claude project purge` to delete the state Claude Code holds for one project. The command requires Claude Code v2.1.124 or later. It deletes:
* Transcripts and auto memory under `projects/`
* Per-session `tasks/`, `debug/`, and `file-history/` entries
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -47,6 +47,7 @@
Keep personal overrides out of git| `settings.local.json`| project only| [Settings scopes](</docs/en/settings#settings-files>)
Add a prompt or capability you invoke with `/name`| `skills/<name>/SKILL.md`| project or global| [Skills](</docs/en/skills>)
Define a specialized subagent with its own tools| `agents/*.md`| project or global| [Subagents](</docs/en/sub-agents>)
+Orchestrate many subagents from a script| `workflows/*.js`| project or global| [Dynamic workflows](</docs/en/workflows>)
Connect external tools over MCP| `.mcp.json`| project only| [MCP](</docs/en/mcp>)
Change how Claude formats responses| `output-styles/*.md`| project or global| [Output styles](</docs/en/output-styles>)
@@ -80,6 +81,7 @@
`commands/*.md`| Project and global| ✓| Single-file prompts; same mechanism as skills| [Skills](</docs/en/skills>)
`output-styles/*.md`| Project and global| ✓| Custom system-prompt sections| [Output styles](</docs/en/output-styles>)
`agents/*.md`| Project and global| ✓| Subagent definitions with their own prompt and tools| [Subagents](</docs/en/sub-agents>)
+`workflows/*.js`| Project and global| ✓| Dynamic workflow scripts written by Claude and saved from `/workflows`; each file becomes a `/<name>` command| [Dynamic workflows](</docs/en/workflows>)
`agent-memory/<name>/`| Project and global| ✓| Persistent memory for subagents| [Persistent memory](</docs/en/sub-agents#enable-persistent-memory>)
`~/.claude.json`| Global only| | App state, OAuth, UI toggles, personal MCP servers| [Global config](</docs/en/settings#global-config-settings>)
`projects/<project>/memory/`| Global only| | Auto memory: Claude’s notes to itself across sessions| [Auto memory](</docs/en/memory#auto-memory>)
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -124,6 +124,7 @@
`shell-snapshots/`| Captured shell environment used by the Bash tool. Removed on clean exit. The sweep clears any left after a crash.
`backups/`| Timestamped copies of `~/.claude.json` taken before config migrations
`feedback-bundles/`| Redacted transcript archives written by `/feedback` on third-party providers, for sending to your Anthropic account team
+`todos/`, `statsig/`, `logs/`| Legacy directories from older versions. No longer written. The sweep removes their contents and then the empty directory.
###
@@ -138,7 +139,6 @@
`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 `/usage`
`remote-settings.json`| Cached copy of [server-managed settings](</docs/en/server-managed-settings>) for your organization. Only present when your organization has configured them. Refreshed on each launch.
-`todos/`| Legacy per-session task lists. No longer written by current versions; safe to delete.
Other small cache and lock files appear depending on which features you use and are safe to delete.
@@ -189,7 +189,7 @@
`~/.claude/stats-cache.json`| Historical totals shown by `/usage`
`~/.claude/remote-settings.json`| Nothing. Re-fetched on next launch.
`~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/paste-cache/`, `~/.claude/image-cache/`, `~/.claude/session-env/`, `~/.claude/tasks/`, `~/.claude/shell-snapshots/`, `~/.claude/backups/`| Nothing user-facing
-`~/.claude/todos/`| Nothing. Legacy directory not written by current versions.
+`~/.claude/todos/`, `~/.claude/statsig/`, `~/.claude/logs/`| Nothing. Legacy directories not written by current versions.
Don’t delete `~/.claude.json`, `~/.claude/settings.json`, or `~/.claude/plugins/`: those hold your auth, preferences, and installed plugins.
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -123,6 +123,7 @@
`tasks/`| Per-session task lists written by the task tools
`shell-snapshots/`| Captured shell environment used by the Bash tool. Removed on clean exit. The sweep clears any left after a crash.
`backups/`| Timestamped copies of `~/.claude.json` taken before config migrations
+`feedback-bundles/`| Redacted transcript archives written by `/feedback` on third-party providers, for sending to your Anthropic account team
###
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -113,6 +113,7 @@
Path under `~/.claude/`| Contents
---|---
`projects/<project>/<session>.jsonl`| Full conversation transcript: every message, tool call, and tool result
+`projects/<project>/<session>/subagents/`| [Subagent](</docs/en/sub-agents>) conversation transcripts, removed with the parent session transcript when it ages out
`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](</docs/en/checkpointing>)
`plans/`| Plan files written during [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>)
@@ -135,6 +136,7 @@
---|---
`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 `/usage`
+`remote-settings.json`| Cached copy of [server-managed settings](</docs/en/server-managed-settings>) for your organization. Only present when your organization has configured them. Refreshed on each launch.
`todos/`| Legacy per-session task lists. No longer written by current versions; safe to delete.
Other small cache and lock files appear depending on which features you use and are safe to delete.
@@ -184,6 +186,7 @@
`~/.claude/history.jsonl`| Up-arrow prompt recall
`~/.claude/file-history/`| Checkpoint restore for past sessions
`~/.claude/stats-cache.json`| Historical totals shown by `/usage`
+`~/.claude/remote-settings.json`| Nothing. Re-fetched on next launch.
`~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/paste-cache/`, `~/.claude/image-cache/`, `~/.claude/session-env/`, `~/.claude/tasks/`, `~/.claude/shell-snapshots/`, `~/.claude/backups/`| Nothing user-facing
`~/.claude/todos/`| Nothing. Legacy directory not written by current versions.
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -75,7 +75,7 @@
`settings.json`| Project and global| ✓| Permissions, hooks, env vars, model defaults| [Settings](</docs/en/settings>)
`settings.local.json`| Project only| | Your personal overrides, auto-gitignored| [Settings scopes](</docs/en/settings#settings-files>)
`.mcp.json`| Project only| ✓| Team-shared MCP servers| [MCP scopes](</docs/en/mcp#mcp-installation-scopes>)
-`.worktreeinclude`| Project only| ✓| Gitignored files to copy into new worktrees| [Worktrees](</docs/en/common-workflows#copy-gitignored-files-to-worktrees>)
+`.worktreeinclude`| Project only| ✓| Gitignored files to copy into new worktrees| [Worktrees](</docs/en/worktrees#copy-gitignored-files-into-worktrees>)
`skills/<name>/SKILL.md`| Project and global| ✓| Reusable prompts invoked with `/name` or auto-invoked| [Skills](</docs/en/skills>)
`commands/*.md`| Project and global| ✓| Single-file prompts; same mechanism as skills| [Skills](</docs/en/skills>)
`output-styles/*.md`| Project and global| ✓| Custom system-prompt sections| [Output styles](</docs/en/output-styles>)
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -157,7 +157,26 @@
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.
+Run `claude project purge` to delete the state Claude Code holds for one project:
+
+ * Transcripts and auto memory under `projects/`
+ * Per-session `tasks/`, `debug/`, and `file-history/` entries
+ * Matching prompt lines in `history.jsonl`
+ * The project’s entry in `~/.claude.json`
+
+The command prints the full deletion plan and asks for confirmation before removing anything. Preview the plan without deleting anything:
+
+ claude project purge ~/work/my-repo --dry-run
+
+Delete with a single confirmation prompt:
+
+ claude project purge ~/work/my-repo
+
+Omit the path to pick a project from an interactive list. Skip the confirmation prompt for use in scripts:
+
+ claude project purge ~/work/my-repo --yes
+
+Pass `--all` instead of a path to purge state for every project at once, which deletes `history.jsonl` outright rather than filtering it. Pass `-i` to step through the deletion plan one item at a time. The command leaves `shell-snapshots/` and `backups/` alone because those are not project-scoped, and warns about them in the plan output. It exits with status 1 if no state matches the given path. You can also delete any of the application-data paths above by hand. New sessions are unaffected. The table below shows what you lose for past sessions.
Delete| You lose
---|---
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -1,3 +1,9 @@
+> ## 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.
+
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. On 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. 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.
##
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -78,6 +78,7 @@
`~/.claude.json`| Global only| | App state, OAuth, UI toggles, personal MCP servers| [Global config](</docs/en/settings#global-config-settings>)
`projects/<project>/memory/`| Global only| | Auto memory: Claude’s notes to itself across sessions| [Auto memory](</docs/en/memory#auto-memory>)
`keybindings.json`| Global only| | Custom keyboard shortcuts| [Keybindings](</docs/en/keybindings>)
+`themes/*.json`| Global only| | Custom color themes| [Custom themes](</docs/en/terminal-config#create-a-custom-theme>)
##
@@ -127,7 +128,7 @@
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`
+`stats-cache.json`| Aggregated token and cost counts shown by `/usage`
`todos/`| Legacy per-session task lists. No longer written by current versions; safe to delete.
Other small cache and lock files appear depending on which features you use and are safe to delete.
@@ -157,7 +158,7 @@
`~/.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/stats-cache.json`| Historical totals shown by `/usage`
`~/.claude/debug/`, `~/.claude/plans/`, `~/.claude/paste-cache/`, `~/.claude/image-cache/`, `~/.claude/session-env/`, `~/.claude/tasks/`, `~/.claude/shell-snapshots/`, `~/.claude/backups/`| Nothing user-facing
`~/.claude/todos/`| Nothing. Legacy directory not written by current versions.
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -112,6 +112,9 @@
`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
+`tasks/`| Per-session task lists written by the task tools
+`shell-snapshots/`| Captured shell environment used by the Bash tool. Removed on clean exit. The sweep clears any left after a crash.
+`backups/`| Timestamped copies of `~/.claude.json` taken before config migrations
###
@@ -125,10 +128,9 @@
---|---
`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.
+Other small cache and lock files appear depending on which features you use and are safe to delete.
###
@@ -156,8 +158,7 @@
`~/.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/debug/`, `~/.claude/plans/`, `~/.claude/paste-cache/`, `~/.claude/image-cache/`, `~/.claude/session-env/`, `~/.claude/tasks/`, `~/.claude/shell-snapshots/`, `~/.claude/backups/`| 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.
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -85,45 +85,7 @@
Troubleshoot configuration
-If a setting, hook, or file isn’t taking effect, scan the symptoms below.
-
-Symptom| Cause| Fix
----|---|---
-Hook never fires| `matcher` is a JSON array instead of a string| Use a single string with `|` to match multiple tools, for example `"Edit|Write"`. See [matcher patterns](</docs/en/hooks#matcher-patterns>).
-Hook never fires| `matcher` value is lowercase, for example `"bash"`| Matching is case-sensitive. Tool names are capitalized: `Bash`, `Edit`, `Write`, `Read`.
-Hook never fires| Hooks are in a standalone `.claude/hooks.json` file| There is no standalone hooks file. Define hooks under the `"hooks"` key in `settings.json`. See [hook configuration](</docs/en/hooks>).
-Permissions, hooks, or env set globally are ignored| Configuration was added to `~/.claude.json`| `~/.claude.json` holds app state and UI toggles. `permissions`, `hooks`, and `env` belong in `~/.claude/settings.json`. These are two different files.
-A `settings.json` value seems ignored| The same key is set in `settings.local.json`| `settings.local.json` overrides `settings.json`, and both override `~/.claude/settings.json`. See [settings precedence](</docs/en/settings#settings-precedence>).
-Skill doesn’t appear in `/skills`| Skill file is at `.claude/skills/name.md` instead of in a folder| Use a folder with `SKILL.md` inside: `.claude/skills/name/SKILL.md`.
-Subdirectory `CLAUDE.md` instructions seem ignored| Subdirectory files load on demand, not at session start| They load when Claude reads a file in that directory with the Read tool, not at launch and not when writing or creating files there. See [how CLAUDE.md files load](</docs/en/memory#how-claude-md-files-load>).
-Subagent ignores `CLAUDE.md` instructions| Subagents don’t always inherit project memory| Put critical rules in the agent file body, which becomes the subagent’s system prompt. See [subagent configuration](</docs/en/sub-agents>).
-Cleanup logic never runs at session end| No `SessionEnd` hook configured| `SessionStart` and `SessionEnd` both exist. See the [hook events list](</docs/en/hooks#hook-events>).
-MCP servers in `.mcp.json` never load| File is under `.claude/` or uses Claude Desktop’s config format| Project MCP config lives at the repository root as `.mcp.json`, not inside `.claude/`. See [MCP configuration](</docs/en/mcp>).
-Project MCP server added but doesn’t appear| The one-time approval prompt was dismissed| Project-scoped servers require approval. Run `/mcp` to see status and approve.
-MCP server fails to start from some directories| `command` or `args` uses a relative file path| Use absolute paths for local scripts. Executables on your `PATH` like `npx` or `uvx` work as-is.
-MCP server starts without expected environment variables| Variables are in `settings.json` `env`, which doesn’t propagate to MCP child processes| Set per-server `env` inside `.mcp.json` instead.
-`Bash(rm *)` deny rule doesn’t block `/bin/rm` or `find -delete`| Prefix rules match the literal command string, not the underlying executable| Add explicit patterns for each variant, or use a [PreToolUse hook](</docs/en/hooks-guide>) or the [sandbox](</docs/en/sandboxing>) for a hard guarantee.
-
-##
-
-
-
-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.
+If a setting, hook, or file isn’t taking effect, see [Debug your configuration](</docs/en/debug-your-config>) for the inspection commands and a symptom-first lookup table.
##
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -1,4 +1,12 @@
-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`](</docs/en/env-vars>), 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.
+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. On 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. 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.
+
+##
+
+
+
+Explore the directory
+
+Click files in the tree to see what each one does, when it loads, and an example.
##
@@ -12,9 +20,29 @@
---|---|---
`managed-settings.json`| System-level, varies by OS| Enterprise-enforced settings that you can’t override. See [server-managed settings](</docs/en/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](</docs/en/plugins-reference#plugin-caching-and-file-resolution>).
+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](</docs/en/plugins-reference#plugin-caching-and-file-resolution>).
`~/.claude` also holds data Claude Code writes as you work: transcripts, prompt history, file snapshots, caches, and logs. See application data below.
+
+##
+
+
+
+Choose the right file
+
+Different kinds of customization live in different files. Use this table to find where a change belongs.
+
+You want to| Edit| Scope| Reference
+---|---|---|---
+Give Claude project context and conventions| `CLAUDE.md`| project or global| [Memory](</docs/en/memory>)
+Allow or block specific tool calls| `settings.json` `permissions` or `hooks`| project or global| [Permissions](</docs/en/permissions>), [Hooks](</docs/en/hooks>)
+Run a script before or after tool calls| `settings.json` `hooks`| project or global| [Hooks](</docs/en/hooks>)
+Set environment variables for the session| `settings.json` `env`| project or global| [Settings](</docs/en/settings#available-settings>)
+Keep personal overrides out of git| `settings.local.json`| project only| [Settings scopes](</docs/en/settings#settings-files>)
+Add a prompt or capability you invoke with `/name`| `skills/<name>/SKILL.md`| project or global| [Skills](</docs/en/skills>)
+Define a specialized subagent with its own tools| `agents/*.md`| project or global| [Subagents](</docs/en/sub-agents>)
+Connect external tools over MCP| `.mcp.json`| project only| [MCP](</docs/en/mcp>)
+Change how Claude formats responses| `output-styles/*.md`| project or global| [Output styles](</docs/en/output-styles>)
##
@@ -55,6 +83,31 @@
+Troubleshoot configuration
+
+If a setting, hook, or file isn’t taking effect, scan the symptoms below.
+
+Symptom| Cause| Fix
+---|---|---
+Hook never fires| `matcher` is a JSON array instead of a string| Use a single string with `|` to match multiple tools, for example `"Edit|Write"`. See [matcher patterns](</docs/en/hooks#matcher-patterns>).
+Hook never fires| `matcher` value is lowercase, for example `"bash"`| Matching is case-sensitive. Tool names are capitalized: `Bash`, `Edit`, `Write`, `Read`.
+Hook never fires| Hooks are in a standalone `.claude/hooks.json` file| There is no standalone hooks file. Define hooks under the `"hooks"` key in `settings.json`. See [hook configuration](</docs/en/hooks>).
+Permissions, hooks, or env set globally are ignored| Configuration was added to `~/.claude.json`| `~/.claude.json` holds app state and UI toggles. `permissions`, `hooks`, and `env` belong in `~/.claude/settings.json`. These are two different files.
+A `settings.json` value seems ignored| The same key is set in `settings.local.json`| `settings.local.json` overrides `settings.json`, and both override `~/.claude/settings.json`. See [settings precedence](</docs/en/settings#settings-precedence>).
+Skill doesn’t appear in `/skills`| Skill file is at `.claude/skills/name.md` instead of in a folder| Use a folder with `SKILL.md` inside: `.claude/skills/name/SKILL.md`.
+Subdirectory `CLAUDE.md` instructions seem ignored| Subdirectory files load on demand, not at session start| They load when Claude reads a file in that directory with the Read tool, not at launch and not when writing or creating files there. See [how CLAUDE.md files load](</docs/en/memory#how-claude-md-files-load>).
+Subagent ignores `CLAUDE.md` instructions| Subagents don’t always inherit project memory| Put critical rules in the agent file body, which becomes the subagent’s system prompt. See [subagent configuration](</docs/en/sub-agents>).
+Cleanup logic never runs at session end| No `SessionEnd` hook configured| `SessionStart` and `SessionEnd` both exist. See the [hook events list](</docs/en/hooks#hook-events>).
+MCP servers in `.mcp.json` never load| File is under `.claude/` or uses Claude Desktop’s config format| Project MCP config lives at the repository root as `.mcp.json`, not inside `.claude/`. See [MCP configuration](</docs/en/mcp>).
+Project MCP server added but doesn’t appear| The one-time approval prompt was dismissed| Project-scoped servers require approval. Run `/mcp` to see status and approve.
+MCP server fails to start from some directories| `command` or `args` uses a relative file path| Use absolute paths for local scripts. Executables on your `PATH` like `npx` or `uvx` work as-is.
+MCP server starts without expected environment variables| Variables are in `settings.json` `env`, which doesn’t propagate to MCP child processes| Set per-server `env` inside `.mcp.json` instead.
+`Bash(rm *)` deny rule doesn’t block `/bin/rm` or `find -delete`| Prefix rules match the literal command string, not the underlying executable| Add explicit patterns for each variant, or use a [PreToolUse hook](</docs/en/hooks-guide>) or the [sandbox](</docs/en/sandboxing>) for a hard guarantee.
+
+##
+
+
+
Check what loaded
The explorer shows what files can exist. To see what actually loaded in your current session, use these commands:
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -124,7 +124,7 @@
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:
* Lower `cleanupPeriodDays` to shorten how long transcripts are kept
- * In non-interactive mode, pass `--no-session-persistence` alongside `-p` to skip writing transcripts entirely. In the Agent SDK, set `persistSession: false`. There is no interactive-mode equivalent.
+ * 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 Agent SDK.
* Use [permission rules](</docs/en/permissions>) to deny reads of credential files
###
Show diff (106 lines)
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -1,4 +1,4 @@
-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. 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.
+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`](</docs/en/env-vars>), 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.
##
@@ -6,7 +6,7 @@
What’s not shown
-The explorer covers files you author and edit. A few authored files live elsewhere:
+The explorer covers files you author and edit. A few related files live elsewhere:
File| Location| Purpose
---|---|---
@@ -78,23 +78,23 @@
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 (file contents, command output, pasted text) lands in a transcript on disk.
+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.
###
-Swept automatically
+Cleaned up automatically
-Files older than [`cleanupPeriodDays`](</docs/en/settings#available-settings>) (default 30) are deleted on the next startup.
+Files in the paths below are deleted on startup once they’re older than [`cleanupPeriodDays`](</docs/en/settings#available-settings>). 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](</docs/en/checkpointing>)
-`plans/`| Plan files written during [plan mode](</docs/en/permission-modes#plan-mode>)
-`debug/`| Per-session debug logs
+`plans/`| Plan files written during [plan mode](</docs/en/permission-modes#analyze-before-you-edit-with-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
@@ -102,20 +102,18 @@
-Not swept
+Kept until you delete them
-These persist 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.
-`statsig/`| Feature-flag cache and a stable anonymous device ID
`stats-cache.json`| Aggregated token and cost counts shown by `/cost`
`backups/`| Timestamped copies of `~/.claude.json` taken before config migrations
-`downloads/`| Native binary downloads staged by the auto-updater
`todos/`| Legacy per-session task lists. No longer written by current versions; safe to delete.
-`shell-snapshots/` and `sockets/` are runtime files removed when the session exits cleanly.
+`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.
###
@@ -123,10 +121,10 @@
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:
+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:
* Lower `cleanupPeriodDays` to shorten how long transcripts are kept
- * For headless runs, pass `--no-session-persistence` with `-p`, or set `persistSession: false` in the SDK, to skip writing transcripts entirely. There is no interactive-mode equivalent.
+ * In non-interactive mode, pass `--no-session-persistence` alongside `-p` to skip writing transcripts entirely. In the Agent SDK, set `persistSession: false`. There is no interactive-mode equivalent.
* Use [permission rules](</docs/en/permissions>) to deny reads of credential files
###
@@ -135,16 +133,19 @@
Clear local data
-You can delete these at any time. You lose the listed capability for past sessions; new sessions are unaffected.
+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/debug/`, `paste-cache/`, `image-cache/`, `todos/`| Nothing user-facing
+`~/.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`, `settings.json`, or `plugins/`: those hold your auth, preferences, and installed plugins.
+Don’t delete `~/.claude.json`, `~/.claude/settings.json`, or `~/.claude/plugins/`: those hold your auth, preferences, and installed plugins.
##
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -6,12 +6,15 @@
What’s not shown
-The explorer covers the files you’ll interact with most. A few things live elsewhere:
+The explorer covers files you author and edit. A few authored 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](</docs/en/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](</docs/en/plugins-reference#plugin-caching-and-file-resolution>).
+
+`~/.claude` also holds data Claude Code writes as you work: transcripts, prompt history, file snapshots, caches, and logs. See application data below.
##
@@ -73,6 +76,80 @@
+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 (file contents, command output, pasted text) lands in a transcript on disk.
+
+###
+
+
+
+Swept automatically
+
+Files older than [`cleanupPeriodDays`](</docs/en/settings#available-settings>) (default 30) are deleted on the next startup.
+
+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](</docs/en/checkpointing>)
+`plans/`| Plan files written during [plan mode](</docs/en/permission-modes#plan-mode>)
+`debug/`| Per-session debug logs
+`paste-cache/`, `image-cache/`| Contents of large pastes and attached images
+`session-env/`| Per-session environment metadata
+
+###
+
+
+
+Not swept
+
+These persist until you delete them.
+
+Path under `~/.claude/`| Contents
+---|---
+`history.jsonl`| Every prompt you’ve typed, with timestamp and project path. Used for up-arrow recall.
+`statsig/`| Feature-flag cache and a stable anonymous device ID
+`stats-cache.json`| Aggregated token and cost counts shown by `/cost`
+`backups/`| Timestamped copies of `~/.claude.json` taken before config migrations
+`downloads/`| Native binary downloads staged by the auto-updater
+`todos/`| Legacy per-session task lists. No longer written by current versions; safe to delete.
+
+`shell-snapshots/` and `sockets/` are runtime files removed when the session exits cleanly.
+
+###
+
+
+
+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:
+
+ * Lower `cleanupPeriodDays` to shorten how long transcripts are kept
+ * For headless runs, pass `--no-session-persistence` with `-p`, or set `persistSession: false` in the SDK, to skip writing transcripts entirely. There is no interactive-mode equivalent.
+ * Use [permission rules](</docs/en/permissions>) to deny reads of credential files
+
+###
+
+
+
+Clear local data
+
+You can delete these at any time. You lose the listed capability for past sessions; new sessions are unaffected.
+
+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/debug/`, `paste-cache/`, `image-cache/`, `todos/`| Nothing user-facing
+
+Don’t delete `~/.claude.json`, `settings.json`, or `plugins/`: those hold your auth, preferences, and installed plugins.
+
+##
+
+
+
Related resources
* [Manage Claude’s memory](</docs/en/memory>): write and organize CLAUDE.md, rules, and auto memory
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -19,7 +19,7 @@
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` and `.mcp.json`). Global-scope files live in `~/.claude/` and apply across all projects.
+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:
@@ -38,6 +38,7 @@
`settings.json`| Project and global| ✓| Permissions, hooks, env vars, model defaults| [Settings](</docs/en/settings>)
`settings.local.json`| Project only| | Your personal overrides, auto-gitignored| [Settings scopes](</docs/en/settings#settings-files>)
`.mcp.json`| Project only| ✓| Team-shared MCP servers| [MCP scopes](</docs/en/mcp#mcp-installation-scopes>)
+`.worktreeinclude`| Project only| ✓| Gitignored files to copy into new worktrees| [Worktrees](</docs/en/common-workflows#copy-gitignored-files-to-worktrees>)
`skills/<name>/SKILL.md`| Project and global| ✓| Reusable prompts invoked with `/name` or auto-invoked| [Skills](</docs/en/skills>)
`commands/*.md`| Project and global| ✓| Single-file prompts; same mechanism as skills| [Skills](</docs/en/skills>)
`output-styles/*.md`| Project and global| ✓| Custom system-prompt sections| [Output styles](</docs/en/output-styles>)
--- a/claude-directory.md
+++ b/claude-directory.md
@@ -0,0 +1,80 @@
+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. 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 the files you’ll interact with most. A few things 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](</docs/en/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`.
+
+##
+
+
+
+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` and `.mcp.json`). Global-scope files live in `~/.claude/` and apply across all projects.
+
+Several things can override what you put in these files:
+
+ * [Managed settings](</docs/en/server-managed-settings>) deployed by your organization take precedence over everything
+ * CLI flags like `--permission-mode` or `--settings` override `settings.json` for that session
+ * Some environment variables take precedence over their equivalent setting, but this varies: check the [environment variables reference](</docs/en/env-vars>) for each one
+
+See [settings precedence](</docs/en/settings#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](</docs/en/memory>)
+`rules/*.md`| Project and global| ✓| Topic-scoped instructions, optionally path-gated| [Rules](</docs/en/memory#organize-rules-with-claude/rules/>)
+`settings.json`| Project and global| ✓| Permissions, hooks, env vars, model defaults| [Settings](</docs/en/settings>)
+`settings.local.json`| Project only| | Your personal overrides, auto-gitignored| [Settings scopes](</docs/en/settings#settings-files>)
+`.mcp.json`| Project only| ✓| Team-shared MCP servers| [MCP scopes](</docs/en/mcp#mcp-installation-scopes>)
+`skills/<name>/SKILL.md`| Project and global| ✓| Reusable prompts invoked with `/name` or auto-invoked| [Skills](</docs/en/skills>)
+`commands/*.md`| Project and global| ✓| Single-file prompts; same mechanism as skills| [Skills](</docs/en/skills>)
+`output-styles/*.md`| Project and global| ✓| Custom system-prompt sections| [Output styles](</docs/en/output-styles>)
+`agents/*.md`| Project and global| ✓| Subagent definitions with their own prompt and tools| [Subagents](</docs/en/sub-agents>)
+`agent-memory/<name>/`| Project and global| ✓| Persistent memory for subagents| [Persistent memory](</docs/en/sub-agents#enable-persistent-memory>)
+`~/.claude.json`| Global only| | App state, OAuth, UI toggles, personal MCP servers| [Global config](</docs/en/settings#global-config-settings>)
+`projects/<project>/memory/`| Global only| | Auto memory: Claude’s notes to itself across sessions| [Auto memory](</docs/en/memory#auto-memory>)
+`keybindings.json`| Global only| | Custom keyboard shortcuts| [Keybindings](</docs/en/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.
+
+##
+
+
+
+Related resources
+
+ * [Manage Claude’s memory](</docs/en/memory>): write and organize CLAUDE.md, rules, and auto memory
+ * [Configure settings](</docs/en/settings>): set permissions, hooks, environment variables, and model defaults
+ * [Create skills](</docs/en/skills>): build reusable prompts and workflows
+ * [Configure subagents](</docs/en/sub-agents>): define specialized agents with their own context