Delete a Claude Code session, and everything it left behind

The command most people reach for does not delete anything. Claude Code keeps a full plaintext transcript of every session on disk, and removing one is a separate, deliberate act.

By the Continuum team. We build a workbench that runs Claude Code, Codex, and their peers, so the model rates quoted here are the ones our own cost analytics ship with.

The short version

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.

What you need to know
  • /clear deletes 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 purge is the supported way to remove one project cleanly.
  • The startup sweep removes transcripts older than cleanupPeriodDays, default 30.
  • history.jsonl is not swept. Every prompt you have ever typed is still in it.

The short answer

Four things people mean by "delete a session".

You wantDoRemoves files
A fresh context, same project/clearNo
One conversation gone from diskDelete its .jsonlYes, that one
Everything for one project goneclaude project purge <path>Yes, plus history lines
A cloud session goneDelete it in the claude.ai/code sidebarYes, 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.

CommandContextFiles on disk
/compactReplaced with a summaryUntouched
/clearEmptied, new conversationUntouched
/rewindOptionally rewoundRestores 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.

Find the transcripts for a project.
# /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/.

PathHolds
projects/<project>/<session>.jsonlEvery 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.jsonlEvery prompt you have typed, with timestamp and project path
plans/, paste-cache/, image-cache/Plan files, large pastes, attached images
stats-cache.jsonAggregated token and cost counts behind /usage

Delete one session

01

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
02

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
03

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.

Always dry run first. It prints the plan and changes nothing.
claude project purge ~/work/my-repo --dry-run
The plan tells you why each item is included.
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.
Then commit to it.
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.

~/.claude/settings.json
{
  "cleanupPeriodDays": 3650
}
ValueEffect
Unset30 days
1The minimum. Yesterday is gone.
3650Ten years, which is how people mean "keep everything"
0Rejected with a validation error

Never write them in the first place

Three different scopes, three different switches.

GoalSet
No transcripts or prompt history, in any modeCLAUDE_CODE_SKIP_PROMPT_HISTORY
No persistence for one scripted run--no-session-persistence with -p
No persistence in the Agent SDKpersistSession: false
Same data, somewhere elseCLAUDE_CONFIG_DIR
A one-off run that leaves nothing behind.
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
~/.claude/settings.json
{
  "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.

WhereHow to delete
claude.ai/code cloud sessionSession menu, then Delete, or filter to archived and use the delete icon
Desktop app sessionHover the session in the sidebar and archive it, which also removes its worktree
Anthropic servers, consumer plans30 days, or 5 years if you allow data use for model improvement
Anthropic servers, Team, Enterprise, API30 days as standard; zero data retention for qualified Enterprise accounts
Transcripts you sent with /feedback, /bug, or /shareRetained 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.

  1. Explore the .claude directory
  2. Claude Code: manage sessions
  3. Claude Code data usage
  4. Claude Code settings reference
Try it

Your history,
on your disk.

Continuum reads the transcripts Claude Code and Codex already write, and never uploads them to price your spend.

free app · your subscriptions · local-first