How to Resume Claude Code Session and Find History
Learn how to resume Claude Code with --resume or --continue, pick older chats, and find the plaintext transcripts saved for each project on your machine.
How you fit resume Claude Code session
To resume Claude Code session, run claude --continue for the most recent conversation for the current directory, or claude --resume to choose older one from list. If you dey inside session wey already dey run, the /resume command go switch you to another conversation without quitting. The short forms na -c and -r.
claude --continue
claude --resume
claude --resume auth-refactorIf you already know the session name or ID, pass am as argument and Claude Code go go straight there without showing the picker.
Everything wey dey below match official session documentation as of November 2026. Claude Code dey release updates often, and flag names plus keyboard shortcuts fit change between versions. So treat claude --help and that page as the authority whenever wetin dey here no match wetin your terminal dey show.
Session actually mean wetin
Session na one saved conversation wey tie to one project directory. E hold the complete message history, including the tool calls wey Claude make and the results wey those calls return. Claude Code dey continuously write am to disk as you work, no be only when you finish, so conversation fit survive when you close terminal or SSH connection loss.
When you resume, e restore more than text. The complete conversation history come back, together with the model wey session dey use and the subagent wey start am if you use --agent. Permission mode come back too when you resume from shell with --continue or session ID. But one safety exception dey: bypass-permissions mode no dey ever restore. So if session end for that mode, e go resume with the mode wey new session for normally start with. Plan mode dey restore too, including when you choose session from picker or switch to am with /resume. These two methods otherwise no dey carry stored mode come back. Terminal resumes don dey restore am since v2.1.290, while picker and /resume don dey restore am since v2.1.292. Older releases dey drop plan mode when dem resume too. From shell, --permission-mode go override any mode wey come back.
Some things no dey come back because dem na launch-time flags, no be saved state. Directories wey you add with --add-dir, and options like --mcp-config, --settings and --plugin-dir, you must pass dem again when you resume. Settings files like settings.json dey read again when launch happen, so anything wey dey inside dem no need repeat. Credentials dey for the same category: Claude Code dey work out how to authenticate during launch from your login and environment, instead of restoring am with conversation. So if you resume session on VPS where one stray ANTHROPIC_API_KEY don enter shell, e go hit the invalid API key error even though e work fine last time.
Why session history dey matter more for VPS
Na this fact dey surprise people. The transcript dey written for the machine wey agent run on. E no dey inside your account, and e no sync go cloud. Na file for that machine disk.
So session wey you leave inside tmux window for your VPS no go show for picker on your laptop. Session from your laptop too no go show for VPS. Nothing dey move between dem. If you work the way most people dey work when dem dey run Claude Code inside tmux for VPS, na the server be where your real conversation history dey gather. The picker wey you see locally go show different and much smaller set.
The same split dey apply across interfaces. The desktop app and VS Code extension each keep their own session history. Neither one be the CLI history, although the desktop app fit also resume CLI session. Claude Code on the web get its own history too. Cowork dey further separate: by default, its sessions dey run for Anthropic cloud and save to your Claude account instead of hardware wey you own. Local execution dey available only for existing desktop deployments. So if you dey consider Cowork against Claude Code, where the transcript end up na part of the decision.
For one machine, the search wide pass wetin you fit expect. claude --resume <session-id> first dey search the current project directory and its git worktrees. After that, e search every other project for that machine. The phrase wey you need remember na "for that machine". Session ID from another host no go resolve to anything, and Claude Code go tell you with No conversation found with session ID: <session-id>.
Where Claude Code dey store session history
By default, transcripts dey under your Claude Code config directory, for a path wey get this form: ~/.claude/projects/<project>/<session-id>.jsonl.
<project> na your working directory path where every non-alphanumeric character don change to hyphen. So, if session start for /home/deploy/apps/api, Claude Code go store am under directory wey dem name -home-deploy-apps-api. If the converted name pass 200 characters, Claude Code go cut am short and add hash of the full path, so the directory name go remain within filesystem limits.
The file na JSONL: one JSON object for each line. Each line fit be a message, tool use or the result, record of request wey Claude Code send to the model, or metadata entry. Na readable text, and e dey okay to read am.
But e no good make you write parser against am. The entry format na internal part of Claude Code, and e fit change between versions. So script wey dey read these files directly fit break after any update. Anthropic own documentation talk say make you use /export or the documented script interfaces instead. This advice make sense for exactly that reason.
Two settings fit change where dem dey store am and how long dem keep am. CLAUDE_CONFIG_DIR move the whole config directory, so na this you go use put transcripts for separate volume or encrypted volume. cleanupPeriodDays inside settings.json control how long dem keep the transcripts. The default na 30 days, and the minimum na 1.
Wetin dey actually inside those transcript files
Every tool result dey recorded, so transcript dey contain the contents of files wey Claude read and the output of commands wey Claude run. Anthropic data usage page talk am clearly: Claude Code dey store session transcripts locally as plaintext for ~/.claude/projects/. Since transcript also record wetin Claude Code send to the model, e fit hold the system prompt, tool definitions, request parameters, and the CLAUDE.md files wey load.
Think about wetin this mean for server. If Claude read a .env file to find out why service no start, the file contents don dey inside JSONL file for your home directory. If command print connection string, that string dey there too. Nothing leak. The transcript record wetin happen, and na the main reason why e suppose dey inside your threat model.
- Backups: plain backup of
/homeor/rootgo copy your transcripts go anywhere wey backups dey stored. Add exclusion, or accept say copies of your prompts and file contents don dey your backup store. - Snapshots and images: VPS snapshot wey you take for any reason go contain the whole directory. Image wey you clone to build another server from go contain am too.
- Other accounts for the box: check the modes yourself with
ls -ld ~/.claude ~/.claude/projectsinstead of assuming say dem tight. - Deliberate uploads:
/feedbackcommand dey send conversation history to Anthropic on purpose, while/bugand/sharereport through the same path. Feedback dialog fit also include other sessions from the same project for the last 24 hours or 7 days, no be only the current one. Na things wey you choose to do, so understand wetin you dey agree to before you confirm.
If you no want transcript at all, CLAUDE_CODE_SKIP_PROMPT_HISTORY dey suppress transcript writes, while --no-session-persistence dey suppress dem for one non-interactive claude -p run. Understand the trade-off before you set either one. Resume reads transcripts, so if transcript no dey, resume no dey too.
How you fit find old conversation
Open the picker with claude --resume, or with /resume from inside session wey dey run. Every row go show session name if you set one. If you no set name, e go show generated title. E go also show time since last activity, git branch, and file size.
The picker dey search. Press /, or just start to type, to filter the list. The shortcuts wey good to learn na the ones wey widen the list: Ctrl+A go show sessions from every project for this machine, Ctrl+W go show every worktree for the current repository, and Ctrl+B go filter am to current git branch. Press Space to preview session content before you choose am, and Ctrl+R to rename the one wey dey highlighted.
Naming sessions dey make everything easier. Start one with claude -n auth-refactor, or run /rename auth-refactor halfway through, when you realise say the conversation don turn to real work. After that, you fit resume named session by name directly from the shell.
Unnamed session still go get generated title. Background request to small fast model dey write the title and summarise your first prompt. That title help you recognise the row for the picker, and e also work as resume handle: claude --resume go resolve am the same way as name wey you set. But default display name no dey work. Example na my-app-3f, wey unnamed interactive session dey carry for listings of sessions wey dey run. If you pass am to claude --resume, Claude Code no go find the session.
Grepping transcripts wey go help find correct session
Sometimes you fit remember one phrase and nothing else. Transcripts na text, so search dem.
grep -rl "nftables" ~/.claude/projects/That command go print paths of transcripts wey match. Filename without the .jsonl extension na session ID, and claude --resume <session-id> fit accept am. claude --resume too fit accept the transcript absolute path directly. Use grep figure out which session you want, then resume am or export am so you fit read the content.
Two honest caveats dey. The content dey JSON-escaped, so phrase wey contain quote characters, or phrase wey split across line break, fit no match as literal string. And if match dey inside tool result, e mean Claude see that text; e no mean say anybody type am.
Leit wan export one conversation
/export go render the current conversation as plain text, with messages and tool output written out in readable way instead of JSON. If you no give argument, e go open menu wey offer clipboard or file. If you give filename, /export handover.txt go write directly to that path. Na this be the correct way to move conversation from server go your laptop, or attach am to ticket.
For anything wey you automate, use the interfaces wey dem design to remain stable. Hooks and status line commands receive transcript_path field as input, so SessionEnd hook fit archive transcript when session end. You fit also ask stored session question without opening am:
claude -p --resume <session-id> --output-format json "summarize what we changed" | jq -r '.result'This one go send follow-up prompt into the old conversation and return structured JSON. E better pass make you parse JSONL format wey fit change for next release.
When starting fresh dey better pass resuming
Resuming go bring back the complete history, and na this complete history every later request go carry. Conversation wey run for four hours yesterday expensive to continue today, and how token usage dey add up across one long session explain where that cost really come from.
Claude Code sometimes dey choose middle way for you. If you leave long conversation idle inside interactive terminal session and e dey use the one-hour prompt cache, wey Claude subscription give the main conversation by default inside your plan usage, idle compaction go compact am after about 54 minutes, shortly before the cache expire. E go apply once the conversation context reach token threshold, 200,000 by default, while auto-compaction dey on and the machine dey awake at that time. Before v2.1.314, Claude Code also need fetch feature flags from Anthropic, so subscribers wey turn telemetry off never get am; since v2.1.314, e dey run for dem too, and for VS Code extension chat panel and desktop app Code tab. No dialog go ask first. When you come back, the conversation go show line wey start with Compacted while idle, before the prompt cache expired, and your next message go send summary instead of the complete history.
- Leave am on and later requests go cheaper, but anything wey the summary drop no longer dey available. You fit lower the threshold with
CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS, though values below 100,000 go increase to 100,000. - Turn am off by setting
idleCompactiontofalseinsidesettings.json, or from the Idle compaction row inside/configon v2.1.302 or later, and the conversation go remain complete with per-request cost wey scale with its size. If the cache don expire before you send your next message, that request go reprocess the complete history once.
For Pro and Max plans, v2.1.304 add one more check, and current documentation list Ultra plans too. When resuming long conversation after long break, or on different model, go use noticeable part of your 5-hour usage limit, a Resume this conversation? dialog go show the estimated share and allow you resume anyway or start new conversation. When the new-conversation option talk so, Claude fit look up the previous one if you refer to am.
The decision easier than e look. Resume when the next thing you wan type depend on wetin don already talk. Start fresh when e no depend on am. Drift easy to notice once you dey watch for am: Claude dey refer to file wey you delete one hour ago, or dey argue again about decision wey you settle for beginning of the session. Na stale context be that, and carrying am forward go cost you tokens and accuracy at the same time.
If the useful part of old conversation na decision or fact wey you go need again, no rely on resuming to carry am. Write am down where every session fit see am, and na wetin Claude Code memory files dey for.
/branch dey worth knowing here too. E go copy the conversation up to the current point and switch you into the copy, while e leave the original intact and still inside the picker. Use am to try another approach without losing the first one.
How resume take different form compaction and memory
People dey confuse dem plenty, but dem dey solve different problems.
Resume na to bring conversation back after you don exit, reboot, or move go another task. Compaction na about context window inside live conversation: /compact go replace wetin Claude dey carry with summary, so later requests go send fewer tokens. If your problem na say context window full, compaction na the tool to use, and how to manage Claude Code context window explain am properly.
Memory different again. CLAUDE.md files and auto memory hold instructions and facts wey load when every session start, so dem no be conversation wey you return to. Na things wey you write down so you no ever need return to one.
If wetin you want na two conversations wey dey run at the same time and coordinate, na separate mechanism be that. Claude Code sessions fit send message to each other while both dey live. This different from bringing yesterday session back from disk.
FAQ
Where Claude Code dey store my session history?
By default, e dey store am under your config directory, for ~/.claude/projects/<project>/<session-id>.jsonl. For this place, <project> na the working directory path wey dem don replace all non-alphanumeric characters with hyphens. Each file na JSONL: one JSON object per line for a message, tool use or the result, record of request wey dem send to the model, or metadata entry. CLAUDE_CONFIG_DIR dey move the config directory go another place, while cleanupPeriodDays inside settings.json dey set how long transcripts go remain. The default na 30 days, and the minimum na 1.
Why I no fit see my VPS session for the picker on my laptop?
Na because dem dey write transcripts to the disk of the machine wey agent run on, and nothing dey sync dem between machines. Conversation wey you get inside tmux for your VPS dey only for the VPS. Resume am there through SSH, or run /export inside am and copy the text file across if you want local record.
I fit resume session wey I start for another directory?
Yes, if you get the session ID. claude --resume <session-id> first dey search the current project directory and its git worktrees, then e dey search every other project for the same machine. Inside the picker, Ctrl+A dey widen the list to every project for the machine, while Ctrl+W dey widen am to every worktree of the current repository. If nothing match, Claude Code go report No conversation found with session ID: <session-id>.
I suppose resume old session or start new one?
Resume am when your next message depend on wetin una don already talk for that conversation. Start fresh when e no depend on am, because resuming dey reload the complete history, and every later request go carry that history. Watch for drift: if session dey continue refer to files wey you don delete, e still dey carry stale context. That context dey cost tokens and reduce accuracy for every turn.
I fit stop Claude Code from writing transcripts to disk?
Yes. CLAUDE_CODE_SKIP_PROMPT_HISTORY dey stop transcript writes, while --no-session-persistence dey stop dem for one non-interactive claude -p run. First understand the trade-off, because na transcripts resume dey read. If you turn dem off, --continue and --resume no go get anything to load. If your concern na where the files dey, instead of whether dem exist at all, point CLAUDE_CONFIG_DIR to an encrypted volume and reduce cleanupPeriodDays instead.