The short answer
- 01
Careful. ~/.claude holds your configuration and the data Claude Code writes as you work, side by side.
- 02
Never delete settings.json, CLAUDE.md, skills, plugins, agents or commands, nor ~/.claude.json next to the folder.
- 03
Safe to delete with nothing user-facing lost: debug, shell-snapshots, plans, backups and the legacy todos folder.
- 04
Deleting projects/ loses resume and rewind for past sessions and every project's auto memory.
- 05
The command: claude purge <project path> --dry-run previews deleting one project's transcripts and memory.
See its real size on your Mac. Hoardless measures this folder and previews the delete.Download free trial
What is the ~/.claude folder?
It is Claude Code's home folder. Anthropic's .claude directory reference says Claude Code reads your instructions, settings, skills, subagents and memory from it, and also keeps data it writes as you work: transcripts, prompt history, file snapshots, caches and logs. If you set CLAUDE_CONFIG_DIR, all of it lives there instead.
- Configuration you keep:
settings.json,CLAUDE.md,skills,commands,agents,plugins,keybindings.json,agent-memory. - Session data:
projects/<project>/<session>.jsonltranscripts,file-historysnapshots used for checkpoint restore,debuglogs,shell-snapshots,plans,paste-cache. - History:
history.jsonl, your typed prompts for up-arrow recall.
The file ~/.claude.json sits next to the folder, not inside it, and holds your account details and MCP server configs.
What writes it and why does it grow?
Every Claude Code session writes a transcript with its messages, tool calls and tool results, and Claude Code snapshots files before it edits them. Long sessions with large tool output grow fastest; big outputs spill into a tool-results folder per session.
Claude Code cleans up after itself: files in those paths are deleted once older than cleanupPeriodDays, 30 days by default, as long as it can safely determine the retention period. Things that keep data longer:
- A paused sweep: Claude Code pauses the cleanup when it cannot safely read its settings.
- Claude Desktop and Cowork transcripts are kept at any age unless you set
desktopSessionCleanupPeriodDays. - Files outside the sweep:
history.jsonlandstats-cache.jsonstay until you delete them.
How big does it get?
It depends on how much you use Claude Code; there is no normal size. See which part holds the space:
du -sh ~/.claude/* | sort -h
Lists every part of the folder, largest last. Removes nothing.
du -sh ~/.claude/projects/* | sort -h | tail -10
Shows the ten projects with the most session data. Folder names are your project paths written with dashes, such as -Users-you-my-repo.
Is it safe to delete ~/.claude?
Anthropic's reference says what each deletion costs. In short:
| What | Verdict | What you lose |
|---|---|---|
debug, shell-snapshots, plans, backups, session-env | Safe | Nothing user-facing, per Anthropic. |
todos, statsig, logs | Safe | Nothing. Legacy folders current versions do not write. |
file-history | Careful | Checkpoint restore for past sessions. |
projects | Careful | Resume, continue and rewind for past sessions, and auto memory for every project. |
history.jsonl | Careful | Up-arrow prompt recall and Ctrl+R history search. |
settings.json, plugins, skills, CLAUDE.md, .credentials.json | Never | Your configuration, installed plugins and sign-in. |
How do I clean up ~/.claude?
Let Claude Code do it. Set cleanupPeriodDays in ~/.claude/settings.json to a shorter period and Claude Code deletes data older than that. To clear one project now, use claude purge, which prints its plan and asks before deleting:
claude purge ~/work/my-repo --dry-run
Lists the transcripts, auto memory, history lines and ~/.claude.json entry it would delete for that project. Removes nothing. Run it without --dry-run to delete, after a confirmation prompt.
The manual way: quit every Claude Code session, then move the folders from the Safe rows above to the Trash. Anthropic says you can delete any application-data path yourself, apart from the state files to keep.
What Hoardless does: its Claude Code detector reads CLAUDE_CONFIG_DIR, else ~/.claude, and uses a 30-day window, matching the cleanupPeriodDays default. It lists, per project, transcripts older than 30 days with their session folder (Confirm tier); file history older than 30 days (Confirm); the debug folder (Auto); old shell snapshots and todo lists (Auto); and each folder in vm_bundles (Confirm), which Hoardless identifies as virtual machine images Claude downloads for sandboxed tasks. It never touches settings, CLAUDE.md, skills, plugins, agents, commands, hooks, project memory folders, history.jsonl, ~/.claude.json or repo worktrees. If CLAUDE_CONFIG_DIR points at a broad folder such as your home, it skips the whole-folder rows. Everything goes to the Trash with an undo log.
What comes back and when?
New sessions write new data, so projects and file-history start growing again with your next session. Deleted transcripts never come back, and those sessions can no longer be resumed. Debug logs reappear only while debug logging is on.
Old Claude Code sessions, never your setup
Hoardless lists Claude Code transcripts and file history older than 30 days per project (Confirm tier), debug logs (Auto) and VM bundles (Confirm), never settings, skills, plugins or memory, and moves what you pick to the Trash with an undo log.
14-day full trial. macOS 14 or later.
Questions
Does Claude Code delete old transcripts by itself?
Yes. Claude Code deletes transcripts, file history, debug logs and other session data older than cleanupPeriodDays, which defaults to 30 days. The minimum is 1; setting 0 fails validation.
Can I move ~/.claude somewhere else?
Yes. Set CLAUDE_CONFIG_DIR and Claude Code stores your settings, session history and plugins there instead. Every ~/.claude path then lives under that folder.
Will deleting ~/.claude log me out?
It can. Anthropic lists .credentials.json in ~/.claude, your login credentials, among the state files to keep.
What is the difference between ~/.claude and ~/.claude.json?
~/.claude is a folder of settings and session data. ~/.claude.json is a file Claude Code writes with your account details, MCP server configs and per-project state. Do not delete it.
Are transcripts private?
They are plaintext on disk and can contain file contents and command output, including secrets a tool read. Lowering cleanupPeriodDays shortens how long they stay.
New guides by email
New guides and Hoardless releases, twice a month at most.
Confirm first. Unsubscribe in one click. Privacy.