← Claude Code Hub
✦ Tip #230 Oct 16, 2026

Delete Claude Code history: claude purge wipes a project in one command

claude purge deletes everything Claude Code keeps about a project: transcripts, memory, edit history, even your trust in the folder. With --dry-run you see what goes first.

Delete Claude Code history: five places on your disk (transcripts and memory, edit history, tasks and debug logs, history.jsonl and the ~/.claude.json entry) that claude purge deletes at once, and what it leaves behind: backups, shell-snapshots and pasted images

TL;DR claude purge <path> --dry-run shows you everything Claude Code keeps about that project. Drop --dry-run and it deletes all of it, after asking you to confirm. It used to be claude project purge.

claude purge deletes everything Claude Code stores on your disk about a project, and that's more than the conversations folder. It's the transcripts and memory under ~/.claude/projects/, each session's tasks, debug logs and file edit history, your prompts in history.jsonl, and the project's entry in ~/.claude.json. By hand, that's five different places. With purge, one command.

If you only want to get rid of one conversation, you don't need it: delete its .jsonl in the folder where it sits in plain text. purge works a project at a time.

Here's what it printed for my wmedia.es project (trimmed):

$ claude purge ~/Herd/wmedia --dry-run
Purge plan for /Users/juan.nunez/Herd/wmedia:

  dir:    /Users/juan.nunez/.claude/file-history/1c13ffa7-eacf-4291-8c94-5b73e6369307
           file edit history for session 1c13ffa7-eacf-4291-8c94-5b73e6369307
  ... (6 more sessions with their file-history)
  dir:    /Users/juan.nunez/.claude/projects/-Users-juan-nunez-Herd-wmedia
           project transcripts (.jsonl) and memory/
  dir:    /Users/juan.nunez/.claude/projects/-Users-juan-nunez-Herd-wmedia--claude-worktrees-ia-empresa-coste-legalidad-etica-6e2400
           project transcripts (.jsonl) and memory/
  config: projects["/Users/juan.nunez/Herd/wmedia"]
           project entry in ~/.claude.json (trust, history, MCP servers)

shell-snapshots/ are not project-scoped and will not be touched
backups/ may still contain this project entry in old .claude.json snapshots (/Users/juan.nunez/.claude/backups); at most 5 are kept and they rotate out automatically
Dry run: 10 item(s) would be deleted.

Ten items, and the transcripts folder alone was 606 MB. Look at the second projects/ folder: sessions from a worktree go too.

When to use it

  • You pasted a secret into a session. A token that slipped into a prompt or into a command's output stays written in the transcript.
  • You're wrapping up or handing over a project. You don't keep conversations about a repo that's no longer yours.
  • You want disk space back. One project at a time, knowing what goes before it goes.

How to use it

1. Look at the plan first

claude purge ~/work/my-repo --dry-run

Nothing gets deleted. Leave out the path and it lets you pick the project from a list.

2. Delete it

claude purge ~/work/my-repo

According to the docs, it prints the same plan and asks Delete N item(s) for ...? This cannot be undone. [y/N]. It only deletes if you answer y.

Option What it does
--dry-run Shows the plan without deleting
-i Asks you to confirm each item
-y Skips the confirmation, for scripts
--all Every project; deletes history.jsonl outright instead of filtering it

What goes with it

The ~/.claude.json entry holds your trust in the folder and the MCP servers you added with claude mcp add at local scope, the default one. After purge, the next session in that folder asks again whether you trust it, and those MCP servers are gone. To keep them, move them to .mcp.json with --scope project first.

And memory ships in the same item as the transcripts: it's a single line in the plan. If you only want to clear the memory, purge won't do it.

What it leaves behind

  • backups/: up to five old copies of ~/.claude.json that can still hold the project's entry. They rotate out on their own, but if what leaked is in there, delete them by hand.
  • shell-snapshots/: they don't belong to any project.
  • Images you pasted and each session's scratchpad: they live in the temp directory. The images go with cleanupPeriodDays.
  • .heapsnapshot files from /heapdump: they hold the full conversation and nothing cleans them up.

One warning: on a project with a lot of history, --dry-run can take a while. On the repo where I write these tips, with hundreds of sessions, it still hadn't finished after three minutes. And the docs don't say what happens if you purge a project with a session open in it: close it first.

For the opposite case, taking all this to another machine instead of deleting it, see what to copy from ~/.claude when you move.

Official docs: Clear local data · CLI reference

Requirements

  • Claude Code v2.1.288 or later, the version where claude project purge became claude purge. Tested on v2.1.293.
  • Use the old name and the CLI tells you: `claude project purge` is now `claude purge`.
Free guide

The 51 essentials, as a guide.

One page per tip. Five chapters. What I actually use daily in production. No theory, no fluff.

  • I. Getting started 10 tips
  • II. Awareness 3 tips
  • III. Mastery 22 tips
  • IV. Autonomy 10 tips
  • V. Comparison 6 tips
Are you a professional Web developer?

You'll receive the guide by email · You join the Gravitas newsletter · Unsubscribe anytime

of 51
#

Wmedia · 51 Tips
Free guide · 51 tips · 5 chapters

The 51 essentials, as a guide.

Are you a professional Web developer? · Unsubscribe anytime
Workshop for teams

Multiply your team's output without sacrificing quality: a 6 to 8 hour AI First workshop, online, on the Claude platform.

See the workshop

Want the 51 Claude Code essentials as a guide?