Claude Code List Sessions: Finding and Managing Past Conversations
There's no claude sessions list command. Here's what actually lists your past sessions: the picker, claude agents --json, naming, and cleaning old ones up.

Made with DispatchSEO
On this page
Claude Code has no claude sessions list command. The closest things are claude --resume (or /resume from inside a session), which opens an interactive picker of every stored session, and claude agents --json, which prints a machine-readable list of the ones still running in the background. Finding an old conversation means narrowing that picker; getting rid of one for good means either waiting out the automatic retention sweep or running claude project purge yourself.
TL;DR: No list subcommand exists -
claude --resumeis the picker, scoped to the current worktree by default. Widen it withCtrl+W(all worktrees) orCtrl+A(all projects), narrow it with search mode orCtrl+B(current branch). Sessions delete themselves automatically aftercleanupPeriodDays(30 by default), or immediately withclaude project purge <path> --dry-run.
There's no sessions list command, but three things act like one
Typing claude sessions or claude list gets you nowhere - Claude Code doesn't ship either one. Instead you get an interactive way to browse and a separate, narrower way to script against:
claude --resumeopens the picker from a fresh terminal, before Claude Code has even started a conversation./resumeopens the identical picker from inside a running session, so you can switch without exiting first.claude agents --jsonis the one that actually returns structured output, but it's scoped to background sessions currently running - not your full history. It's built for scripts and dashboards, not for finding an old conversation.
For everything else - a session you finished last week, one from a different project - the picker is the only list there is.
Narrowing the picker down to one session
The picker's scope widens one shortcut at a time
claude --resume- 1defaultCurrent worktree
What the picker opens to: this worktree's sessions, plus any directory added mid-session with /add-dir
- 2Ctrl+WEvery worktree of this repo
Only shown when the repo actually has more than one worktree. Press again to go back
- 3Ctrl+AEvery project on this machine
Widens past the repo entirely - each row now also shows its project path. Press again to go back
- Ctrl+BCurrent git branch
Filters whatever scope is active down to one branch. Press again to clear it
- / or typeSearch mode
Any printable key filters by name, title, or prompt text - or paste a PR/MR URL to jump straight to the session that created it
Same list of shortcuts inside a running session with /resume, and from the CLI with claude --resume before Claude Code even starts.
Each row in the picker shows the session's name if you set one, otherwise its AI-generated title or first prompt, plus time since last activity, git branch, and file size. Widen to every project with Ctrl+A and each row also grows a project-path column, since "auth-refactor" stops being unique once you're looking machine-wide.
Two shortcuts navigate without changing scope at all: arrow keys move between rows, and → / ← expand or collapse a grouped session - /branch and --fork-session copies get their own row but group under the original when the picker finds more than one entry for the same conversation. Space (or Ctrl+V on terminals that eat Space as paste) previews a session's content before you commit to resuming it.
Pasting a GitHub, GitHub Enterprise, GitLab, or Bitbucket pull or merge request URL into search mode filters straight to the session that created it - the same filter claude --from-pr <number> applies from the command line, and claude --from-pr with no number opens the picker pre-filtered to PR-linked sessions.
Naming a session so it's easy to find again
An unnamed session is still in the picker, just harder to pick out - "my-app-3f" and a wall of first-prompt titles don't scan the way "auth-refactor" does. Four ways to set one:
| When | How |
|---|---|
| At startup | claude -n auth-refactor |
| Mid-session | /rename auth-refactor - also updates the prompt bar |
| From the picker | Highlight the row, press Ctrl+R |
| On plan accept | Accepting a plan in plan mode auto-titles the session from the plan, unless you already named it |
Only some of what a session shows you doubles as a resume handle. A name you set, and a generated title (from the first prompt, or from an accepted plan) both work with claude --resume <name> or /resume <name>. The default display name Claude Code assigns to an unnamed session (my-app-3f) does not - pass it to --resume and Claude Code reports no match, because that label exists only to identify the session in listings like claude agents --json, not to resume by.
Name collisions resolve automatically as of v2.1.232: start or rename a session into a name a live session already has, and Claude Code keeps the name with the original, renames yours to a variant like auth-refactor-graceful-unicorn, and tells you. Run /rename again if you'd rather pick your own.
What Claude Code deletes automatically, and on what schedule
What the sweep touches once a session ages out
cleanupPeriodDaysConversation transcripts
Every session's .jsonl, plus orphaned copies set aside instead of overwritten
Subagent transcripts and tool results
Per-session subagents/ and tool-results/ - large outputs included
File-history checkpoints and caches
Pre-edit file snapshots, paste cache, image cache, and uploaded files
Plans, debug logs, and task lists
Per-session plans/, debug/, and tasks/ entries
Old .claude.json backups
Rotates automatically too, but keeps the 5 newest regardless of age
Prompt history (history.jsonl)
Never age-swept - only claude project purge trims matching lines from it
Auto memory
projects/<project>/memory/ - the directory is only removed once it's been empty for a full retention period
Credentials and daemon state
.credentials.json, agent-memory/, jobs/, and daemon/ are excluded from the sweep entirely
Default retention is 30 days, minimum 1 - grouped from the full per-path table on code.claude.com's claude-directory reference.
The sweep pauses rather than guesses when it can't determine the retention period safely: inside claude -p --bare, or when cleanupPeriodDays is set but malformed (it warns in /status either way). A managed-settings value for cleanupPeriodDays always wins and runs the sweep regardless.
None of this is encrypted at rest - transcripts are plain JSONL, and anything a tool read or a command printed during the session, credentials included, is in there. Lowering cleanupPeriodDays, setting desktopSessionCleanupPeriodDays for the desktop app, or setting CLAUDE_CODE_SKIP_PROMPT_HISTORY to stop writing history at all are the levers if that's a concern on a given machine.
Deleting sessions yourself, three different ways
The sweep is age-based and passive. Three commands remove sessions on your own timeline instead, and they don't do the same thing:
| Method | Removes | Reversible? |
|---|---|---|
| Automatic sweep | Everything in the inventory above, once it crosses cleanupPeriodDays | No |
claude project purge <path> | The same, immediately, for one project - plus its entry in ~/.claude.json and its lines in history.jsonl | No |
claude rm <id> | A background session's entry in claude agents only | Not needed - the transcript stays on disk and stays resumable with claude --resume |
claude project purge is the one built for cleanup, not claude rm - the latter clears a background session off your dashboard without touching what it wrote.
claude project purge --dry-run, run against this guide's own repo
v2.1.278claude project purge "$(pwd)" --dry-run
Purge plan for /home/runner/work/clockedcode/clockedcode:
dir: /home/runner/.claude/projects/-home-runner-work-clockedcode-clockedcode
project transcripts (.jsonl) and memory/
shell-snapshots/ are not project-scoped and will not be touched
backups/ may still contain this project entry in old .claude.json snapshots
(/home/runner/.claude/backups); at most 5 are kept and they rotate out automatically
Dry run: 1 item(s) would be deleted.claude project purge --help
- --dry-runList what would be deleted, delete nothing
- -y, --yesSkip the confirmation prompt - for scripts
- -i, --interactiveStep through the plan one item at a time
- --allPurge every project instead of one path
One item because this checkout has one project transcript directory - purge counts the transcripts directory as a unit, not a file at a time.
Run it without --dry-run and Claude Code asks Delete N item(s) for <path>? This cannot be undone. [y/N] before touching anything; -y skips that for scripts, -i steps through the plan item by item instead of all-or-nothing, and --all purges every project Claude Code knows about (it's also the one flag that deletes history.jsonl outright rather than filtering it). Running claude project purge with no path at all lets you pick a project from a list.
Once you've found it, resuming is the easy part
Everything above gets you to the right row. What happens after you press Enter - what actually carries over, what you have to pass again, and why the picker starts a resumed session in a different permission mode than a direct --continue does - is its own guide: Claude Code Resume Session.
When browsing history isn't the right tool
- You need session data in a script, not on a screen.
claude -p --output-format jsonfor a one-off structured result,claude -p --resume <session-id>to send a follow-up to an existing session and parse the JSON reply, or the Agent SDK to receive messages programmatically. Don't parse the.jsonltranscripts directly - the entry format is internal and changes between releases. - You want every session gone right now, everywhere, not just one project.
claude project purge --all, not repeated single-project purges - it also clearshistory.jsonloutright, which a per-project purge only filters. - A background session is cluttering
claude agents, but you still want the conversation.claude rm <id>, notclaude project purge- purge takes the transcript with it,rmdoesn't. - You're troubleshooting why a session doesn't show up at all. That's a picker-scope problem (widen with
Ctrl+A) or aclaude -p/ SDK session (deliberately excluded from the picker and--continueby design) - not something purge, rm, or the sweep affects.
FAQ
Is there a claude sessions list command?
No. claude --resume opens an interactive picker of every stored session, /resume opens the same picker without exiting, and claude agents --json prints a JSON list of sessions currently running in the background.
How do I see Claude Code sessions from every project, not just the current one?
Open the picker with claude --resume or /resume and press Ctrl+A. Press it again to go back to the current repository.
How do I find a session by name instead of scrolling the picker?
Press / or type any character in the picker to enter search mode, or resume it directly with claude --resume <name> if the name matches exactly one session.
How long does Claude Code keep old sessions before deleting them?
30 days by default, set by cleanupPeriodDays in settings.json. The minimum is 1 day, and the sweep also removes tool outputs, file-history snapshots, and several other per-session files once they pass that age.
How do I delete all of a project's Claude Code sessions right now instead of waiting for the sweep?
Run claude project purge <path>. Add --dry-run first to see what it would remove, or -y to skip the confirmation prompt in a script.
Name sessions as you go, and the list mostly manages itself
The picker only gets harder to scan when everything in it is an unnamed first-prompt title. Typing -n or running /rename the moment you start something worth finding again later beats any amount of Ctrl+A widening after the fact. Set cleanupPeriodDays to something honest for how long you actually go back to old work, and claude project purge handles the rest when a project's done for good. For the exact flags without re-reading this whole guide, ClockedCode's cheat sheet has them printed out.