Use claude project purge to delete the transcripts, prompt history, and file snapshots for one project in a single confirmed step. To remove a single conversation, delete its file at ~/.claude/projects/<encoded-project-path>/<session-id>.jsonl. /clear does not delete anything: it starts a new conversation and leaves the old transcript on disk, resumable with /resume. Transcripts are plaintext and are swept at startup once they are older than cleanupPeriodDays, which defaults to 30 days.
/cleardeletes nothing. It starts a new conversation; the old one stays on disk.- Transcripts live at
~/.claude/projects/<project>/<session-id>.jsonl, in plaintext. claude project purgeis the supported way to remove one project cleanly.- The startup sweep removes transcripts older than
cleanupPeriodDays, default 30. history.jsonlis not swept. Every prompt you have ever typed is still in it.
The short answer
Four things people mean by "delete a session".
| You want | Do | Removes files |
|---|---|---|
| A fresh context, same project | /clear | No |
| One conversation gone from disk | Delete its .jsonl | Yes, that one |
| Everything for one project gone | claude project purge <path> | Yes, plus history lines |
| A cloud session gone | Delete it in the claude.ai/code sidebar | Yes, server side |
What /clear actually does
/clear is a context command, not a privacy command. It empties the context window and starts a new conversation in the same directory. The conversation you just cleared is saved, listed in the picker, and resumable.
/clear # new conversation, previous one saved
/resume # ... and there it is, still in the list
The three commands people confuse.
| Command | Context | Files on disk |
|---|---|---|
/compact | Replaced with a summary | Untouched |
/clear | Emptied, new conversation | Untouched |
/rewind | Optionally rewound | Restores tracked edits, deletes nothing |
Where the transcripts live
One JSONL file per session, under a directory named after the working directory with every non-alphanumeric character replaced by a hyphen. That encoding is the only reason the path looks strange.
# /Users/you/work/my-repo becomes -Users-you-work-my-repo
ls ~/.claude/projects/
# newest sessions for one project, largest first
ls -laht ~/.claude/projects/-Users-you-work-my-repo/
# which file is which conversation? read the first prompt out of each
for f in ~/.claude/projects/-Users-you-work-my-repo/*.jsonl; do
echo "== $f"
head -c 400 "$f"; echo
done
What else a session writes under ~/.claude/.
| Path | Holds |
|---|---|
projects/<project>/<session>.jsonl | Every message, tool call, and tool result |
projects/<project>/<session>/subagents/ | Subagent transcripts, removed with the parent |
projects/<project>/<session>/tool-results/ | Large tool outputs spilled to files |
file-history/<session>/ | Pre-edit file snapshots, used by /rewind |
history.jsonl | Every prompt you have typed, with timestamp and project path |
plans/, paste-cache/, image-cache/ | Plan files, large pastes, attached images |
stats-cache.json | Aggregated token and cost counts behind /usage |
Delete one session
Find its session id
The picker shows the name, the first prompt, the branch, and the file size. If you only know roughly what it was about, grep for it.
grep -rl "optimistic locking" ~/.claude/projects/ | head
Remove the transcript and everything hanging off it
P=~/.claude/projects/-Users-you-work-my-repo
S=8f3c1b2a-...
rm -f "$P/$S.jsonl"
rm -rf "$P/$S" # subagents/ and tool-results/
rm -rf ~/.claude/file-history/"$S" # checkpoint snapshots
Remember what is left over
The prompts you typed in that session are still in ~/.claude/history.jsonl, which the automatic sweep never touches. Deleting one session by hand does not filter them out; claude project purge does.
Delete everything for one project
This is the supported path, and it cleans up the parts you would otherwise forget: the transcripts, the auto memory, per-session task, debug, and file-history entries, the matching lines in history.jsonl, and the project entry in ~/.claude.json.
claude project purge ~/work/my-repo --dry-run
Purge plan for /home/user/work/my-repo:
dir: /home/user/.claude/projects/-home-user-work-my-repo
project transcripts (.jsonl) and memory/
config: projects["/home/user/work/my-repo"]
project entry in ~/.claude.json (trust, history, MCP servers)
filter: /home/user/.claude/history.jsonl
12 prompt(s) typed in this project
Dry run: 3 item(s) would be deleted.
claude project purge ~/work/my-repo # one confirmation prompt
claude project purge ~/work/my-repo --yes # no prompt, for scripts
claude project purge --all # every project on this machine
claude project purge # pick from an interactive list
The sweep that already deletes your history
Claude Code runs a quiet retention sweep at every startup and removes application data older than cleanupPeriodDays. The default is 30 days. Most people discover this the day they go looking for a transcript from six weeks ago.
{
"cleanupPeriodDays": 3650
}
| Value | Effect |
|---|---|
| Unset | 30 days |
1 | The minimum. Yesterday is gone. |
3650 | Ten years, which is how people mean "keep everything" |
0 | Rejected with a validation error |
Never write them in the first place
Three different scopes, three different switches.
| Goal | Set |
|---|---|
| No transcripts or prompt history, in any mode | CLAUDE_CODE_SKIP_PROMPT_HISTORY |
| No persistence for one scripted run | --no-session-persistence with -p |
| No persistence in the Agent SDK | persistSession: false |
| Same data, somewhere else | CLAUDE_CONFIG_DIR |
claude -p --no-session-persistence "summarise the failing test output"
# or for a whole shell, at the cost of resume and rewind
export CLAUDE_CODE_SKIP_PROMPT_HISTORY=1
{
"permissions": {
"deny": ["Read(./.env)", "Read(./.env.*)", "Read(./secrets/**)"]
}
}
Web, desktop, and the server side
Local deletion does nothing to sessions that ran somewhere else, and nothing to what Anthropic holds.
| Where | How to delete |
|---|---|
claude.ai/code cloud session | Session menu, then Delete, or filter to archived and use the delete icon |
| Desktop app session | Hover the session in the sidebar and archive it, which also removes its worktree |
| Anthropic servers, consumer plans | 30 days, or 5 years if you allow data use for model improvement |
| Anthropic servers, Team, Enterprise, API | 30 days as standard; zero data retention for qualified Enterprise accounts |
Transcripts you sent with /feedback, /bug, or /share | Retained for 5 years |
Questions people ask
No. It starts a new conversation and leaves the previous one on disk, listed in the /resume picker. To delete it you have to remove the transcript file or run claude project purge.
As one JSONL file per session inside ~/.claude/projects/, in a directory named after your working directory path with every non-alphanumeric character replaced by a hyphen. Prompts are also appended to ~/.claude/history.jsonl.
Delete its .jsonl file, plus the same-named directory next to it holding subagent transcripts and spilled tool results, and its folder under ~/.claude/file-history/. There is no delete option in the session picker.
Transcripts and auto memory under projects/, per-session tasks, debug, and file-history entries, matching prompt lines in history.jsonl, and the project entry in ~/.claude.json. Run it with --dry-run first to see the plan.
The startup sweep deletes application data older than cleanupPeriodDays, which defaults to 30 days. Set it higher in ~/.claude/settings.json, for example 3650, if you want to keep transcripts long term.
Yes, as long as you accept losing resume, continue, and rewind for past sessions. Do not delete ~/.claude.json, ~/.claude/settings.json, or ~/.claude/plugins, which hold your auth, preferences, and installed plugins.
No. They are plaintext, and filesystem permissions are the only protection. Anything a tool read or a command printed, including credentials, is written into them verbatim.
No. Server-side retention is 30 days for commercial accounts and for consumer accounts that opt out of model improvement, and 5 years for consumer accounts that opt in. Cloud sessions are deleted separately from the claude.ai/code sidebar.
Sources
Every figure above was read from these pages on August 2026. Vendors reprice without notice; if you find a stale number, tell us.