Skip to content
BENIBIX Learn

claude purge Command

Also known as claude purge, Clear local data

It deletes what Claude Code keeps for one project.

Think of it like

It is like you clear your desk at the end of the year. Every page comes off.

Example

Lucy finishes a client project and wants no trace of its chats on her laptop. She runs claude purge with --dry-run, reads the list, then runs it again for real.

Why it matters

Old chats can hold code and secrets. This removes them on your schedule, not when they age out.

Definition

claude purge deletes all that Claude Code keeps on your computer for one project. That is its chat transcripts, task lists, debug logs, file edit history, prompt history and its line in ~/.claude.json. Give it a path, or leave the path out to pick from a list. Add --dry-run to see what would go first, or --all to clear each project.

Example code

bash
claude purge ~/work/repo --dry-run
See what would be deleted, and delete nothing.
Everything in the box goes. Your code is outside it.

Common mistake

Thinking it deletes the project's code. It only deletes what Claude Code saved about it. Your files are left alone.

Key takeaways

  1. 1
    One project. Or --all.
  2. 2
    Local state only. Not your code.
  3. 3
    --dry-run first. See the list.

Learn it properly