SSD Nodes Learn 🎉 VPS from $5.50/mo
How to do am Matt ConnorBy Matt Connor

How to Resume Claude Code Session and Find History

Learn how to resume Claude Code with the latest session, picker, name, or ID, plus where the plaintext transcripts dey for the machine wey run am.

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 to 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 go there directly without showing picker.

Everything wey dey below match official session documentation as of August 2026. Claude Code dey release often, and flag names plus keyboard shortcuts fit change between versions, so treat claude --help and that page as authority whenever anything here no match wetin your terminal dey show.

Wetín session really be

A 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 dey work, no be only once for the end. So, the conversation fit survive when you close terminal or SSH connection cut.

When you resume, e restore more than just the text. The complete conversation history come back, together with the model wey the session dey use and the subagent wey start am if you use --agent. The permission mode 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 be launch-time flags, no be saved state. You need pass directories wey you add with --add-dir again when you resume. Same thing apply to options like --mcp-config, --settings and --plugin-dir. Settings files like settings.json dey read again when launch happen, so you no need repeat anything wey dey inside dem.

Why session history matter more for VPS

Na this fact 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 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 VPS. Nothing dey move between dem. If you work the way most people dey work when running Claude Code inside tmux for VPS, na the server dey collect your real conversation history, while the picker wey you see locally dey show another and much smaller set.

This same separation apply across interfaces. Desktop app and VS Code extension each dey keep their own session history, and neither one be CLI history. Claude Code for web get its own history too.

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 main phrase to remember na "for that machine". Session ID from another host no go resolve to anything, and Claude Code go tell you so 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 follow this format: ~/.claude/projects/<project>/<session-id>.jsonl.

<project> na your working directory path wey replace every non-alphanumeric character with hyphen. So, if session start for /home/deploy/apps/api, Claude Code go store am inside 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. This one keep the directory name 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 e dey okay to read am.

But e no dey okay to 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 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 dey move the whole config directory, so you fit put transcripts for separate volume or encrypted volume. cleanupPeriodDays inside settings.json controls how long dem dey keep am. 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 go 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 inside ~/.claude/projects/.

Think about wetin this mean for server. If Claude read .env file to find out why service no start, the contents of that file 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 for the transcript. Na exactly why you need include am for your threat model.

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

If you prefer make transcript no exist, CLAUDE_CODE_SKIP_PROMPT_HISTORY dey stop transcript writes, while --no-session-persistence dey stop am for one non-interactive claude -p run. Understand the trade-off before you set either one. Resume dey read transcripts, so if transcript no dey, resume no go work.

How you fit find old conversation

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

Picker dey search. Press /, or just start typing, to filter the list. The shortcuts wey worth learning 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.

Naming sessions dey make all this easier. Start one with claude -n auth-refactor, or run /rename auth-refactor halfway through, when you realise say the conversation don turn to actual work. After you name session, you fit resume am by name directly from shell.

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

Search transcripts to find the correct session

Sometimes you remember one phrase but 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> dey accept am. Use grep to figure out which session you want, then resume am or export am so you fit read the content.

Two important 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 say Claude see that text; e no mean say anybody type am.

Reading and exporting a conversation

/export dey render the current conversation as plain text. E dey write messages and tool output in readable format instead of JSON. If you no pass argument, e go open menu wey offer clipboard or file. If you pass filename, /export handover.txt go write directly to that path. Na this method you suppose use to move conversation from server go your laptop, or attach am to a ticket.

For anything wey you automate, use interfaces wey dem design to remain stable. Hooks and status line commands dey receive a transcript_path field as input. So, a 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 dey send follow-up prompt into the old conversation and return structured JSON. E better pass to parse JSONL format wey fit change for next release.

When starting fresh dey better pass resuming

Resuming dey bring the complete history back, and na this complete history every later request dey 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 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 that time, prompt cache don expire, so next request go process the complete history one time, 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 per request, but anything wey summary drop no longer dey available.
  • Resume full session as-is go load the conversation unchanged, keeping every detail, with per-request cost wey dey increase as conversation size increase.

Third option go resume the complete session and stop the dialog from appearing for later resumes.

The decision no hard as e first look. Resume when the next thing wey you wan type depend on wetin una don already talk. Start fresh when e no depend on am. Drift dey easy to notice once you dey look 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 session. Na stale context be that, 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, na wetin Claude Code memory files dey for.

/branch dey useful here too. E copy the conversation up to the current point and switch you into the copy, while the original remain unchanged and still dey inside picker. Use am to try another approach without losing the first one.

How resume different from compaction and memory

People dey confuse these ones all the time, but dem dey solve different problems.

Resume na about bringing conversation back after you don exit, reboot, or move go another task. Compaction na about the context window inside a live conversation: /compact dey replace wetin Claude dey carry with summary, so later requests go send fewer tokens. If your problem na say context window don full, use compaction, and how to manage Claude Code context window explain am properly.

Memory different again. CLAUDE.md files and auto memory dey hold instructions and facts wey load for the beginning of every session, so dem no be conversation wey you return to. Na wetin 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 message each other while both dey live, and this different from bringing yesterday session back from disk.

FAQ

Claude Code dey store my session history for where?

By default, e dey under your config directory, for ~/.claude/projects/<project>/<session-id>.jsonl. For here, <project> na the working directory path wey replace non-alphanumeric characters with hyphens. Each 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 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?

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 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 another directory?

Yes, if you get the session ID. claude --resume <session-id> first dey look inside the current project directory and its git worktrees, then e go 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 load the complete history, and every request after that go carry the history. Watch for drift: if session dey continue refer to files wey you don delete, e dey carry stale context. That context go 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. Understand the trade-off first, because resume dey read transcripts. So if you turn dem 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.