Skip to main content

Documentation Index

Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

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

What’s not shown

The explorer covers files you author and edit. A few related files live elsewhere:
FileLocationPurpose
managed-settings.jsonSystem-level, varies by OSEnterprise-enforced settings that you can’t override. See server-managed settings.
CLAUDE.local.mdProject rootYour private preferences for this project, loaded alongside CLAUDE.md. Create it manually and add it to .gitignore.
Installed plugins~/.claude/pluginsCloned marketplaces, installed plugin versions, and per-plugin data, managed by claude plugin commands. Orphaned versions are deleted 7 days after a plugin update or uninstall. See plugin caching.
~/.claude also holds data Claude Code writes as you work: transcripts, prompt history, file snapshots, caches, and logs. See application data below.

Choose the right file

Different kinds of customization live in different files. Use this table to find where a change belongs.
You want toEditScopeReference
Give Claude project context and conventionsCLAUDE.mdproject or globalMemory
Allow or block specific tool callssettings.json permissions or hooksproject or globalPermissions, Hooks
Run a script before or after tool callssettings.json hooksproject or globalHooks
Set environment variables for the sessionsettings.json envproject or globalSettings
Keep personal overrides out of gitsettings.local.jsonproject onlySettings scopes
Add a prompt or capability you invoke with /nameskills/<name>/SKILL.mdproject or globalSkills
Define a specialized subagent with its own toolsagents/*.mdproject or globalSubagents
Connect external tools over MCP.mcp.jsonproject onlyMCP
Change how Claude formats responsesoutput-styles/*.mdproject or globalOutput styles

File reference

This table lists every file the explorer covers. Project-scope files live in your repo under .claude/ (or at the root for CLAUDE.md, .mcp.json, and .worktreeinclude). Global-scope files live in ~/.claude/ and apply across all projects.
Several things can override what you put in these files:
  • 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 for each one
See settings precedence for the full order.
Click a filename to open that node in the explorer above.
FileScopeCommitWhat it doesReference
CLAUDE.mdProject and globalInstructions loaded every sessionMemory
rules/*.mdProject and globalTopic-scoped instructions, optionally path-gatedRules
settings.jsonProject and globalPermissions, hooks, env vars, model defaultsSettings
settings.local.jsonProject onlyYour personal overrides, auto-gitignoredSettings scopes
.mcp.jsonProject onlyTeam-shared MCP serversMCP scopes
.worktreeincludeProject onlyGitignored files to copy into new worktreesWorktrees
skills/<name>/SKILL.mdProject and globalReusable prompts invoked with /name or auto-invokedSkills
commands/*.mdProject and globalSingle-file prompts; same mechanism as skillsSkills
output-styles/*.mdProject and globalCustom system-prompt sectionsOutput styles
agents/*.mdProject and globalSubagent definitions with their own prompt and toolsSubagents
agent-memory/<name>/Project and globalPersistent memory for subagentsPersistent memory
~/.claude.jsonGlobal onlyApp state, OAuth, UI toggles, personal MCP serversGlobal config
projects/<project>/memory/Global onlyAuto memory: Claude’s notes to itself across sessionsAuto memory
keybindings.jsonGlobal onlyCustom keyboard shortcutsKeybindings
themes/*.jsonGlobal onlyCustom color themesCustom themes

Troubleshoot configuration

If a setting, hook, or file isn’t taking effect, see Debug your configuration for the inspection commands and a symptom-first lookup table.

Application data

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

Cleaned up automatically

Files in the paths below are deleted on startup once they’re older than cleanupPeriodDays. The default is 30 days.
Path under ~/.claude/Contents
projects/<project>/<session>.jsonlFull conversation transcript: every message, tool call, and tool result
projects/<project>/<session>/subagents/Subagent 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
plans/Plan files written during plan mode
debug/Per-session debug logs, written only when you start with --debug or run /debug
paste-cache/, image-cache/Contents of large pastes and attached images
session-env/Per-session environment metadata
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

Kept until you delete them

The following paths are not covered by automatic cleanup and persist indefinitely.
Path under ~/.claude/Contents
history.jsonlEvery prompt you’ve typed, with timestamp and project path. Used for up-arrow recall.
stats-cache.jsonAggregated token and cost counts shown by /usage
remote-settings.jsonCached copy of 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.

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
  • Set the CLAUDE_CODE_SKIP_PROMPT_HISTORY 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 to deny reads of credential files

Clear local data

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.
DeleteYou lose
~/.claude/projects/Resume, continue, and rewind for past sessions
~/.claude/history.jsonlUp-arrow prompt recall
~/.claude/file-history/Checkpoint restore for past sessions
~/.claude/stats-cache.jsonHistorical totals shown by /usage
~/.claude/remote-settings.jsonNothing. 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.
Don’t delete ~/.claude.json, ~/.claude/settings.json, or ~/.claude/plugins/: those hold your auth, preferences, and installed plugins.