Part ofWhat Is Claude Code? The Complete Guide
In This Article
6 sectionsQuick answer
Claude Code saves every session automatically. Resume the latest with --continue, pick an older one with --resume, and find them as JSONL transcripts.
Claude Code sessions are saved automatically as you work, so you never lose a conversation. Resume the most recent one in a folder with claude --continue, or run claude --resume to open a picker and jump back into any past session. Each session is stored locally as a JSONL transcript, and /clear starts a fresh one without deleting the old.
Session flags and transcript paths verified 31 July 2026 against Anthropic's Claude Code session reference.
Every conversation you have with Claude Code is a session, and knowing how to move between them is what turns the tool from a one-shot chat into a persistent workspace. We hop between Claude Code sessions constantly — one per feature, one for a bug hunt, one for docs — and pick each back up exactly where we left it. Below is how sessions work, how to resume and list them, where they live on disk, and how to manage them so your context stays sharp and your bill stays low. Session handling works the same whichever model you're currently running — Claude Opus 5 ($5/$25 per million tokens), Sonnet 5 ($3/$15), or Haiku 4.5 ($1/$5) — and resuming one takes under 10 seconds, so we review this guide regularly to keep the flags accurate. We put this through its paces on our own setup first, so the notes below reflect what really happened, not what should happen.
Key takeaway
Claude Code saves every session automatically as a local JSONL transcript under ~/.claude/projects/ — resume the most recent with claude --continue, pick any past session with claude --resume, and note that /clear starts a fresh session without deleting the old one (transcripts persist about 30 days by default).
What Claude Code sessions are
A session is one continuous conversation scoped to the directory you started it in, holding every prompt, response, file edit, and command run. Transcripts are written to disk continuously, so nothing is lost if the terminal closes.
A session is a single continuous conversation with Claude Code, scoped to the directory you started it in. It holds the full history — your prompts, Claude's responses, every file read and edit, every command run. That history is what lets Claude remember what it did three steps ago.
Crucially, Claude Code sessions save continuously. You don't press save; the transcript is written to disk as you go, so if you close the terminal, your laptop dies, or you run /clear, the conversation is still there to resume. This is the mental model that makes everything else make sense: sessions are durable by default, not disposable.
How to resume a Claude Code session
Run claude --continue (or -c) to reopen the most recent session in the current directory, or claude --resume (-r) for an interactive picker. Inside a running session, /resume opens the same picker without exiting.
There are two commands for getting back into a session, and picking the right one depends on whether you want the latest one or a specific one:
| Command | What it does | Use when |
|---|---|---|
claude --continue (or claude -c) | Resumes the most recent session in the current directory | You're picking up where you just left off |
claude --resume (or claude -r) | Opens an interactive picker of past sessions | You want an older session, or you have several |
claude -r "<session-id>" | Jumps straight to a specific session by ID | You're scripting or know the exact session |
/resume (inside a session) | Opens the same picker without leaving Claude Code | You're already running and want to switch |
--continue is the one you'll use most — it's the "keep going" button. Reach for --resume when you juggle multiple Claude Code sessions and need to hop back to one from earlier. You can also add --fork-session to branch a copy instead of continuing the original, which is handy when you want to try a different approach without losing the thread.
How to list your Claude Code sessions
Run claude --resume with no arguments, or /resume from inside a session, to open the picker. Each row shows the session name or summary, time since last activity, message count, and the git branch it ran on.
To see what you can resume, run claude --resume with no arguments (or /resume inside a session). That opens the picker — the fastest way to list your Claude Code sessions. Each row shows:
- The session name if you set one, otherwise the conversation summary or your first prompt
- Time since last activity, so you can spot the one you want
- Message count, a rough gauge of how deep the session went
- The git branch it was running on
The picker is scoped to your current project directory, so you only see sessions relevant to the code you're in. That keeps the list short and the right session easy to find, even if you've run dozens of sessions across different repos.
Where session transcripts are stored
Each session is a plain JSONL file at ~/.claude/projects/<project>/<session-id>.jsonl, where <project> is your working-directory path with non-alphanumeric characters replaced by hyphens. Being plain text, transcripts are greppable, scriptable, and easy to back up.
Every session is a plain-text JSONL transcript on your machine. By default they live at:
~/.claude/projects/<project>/<session-id>.jsonl
Here <project> is your working-directory path with non-alphanumeric characters replaced by -, and <session-id> is the session's unique ID. Because they're plain JSONL, your session transcripts are greppable, scriptable, and backup-friendly — you can search old transcripts for a command you ran last week or feed them into your own tooling.
| Fact | Detail |
|---|---|
| Format | JSONL (one JSON object per line) |
| Location | ~/.claude/projects/<project>/<session-id>.jsonl |
| Scope | Per working directory |
| Saved | Continuously, as you work |
Managing sessions: clear, fork, and cost
Run /clear between unrelated tasks to drop context without deleting the saved transcript, use --fork-session to branch a copy, and keep threads short — every turn re-sends the whole history, so sprawling conversations cost more.
Good session hygiene is mostly about knowing when to start fresh. Three habits matter:
- Use
/clearbetween unrelated tasks./clearends the current session's context and starts a clean one — the old session stays saved to disk, so you lose nothing but the baggage. This is the single biggest lever on both Claude's focus and your bill, because a long session re-sends its entire history every turn. - Fork when you want a branch.
claude --resume --fork-sessioncopies a session so you can explore a different direction without touching the original — the equivalent of a git branch for your conversation. - Watch cost on long sessions. The longer a session runs, the more tokens each turn costs, since the whole transcript is re-sent. If you're on the API, clear often; we break the math down in our Claude Code cost guide.
On this site we run a session per job — one for a batch of drafts, another for an image-generation run, a third for a gnarly build error — and the habit that took longest to build was trusting /clear. Early on we'd let a single session sprawl across three unrelated tasks and then wonder why Claude's answers drifted and the turns started to feel sluggish. Splitting the work and naming the sessions worth returning to fixed both problems at once, and the picker now reads like a table of contents for the week rather than a wall of look-alike summaries.
A stale, sprawling session makes Claude slower and pricier and its answers worse. Starting a fresh session for each new task — and resuming the right old one when you return — is the whole discipline. It pairs naturally with plan mode for structured work and with your statusline, which can surface the active session at a glance.
Sessions across devices and automation
Remote Control lets you pick up a local session from a phone or another machine, and the SDK exposes sessions directly: each query() call carries a session ID, and a resume option reattaches to an existing conversation.
Sessions aren't locked to the terminal you started them in. Two extensions are worth knowing:
- Continue a session from another device. Claude Code's Remote Control lets you pick up a local session from your phone or another machine — kick off a long refactor at your desk, then check on it from the couch. It's the same durable transcript; you're just attaching a new front end to the running session.
- Drive sessions from the SDK. If you build on top of Claude Code, sessions are first-class: each
query()call is linked by a session ID, and aresumeoption reattaches to an existing one. That's how you script multi-step agents that remember prior turns instead of starting cold every run.
Anthropic's full session reference documents every flag, including how naming a session makes it easier to spot in the picker later. A quick habit that pays off: give a session a memorable name when you know you'll return to it — a migration, a long investigation — so the picker shows a label you recognise instead of a truncated first prompt.
The throughline across all of it is the same: your work is a durable, resumable session, not a throwaway chat. Once that clicks, you stop losing context. You start a session per task, name the ones that matter, resume the right one when you come back, and clear the rest — the discipline that makes Claude Code feel less like a chatbot and more like a workspace that remembers what you were doing.
Want the transcript itself rather than the session? Our guide to Claude Code save conversation covers export, resume, and the 30-day retention clock.
Frequently Asked Questions

Written by
InnovateTechie
Writing about Claude and the Anthropic toolkit — models, Claude Code, pricing, features, and fixes, in clear, practical, hands-on guides tested by daily use.
View all posts →


