Where Claude Code stores skills, agents, rules, and MCP servers
Claude Code reads its context from a mix of a global dotfolder, per-project
dotfolders, and two easy-to-miss files that live outside both. This page maps
all of it. ~ is your home directory (C:\Users\<you> on Windows,
/Users/<you> on macOS, /home/<you> on Linux); paths starting with .claude/
are relative to a project root.
At a glance
Section titled “At a glance”| Artifact | Global | Per-project | Format |
|---|---|---|---|
| Skills | ~/.claude/skills/<name>/SKILL.md | .claude/skills/<name>/SKILL.md | Markdown + YAML frontmatter |
| Subagents | ~/.claude/agents/*.md | .claude/agents/*.md | Markdown + YAML frontmatter |
| Rules / memory file | ~/.claude/CLAUDE.md | CLAUDE.md, CLAUDE.local.md (project root, also nested dirs) | Markdown |
| Output styles | ~/.claude/output-styles/*.md | .claude/output-styles/*.md | Markdown + frontmatter |
| Auto memory | ~/.claude/projects/<project-slug>/memory/*.md | — | Markdown (MEMORY.md is the index) |
| Slash commands | ~/.claude/commands/**/*.md | .claude/commands/**/*.md | Markdown + frontmatter |
| MCP servers | ~/.claude.json (a file, not inside ~/.claude/) | .mcp.json (project root) | JSON |
| Settings | ~/.claude/settings.json | .claude/settings.json, .claude/settings.local.json | JSON |
| Hooks | inside settings.json → "hooks" | inside project settings.json → "hooks" | JSON (event → matcher → command) |
| Plugins | ~/.claude/plugins/ (cache + marketplaces) | — | bundled skills/agents/commands |
Skills
Section titled “Skills”A skill is a folder containing a SKILL.md with YAML frontmatter (name,
description) — the folder name is the skill name. Global skills live in
~/.claude/skills/, project skills in .claude/skills/. Skills bundled by
plugins are unpacked under the plugin cache (see Plugins) rather
than either of those directories, which is why they’re easy to lose track of.
Subagents
Section titled “Subagents”Custom subagents are single Markdown files with frontmatter (name,
description, tools, optional model) in ~/.claude/agents/ (all projects)
or .claude/agents/ (one project). Project agents win on name collisions.
CLAUDE.md and rules
Section titled “CLAUDE.md and rules”Claude Code auto-loads CLAUDE.md from the project root, plus any CLAUDE.md
in parent directories and in subdirectories it works in. CLAUDE.local.md is
the git-ignored personal variant. ~/.claude/CLAUDE.md applies to every
session. Output styles — reusable system-prompt modifiers — are separate files
under output-styles/.
Claude Code also reads AGENTS.md, the cross-tool convention shared with
Codex, Cursor, and others.
Auto memory
Section titled “Auto memory”Session-persistent memory is plain Markdown under
~/.claude/projects/<project-slug>/memory/ — one file per fact, with
MEMORY.md as the index that gets loaded into context. The project slug is the
project path with separators dashed (e.g. C--Users-you-code-myapp).
Slash commands
Section titled “Slash commands”Each .md file under a commands/ directory is a slash command; subdirectories
become namespaces (commands/git/commit.md → /git:commit). Commands can embed
shell execution (! prefix), which is why they deserve the same review as
scripts.
MCP servers — the gotcha
Section titled “MCP servers — the gotcha”Project-scoped servers (--scope project) go in .mcp.json at the repo root —
the only one of the three meant to be committed. Server entries carry command
/ args / env (stdio) or url / headers (HTTP), and the env and
headers values are where API keys end up — treat both files as
secret-adjacent.
Settings and hooks
Section titled “Settings and hooks”settings.json (global ~/.claude/, project .claude/, personal
.claude/settings.local.json) holds permissions, environment variables, and
hooks — shell commands keyed by lifecycle event and matcher. Precedence is
local over project over global. Hooks execute arbitrary commands, so they’re
part of your security surface, not just configuration.
Plugins
Section titled “Plugins”Installed plugins unpack under ~/.claude/plugins/cache/<marketplace>/<plugin>/<version>/
with their own skills/, agents/, and commands/ folders inside; marketplace
clones live in ~/.claude/plugins/marketplaces/. These bundled artifacts behave
exactly like your own, but live where no one looks.
Seeing all of it at once
Section titled “Seeing all of it at once”Quartermaster’s scanner walks every location on this page (including the
~/.claude.json gotcha and plugin caches), indexes the artifacts into one
searchable registry alongside Cursor,
Codex, and 8 more tools, and can
convert or
install them anywhere — secrets are never indexed
(env/header key names kept, values dropped). See the full
discovery map or the
quickstart.