SSD Nodes Learn Hosting plans →
How to do am Matt ConnorBy Matt Connor · Updated 2026-09-12

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 latest conversation for the current directory, or claude --resume to choose older one from list. If you dey inside session wey already dey run, /resume command go switch you go another conversation without quitting. The short forms na -c and -r.

claude --continue
claude --resume
claude --resume auth-refactor

If you already know the session name or ID, pass am as argument and Claude Code go enter there directly without showing the picker.

Everything for here follow official session documentation as of August 2026. Claude Code dey release updates often, and flag names plus keyboard shortcuts fit change between versions. So use claude --help and that page as the authority whenever wetin dey here no match wetin your terminal dey show.

Wetin session actually be

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 write am to disk continuously as you work, no be only once for the end, so conversation fit survive closing terminal or losing SSH connection.

When you resume, e restore more than just the text. The complete conversation history go come back, together with the model wey session dey use and the subagent wey start am if you use --agent. Permission mode go come back too, but safety get some exceptions: plan mode and bypass-permissions mode no dey ever restore. So, if session dey one of those modes, e go resume with the mode wey new session for normally start with.

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 repeating. Credentials dey for the same category: Claude Code dey figure out how to authenticate during launch from your login and environment, instead of restoring am with the conversation. So, if you resume session for VPS wey one stray ANTHROPIC_API_KEY don enter the shell, e go hit the invalid API key error, even though e run fine last time.

Why session history dey matter more for VPS

Here be the fact wey dey surprise people. The transcript dey write for the machine wey agent run on. E no dey inside your account, and e no sync go cloud. Na file wey dey for that box disk.

So, session wey you leave inside tmux window for your VPS no go show for picker on your laptop, and session from your laptop no go show for the VPS. Nothing dey move between dem. If you dey work the way most people dey when you dey run Claude Code inside tmux for VPS, na server be where your real conversation history dey gather, and the picker wey you see locally dey show different and much smaller set.

This same separation dey apply across interfaces. Desktop app and VS Code extension each dey keep their own session history, and none of dem be CLI history. Claude Code for web get its own one too. Cowork dey even further apart, because e dey run inside Anthropic sandbox instead of hardware wey you own. So, if you dey compare Cowork with Claude Code, where transcript dey end up na part of the decision.

For one machine, the search wide pass wetin you fit expect. claude --resume <session-id> dey first check current project directory and its git worktrees, then e check 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>.

Claude Code dey store session history for where

By default, transcripts dey under your Claude Code config directory, for path wey get this form ~/.claude/projects/<project>/<session-id>.jsonl.

<project> na your working directory path where dem don replace every non-alphanumeric character with hyphen. So, if session start for /home/deploy/apps/api, dem 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 message, tool use, or metadata entry. Na readable text, and reading am dey okay.

But writing parser against am no good. 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. Na good advice because of this exact reason.

Two settings fit change where dem dey keep the files. CLAUDE_CONFIG_DIR dey move the whole config directory. Na this one you go use if you want put transcripts for separate volume or encrypted volume. cleanupPeriodDays inside settings.json controls how long dem go keep the transcripts. The default na 30 days, and the minimum na 1.

Wetin dey actually inside those transcript files

Every tool result dey get 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 plainly: Claude Code dey store session transcripts locally as plaintext under ~/.claude/projects/.

Think about wetin this mean for server. If Claude read .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. Transcript record wetin happen, na the main reason for am, and na exactly why e belong inside your threat model.

  • Backups: plain backup of /home or /root go copy your transcripts go anywhere wey backups dey go. 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 contain the whole directory. Image wey you clone to build another server from go contain am too.
  • Other accounts on the box: check the modes yourself with ls -ld ~/.claude ~/.claude/projects instead make you assume say dem tight.
  • Deliberate uploads: /feedback command dey send conversation history to Anthropic on purpose, and /bug and /share dey report through the same path. Na things wey you choose to do, so know wetin you dey agree to before you confirm.

If you prefer make no transcript exist, CLAUDE_CODE_SKIP_PROMPT_HISTORY dey suppress transcript writes, and --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 go work.

How you fit find old conversation

Open the picker with claude --resume, or use /resume from inside session wey dey run. Each row go show session name if you set one, or generated title if you no set one, plus time wey don pass since last activity, git branch, and file size.

Picker dey search. Press /, or just start to type, to filter the list. The shortcuts wey worth learn na the ones wey expand the list: Ctrl+A go show sessions from every project for this machine, Ctrl+W go show every worktree for 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.

If you name sessions, all this go easier. Start one with claude -n auth-refactor, or run /rename auth-refactor midway, for the point wey you realise say the conversation don turn to real work. After that, you fit resume named session by name directly from shell.

Unnamed session still go get generated title. Background request to small fast model go write the title after e summarise your first prompt. This title go help you recognise the row for picker, but e no be resume handle. claude --resume <name> go match only names wey you set yourself.

Find the correct session by grepping transcripts

Sometimes you fit remember one phrase and nothing else. The transcripts na text, so search dem.

grep -rl "nftables" ~/.claude/projects/

This one go print the paths of transcripts wey match. The filename without the .jsonl extension na the session ID, and claude --resume <session-id> accepts am. Use grep to work out which session you want, then resume am or export am so you fit read the content.

Two important caveats dey. The content get JSON escaping, so phrase wey contain quote characters, or phrase wey cross line break, fit no match as literal string. And if match dey inside tool result, e mean say 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 better pass resuming

Resuming dey bring the complete history back, and na this complete history every later request go carry. Conversation wey run for four hours yesterday dey cost plenty to continue today, and how token usage dey add up across long session dey explain where this cost really dey come from.

Claude Code sometimes dey offer middle option. For Pro or Max plan, if you resume session wey don idle for about one hour and get more than 100,000 tokens, e go open dialog before your first message. By then, prompt cache don expire, so the next request go process the complete history again once, no matter which option you choose.

  • Resume from summary go run compaction immediately, so later requests go carry summary instead of complete history. E cheaper for each request, but anything wey summary drop no longer dey available.
  • Resume full session as-is go load the conversation unchanged, keeping every detail, but cost for each request go increase according to the conversation size.

Another option go resume the full session and stop the dialog from showing for later resumes.

The decision easier than e look. Resume when the next thing wey you wan type depends on wetin una 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 una settle for the beginning of the session. Na stale context be this, and carrying am forward dey 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 depend 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 useful here too. E go copy the conversation reach the current point and switch you enter the copy, while the original remain unchanged and still dey 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

Claude Code dey store my session history for where?

By default, e dey store am under your config directory, for ~/.claude/projects/<project>/<session-id>.jsonl. For this path, <project> na working directory path wey replace every non-alphanumeric character with hyphens. Every file na JSONL: one JSON object for each line, for message, tool use, or metadata entry. CLAUDE_CONFIG_DIR dey move the config directory go another location, while cleanupPeriodDays inside settings.json set how long transcripts go remain. Default na 30 days, and minimum na 1.

Why I no fit see my VPS session for the picker on my laptop?

Na because transcripts dey write to the disk of the machine wey run the agent, and nothing dey sync dem between machines. Conversation wey you get inside tmux for your VPS dey exist only for the VPS. Resume am there over 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 different directory?

Yes, if you get the session ID. claude --resume <session-id> first dey check the current project directory and its git worktrees, then e dey check every other project for the same machine. Inside the picker, Ctrl+A dey expand the list to every project for the machine, while Ctrl+W dey expand 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 continue to refer to files wey you don delete, e dey carry stale context. That context dey use 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 resume dey read transcripts. So if you turn transcript writes off, --continue and --resume no 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.