Where Claude Code Stores Agents, Skills and Sessions (File Paths Cheat Sheet)

Published 6 min read

Claude Code keeps personal configuration in ~/.claude/ (on Windows, %USERPROFILE%\.claude) and shareable project configuration in a .claude/ folder inside your repository. Subagents go in agents/, skills in skills/<name>/SKILL.md, settings in settings.json, and session transcripts in ~/.claude/projects/.

This cheat sheet lists every path you are likely to need, what it does, whether to commit it, and what is safe to delete. It is part of the Claude Code subagents hub. To create agent files, see how to create a custom subagent.

The two scopes

ScopeWhereApplies toCommit to git?
Project.claude/ in your repository, plus CLAUDE.md, .mcp.json at the rootThat project and everyone who clones itYes, except settings.local.json
User (global)~/.claude/ and ~/.claude.jsonYou, in every project on this machineNo

On Windows, ~ resolves to %USERPROFILE%, so ~/.claude is %USERPROFILE%\.claude (usually C:\Users\<you>\.claude). If you set the CLAUDE_CONFIG_DIR environment variable, every ~/.claude path lives under that directory instead, and .claude.json moves with it.

Configuration files you write

PathScopeWhat it does
CLAUDE.mdProject, and ~/.claude/CLAUDE.md globalInstructions loaded into context at session start.
CLAUDE.local.mdProject rootYour private preferences for this project. Create it by hand and add it to .gitignore.
.claude/settings.jsonProjectShared permissions, hooks, environment variables and model defaults. Commit it.
.claude/settings.local.jsonProjectYour personal overrides. Claude Code keeps it out of git when it creates the file.
~/.claude/settings.jsonUserYour settings for every project.
.claude/agents/*.mdProjectSubagent definitions.
~/.claude/agents/*.mdUserSubagents available in all projects.
.claude/skills/<name>/SKILL.mdProjectSkills: a folder with SKILL.md plus supporting files.
~/.claude/skills/<name>/SKILL.mdUserPersonal skills.
.claude/commands/*.mdProjectSingle-file commands. .claude/commands/deploy.md runs as /deploy.
~/.claude/commands/*.mdUserPersonal commands.
.claude/rules/*.mdProject, and ~/.claude/rules/Topic files of instructions, optionally limited by paths: front matter.
.claude/output-styles/*.mdProject, and ~/.claude/output-styles/Custom output styles.
.claude/workflows/*.jsProject, and ~/.claude/workflows/Saved dynamic workflow scripts.
.mcp.jsonProject rootMCP servers shared with your team.
~/.claude.jsonUserAccount details, per-project trust decisions, personal MCP servers and UI toggles. Claude Code writes it for itself.
~/.claude/keybindings.jsonUserCustom keyboard shortcuts.
~/.claude/themes/*.jsonUserCustom color themes.

The official docs note that for new commands you should use a skill, which can bundle reference docs, templates or scripts. Commands and skills use the same mechanism.

Agents

  • Project: .claude/agents/
  • User: ~/.claude/agents/
  • Plugins: a plugin's own agents/ folder
  • Session only: the --agents CLI flag, which saves nothing to disk

Both agent folders are scanned recursively. When two subagents share a name, the order of priority is managed settings, then the --agents flag, then .claude/agents/, then ~/.claude/agents/, then plugins.

Skills

Each skill is a folder with a SKILL.md file plus any supporting files. You or Claude can invoke a skill with /skill-name, or Claude can match the task to it.

Settings and precedence

Settings are strict JSON: a comment or a trailing comma is a syntax error. When the same key appears in several places, the highest level wins:

  1. Managed settings (organization policy)
  2. Command line (--settings)
  3. .claude/settings.local.json
  4. .claude/settings.json
  5. ~/.claude/settings.json

List keys such as permissions.allow merge across files instead of overriding. Run /status inside Claude Code to see which settings files loaded.

Managed settings come from a managed-settings.json file in a system directory, an MDM policy, or server-managed settings from the claude.ai console. The location of the file varies by operating system and is set by your administrator.

Data Claude Code writes as you work

These live under ~/.claude/ and are plaintext.

PathContentsRetention
projects/<project>/<session>.jsonlConversation transcript: messages, tool calls and tool resultsDeleted after cleanupPeriodDays (default 30)
projects/<project>/<session>/subagents/Subagent transcripts (agent-<id>.jsonl)Removed with the parent transcript
projects/<project>/<session>/tool-results/Large tool outputs saved as separate filesSame sweep
projects/<project>/memory/MEMORY.mdAuto memory: notes Claude saves across sessionsNot deleted by the sweep
file-history/<session>/Pre-edit snapshots used for checkpoint restoreSame sweep
plans/Plan files written in plan modeSame sweep
debug/Debug logs, written while debug logging is onSame sweep
history.jsonlPrompts you typed, with timestamp and project pathKept until you delete it
stats-cache.jsonAggregated token and cost counts shown by /usageKept until you delete it
agent-memory/Memory for subagents that set memory: userKeep it
.credentials.jsonYour login credentialsKeep it
plugins/Installed plugins and marketplacesKeep it

Subagent memory for memory: project lives in .claude/agent-memory/<agent-name>/ in the project, and memory: local uses .claude/agent-memory-local/<agent-name>/.

Anything that passes through a tool is written to a transcript. If a tool reads a .env file or a command prints a credential, that value lands in the .jsonl file. To reduce this, lower cleanupPeriodDays, deny reads of credential files in permissions, or use claude purge to delete the state for one project. Run claude purge ~/work/my-repo --dry-run first to preview what it removes.

How to open these folders

Windows (PowerShell):

explorer "$env:USERPROFILE\.claude"
dir "$env:USERPROFILE\.claude\agents"

macOS and Linux:

ls ~/.claude/agents
ls ~/.claude/projects

The .claude folder name starts with a dot, so file managers may hide it. Turn on "show hidden files" if you do not see it.

What is safe to delete

PathEffect of deleting
~/.claude/debug/, plans/, session-env/, shell-snapshots/Nothing user-facing
~/.claude/paste-cache/Pasted text in recalled prompts is lost
~/.claude/file-history/Checkpoint restore for past sessions is lost
~/.claude/history.jsonlUp-arrow prompt recall and Ctrl+R history search are lost
~/.claude/stats-cache.jsonHistorical totals in /usage are lost
~/.claude/projects/Resume, continue and rewind for past sessions are lost, and auto memory for every project
~/.claude/backups/Earlier copies of ~/.claude.json are lost

Do not delete ~/.claude.json, ~/.claude/settings.json or ~/.claude/plugins/. They hold your account details, preferences and installed plugins.

What to commit

Commit these so your team shares one setup:

  • CLAUDE.md
  • .claude/settings.json
  • .claude/agents/, .claude/skills/, .claude/commands/, .claude/rules/
  • .mcp.json

Keep these out of git:

  • .claude/settings.local.json (Claude Code adds it to your global git excludes the first time it writes the file. If you create it by hand, add it to .gitignore yourself.)
  • CLAUDE.local.md
  • Everything under ~/.claude/

Seeing what is in these folders with Agent Office

Agent Office is a free local dashboard that reads some of these paths so you do not have to browse them by hand. It reads ~/.claude/agents/*.md and ~/.claude/skills/<folder>/SKILL.md (front matter name and description only), plugin skills under ~/.claude/plugins, and the session transcripts in ~/.claude/projects. From the transcripts it keeps only tool names, task titles, status and token counts, never message text. The result is a searchable directory of your agents and skills and a live map of who is working. See the setup guide to install it and open the Office to view it.

Quick reference

Project
  CLAUDE.md
  .mcp.json
  .claude/
    settings.json
    settings.local.json      (not committed)
    agents/*.md
    skills/<name>/SKILL.md
    commands/*.md
    rules/*.md
    agent-memory/<name>/

Home folder
  ~/.claude.json
  ~/.claude/
    CLAUDE.md
    settings.json
    agents/*.md
    skills/<name>/SKILL.md
    commands/*.md
    projects/<project>/<session>.jsonl
    projects/<project>/<session>/subagents/agent-<id>.jsonl
    projects/<project>/memory/MEMORY.md
    history.jsonl

Sources

  • Explore the .claude directory: https://code.claude.com/docs/en/claude-directory
  • Claude Code settings: https://code.claude.com/docs/en/settings
  • Create custom subagents: https://code.claude.com/docs/en/sub-agents

Frequently asked questions

What is in the .claude folder?

The project .claude/ folder holds shareable configuration: settings.json, settings.local.json, rules/, skills/, commands/, agents/, output-styles/, workflows/ and agent-memory/. The ~/.claude/ folder in your home directory holds the personal versions of those, plus data Claude Code writes as you work, such as transcripts and prompt history.

What is the difference between user and project scope?

Project files live in your repository, apply only there, and can be committed to git to share. User files live in ~/.claude, apply to every project on your machine, and are personal. For settings, project values rank above user values.

Where are Claude Code session transcripts stored?

At ~/.claude/projects/<project>/<session>.jsonl. Subagent transcripts are in ~/.claude/projects/<project>/<session>/subagents/. They are plaintext and deleted automatically after cleanupPeriodDays, which defaults to 30.

Should I commit the .claude folder to git?

Commit most of the project .claude/ folder, such as settings.json, agents/, skills/, commands/ and rules/, so teammates get the same setup. Keep settings.local.json out of git. Never commit ~/.claude, which is personal.

How do I find my agents on Windows?

Open %USERPROFILE%\\.claude\\agents in File Explorer, which is usually C:\\Users\\<you>\\.claude\\agents. Project agents are in the .claude\\agents folder inside your repository.

What is safe to delete?

Caches and logs such as debug/, paste-cache/, shell-snapshots/ and cache/changelog.md are safe to delete. Deleting projects/ loses resume and auto memory, and history.jsonl loses prompt recall. Do not delete ~/.claude.json, ~/.claude/settings.json or ~/.claude/plugins/.

Can I move the ~/.claude folder?

Yes. Set the CLAUDE_CONFIG_DIR environment variable. Claude Code then stores settings, session history and plugins there, and ~/.claude.json moves with it.