The .claude folder, explained, and what Claude Code stores

Claude Code reads its instructions, settings, skills, subagents and memory from two places: a .claude folder in your project and a .claude folder in your home directory. It also writes files there as you work. Knowing which is which tells you what to edit, what to commit and what to clean up.

Two folders, two jobs

Most people only ever edit CLAUDE.md and settings.json. The rest is optional: add it when you need it. If your repository already has an AGENTS.md written for other coding agents, Claude Code can read that in place of a CLAUDE.md.

The files you write

Not sure where a change belongs? Allow or block a tool: settings.json permissions or a hook. Run a script around tool calls: a hook. Keep personal overrides out of git: settings.local.json. A prompt you call with /name: a skill. Settings from different files can clash, so see which settings file wins. For the choice between instructions, skills and hooks, see CLAUDE.md, skill, hook or subagent.

What Claude Code writes while you work

Besides what you author, ~/.claude fills up with files Claude Code creates:

The part to read twice: it is plaintext

The documentation says transcripts and history are not encrypted at rest, and that file permissions on your computer are the only protection. If a tool reads a .env file or a command prints a credential, that value is written into the session transcript. So it is worth thinking about who can read that folder, and about backups that copy it.

How long things stay

Reduce what is stored

Do not delete these

Caches and lock files are safe to remove. Keep .credentials.json (your login), agent-memory/ (subagent memory) and the jobs/ and daemon/ folders (state of background sessions).

Try it on something harmless

  1. Open your ~/.claude folder and look at the names. Do not open anything you would not want on screen.
  2. Find settings.json in a project's .claude folder and check whether it is committed to git.
  3. Run claude purge <path to a test project> --dry-run and read the plan. It deletes nothing.

Limits

This follows Anthropic's documentation of the .claude directory as we read it in October 2026. We are not affiliated with Anthropic. We wrote this from the documentation and have not tested every case.

The free loop-stop skill gives long tasks a limit and a stop rule. If you want a second pair of eyes on your CLAUDE.md and settings, the Tune-Up Kit is a checklist for exactly that.