Where Claude Code Stores Agents, Skills and Sessions (File Paths Cheat Sheet)
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
| Scope | Where | Applies to | Commit to git? |
|---|---|---|---|
| Project | .claude/ in your repository, plus CLAUDE.md, .mcp.json at the root | That project and everyone who clones it | Yes, except settings.local.json |
| User (global) | ~/.claude/ and ~/.claude.json | You, in every project on this machine | No |
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
| Path | Scope | What it does |
|---|---|---|
CLAUDE.md | Project, and ~/.claude/CLAUDE.md global | Instructions loaded into context at session start. |
CLAUDE.local.md | Project root | Your private preferences for this project. Create it by hand and add it to .gitignore. |
.claude/settings.json | Project | Shared permissions, hooks, environment variables and model defaults. Commit it. |
.claude/settings.local.json | Project | Your personal overrides. Claude Code keeps it out of git when it creates the file. |
~/.claude/settings.json | User | Your settings for every project. |
.claude/agents/*.md | Project | Subagent definitions. |
~/.claude/agents/*.md | User | Subagents available in all projects. |
.claude/skills/<name>/SKILL.md | Project | Skills: a folder with SKILL.md plus supporting files. |
~/.claude/skills/<name>/SKILL.md | User | Personal skills. |
.claude/commands/*.md | Project | Single-file commands. .claude/commands/deploy.md runs as /deploy. |
~/.claude/commands/*.md | User | Personal commands. |
.claude/rules/*.md | Project, and ~/.claude/rules/ | Topic files of instructions, optionally limited by paths: front matter. |
.claude/output-styles/*.md | Project, and ~/.claude/output-styles/ | Custom output styles. |
.claude/workflows/*.js | Project, and ~/.claude/workflows/ | Saved dynamic workflow scripts. |
.mcp.json | Project root | MCP servers shared with your team. |
~/.claude.json | User | Account details, per-project trust decisions, personal MCP servers and UI toggles. Claude Code writes it for itself. |
~/.claude/keybindings.json | User | Custom keyboard shortcuts. |
~/.claude/themes/*.json | User | Custom 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
--agentsCLI 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:
- Managed settings (organization policy)
- Command line (
--settings) .claude/settings.local.json.claude/settings.json~/.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.
| Path | Contents | Retention |
|---|---|---|
projects/<project>/<session>.jsonl | Conversation transcript: messages, tool calls and tool results | Deleted 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 files | Same sweep |
projects/<project>/memory/MEMORY.md | Auto memory: notes Claude saves across sessions | Not deleted by the sweep |
file-history/<session>/ | Pre-edit snapshots used for checkpoint restore | Same sweep |
plans/ | Plan files written in plan mode | Same sweep |
debug/ | Debug logs, written while debug logging is on | Same sweep |
history.jsonl | Prompts you typed, with timestamp and project path | Kept until you delete it |
stats-cache.json | Aggregated token and cost counts shown by /usage | Kept until you delete it |
agent-memory/ | Memory for subagents that set memory: user | Keep it |
.credentials.json | Your login credentials | Keep it |
plugins/ | Installed plugins and marketplaces | Keep 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
| Path | Effect 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.jsonl | Up-arrow prompt recall and Ctrl+R history search are lost |
~/.claude/stats-cache.json | Historical 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.gitignoreyourself.)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.