Is it safe to delete Claude Code’s ~/.claude folder?
- No, not all of it. Next to its session transcripts,
~/.claudeholds Claude Code’s settings, your global CLAUDE.md, skills, agents and plugins. Transcripts and logs can go; the configuration is yours and doesn’t come back. - What it costs you: deleted transcripts can’t be resumed or rewound, and deleting a whole project folder also takes Claude’s auto memory for that project. Debug logs, plans and shell snapshots cost nothing.
- Does it come back? New data is written as you use Claude Code; deleted transcripts and settings aren’t. Claude Code already deletes transcripts older than 30 days on its own.
- SiftMac’s verdict: You decide
1. What it is
Claude Code, Anthropic’s coding agent for the terminal and editors, keeps everything personal in ~/.claude. Its documentation splits the folder into two kinds of files:
- Configuration:
settings.json, your globalCLAUDE.md, and theskills,agents,commands,rulesandpluginsfolders. - Data Claude Code writes as you work: session transcripts in
projects, file snapshots for checkpoints infile-history, prompt history inhistory.jsonl, plus plans, debug logs, caches and shell snapshots.
Transcripts are plain-text .jsonl files, one per session, holding everything that passed through a tool: file contents, command output, pasted text. They’re what lets you resume a session. Each project’s folder in projects also holds memory, the auto memory notes Claude saves for that project across sessions.
2. Where it is
~/.claude
~/.claude.json
~/.claude.json, next to the folder rather than in it, holds your account details, per-project trust decisions and personal MCP servers. If CLAUDE_CONFIG_DIR is set, both live under that folder instead. Claude Code itself is installed elsewhere: the native installer keeps its versions in ~/.local/share/claude/versions.
3. How big it gets
The configuration stays small. What grows is the data: transcripts and large tool outputs in projects, snapshots in file-history, and debug logs if you’ve run with debugging on. To see which:
du -sh ~/.claude/* 2>/dev/null | sort -h
du -sh ~/.claude/projects/* | sort -h
4. How to delete it safely
Let Claude Code do it. After a session starts, it runs a background sweep that deletes transcripts and other session data older than cleanupPeriodDays, 30 by default. To keep less, set a lower number in ~/.claude/settings.json:
{
"cleanupPeriodDays": 14
}
Remove one project’s history with claude purge. It prints what it will delete and asks first: that project’s transcripts and auto memory, its tasks, debug and file-history entries, its lines in history.jsonl, and its entry in ~/.claude.json. Versions before v2.1.288 call it claude project purge.
claude purge ~/path/to/project --dry-run
claude purge ~/path/to/project
By hand, with Claude Code quit: Anthropic’s documentation says deleting debug, plans, session-env and shell-snapshots loses nothing you’d notice, and that the legacy todos, statsig, logs and image-cache folders aren’t used by current versions. Old transcripts in projects can go too, if you won’t resume them; keep each project’s memory folder.
Don’t delete ~/.claude.json, ~/.claude/settings.json or ~/.claude/plugins; Anthropic’s documentation says they hold your account details, preferences and installed plugins. It also lists .credentials.json and agent-memory among the state files to keep.
5. What happens afterwards
- Sessions whose transcripts you deleted no longer appear in the
/resumepicker, and their checkpoints can’t be restored. - If you deleted a project’s
memoryfolder, Claude starts that project without the notes it had saved. - Debug logs, plans and shell snapshots are written again as needed.
- Settings, CLAUDE.md, skills and plugins stay as long as you left them alone, and the data fills again with new sessions, up to the retention period.
Questions
Does Claude Code clean up ~/.claude by itself?
Yes. Transcripts, file snapshots, plans, debug logs and other session data are deleted once they’re older than cleanupPeriodDays, 30 days by default. Settings, skills, plugins, history.jsonl and auto memory aren’t part of that sweep.
Can I delete the whole ~/.claude folder?
Only to reset Claude Code completely. You’d lose your settings, global CLAUDE.md, skills, agents and plugins along with every transcript and auto memory note.
Are transcripts private?
They stay on your Mac, but they’re plain text and include whatever passed through a tool, such as a file’s contents or a command’s output. Anthropic suggests a lower cleanupPeriodDays to keep them for less time.
What is ~/.claude/projects/<project>/memory?
Auto memory: notes Claude keeps about you and the project across sessions. The cleanup sweep doesn’t delete it; claude purge does, for the project you name.
How SiftMac handles it. Its AI files category lists Claude Code sessions in ~/.claude/projects you haven’t touched for the window you set (30 days by default), project by project, and never touches a project’s memory folder. Sessions are You decide, never ticked for you, and wait on the Undo Shelf for 7 days. It also lists old copies of Claude Code in ~/.local/share/claude/versions, keeping the newest and the one your claude command uses.
Download SiftMac · scanning is free, and so is your first 2 GB of cleaning · See how it works