# claude purge Command

> It deletes what Claude Code keeps for one project.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** claude purge, Clear local data

## Think of it like

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

## 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

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.

## Example code

```bash
claude purge ~/work/repo --dry-run
```

See what would be deleted, and delete nothing.

## Why it matters

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

## Common mistake

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

## Three principles

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

## Related terms

- [Session Transcript](https://learn.benibix.com/term/ai/session-transcript)
- [Claude Code Checkpoint](https://learn.benibix.com/term/ai/claude-code-checkpoint)
- [Claude Code Session](https://learn.benibix.com/term/ai/claude-code-session)

## Taught in

- [Install, Update and Doctor](https://learn.benibix.com/learn/ai-claude-code-commands/install-update-and-doctor): Claude Code Commands, 2/17

![What claude purge deletes for one project: transcripts, task lists, debug logs, edit history, prompt history and the project's line in ~/.claude.json.](https://learn.benibix.com/diagrams/cli-purge.svg)

---

Source: https://learn.benibix.com/term/ai/claude-purge-command
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
