claude project purge command#
What's wrong with this entry?
A new CLI subcommand that deletes every piece of Claude Code state belonging to a project — transcripts, task lists, debug logs, file edit history, the project entry in ~/.claude.json, and the matching prompt-history lines.
# Purge state for the current directory (interactive picker if no path given)
claude project purge
# Purge for a specific project path
claude project purge /path/to/repo
# Show what would be deleted without deleting
claude project purge --dry-run
# Skip the confirmation prompt
claude project purge --yes
# Step through each item with delete/skip/all/abort prompts
claude project purge -i
claude project purge --interactive
# Purge state for ALL projects on this machine
claude project purge --all- The interactive picker lists every project that has state on disk (current cwd plus anything found under
~/.claude/projects/) so you can pick one to purge. - A "purge plan" is printed before any deletion runs, e.g.
dir: <path> project transcripts (.jsonl) and memory/,config: projects["<path>"] project entry in ~/.claude.json (trust, history, MCP servers),filter: <path>/history.jsonl N prompt(s) typed in this project. --allis mutually exclusive with both a path argument and--interactive; the CLI errors withCannot specify both a path and --all./Cannot use -i/--interactive with --all.if you mix them.- Warnings are printed (not deleted):
shell-snapshots/ are not project-scoped and will not be touched, andbackups/ may still contain this project entry in old .claude.json snapshots (...); at most 5 are kept and they rotate out automatically. - A safety check refuses to overwrite the config if an in-process re-read is missing auth that the cache has — preventing accidental credential loss (GH #3117).
Project purge command (search for "Manage Claude Code project state" and "Delete all Claude Code state for a project (transcripts, tasks, file history, config entry)").
Strings lifted out of the shipped bundle, so the claim above can be checked against them.