GuidesHosting choices

codex resume and claude --resume: getting a session back

Reopen a Codex or Claude Code session: the commands, why a session is missing from the list, what a resume restores, and keeping history past 30 days on a server.

October 23, 2026The Everpod team
The short answer

In Codex, codex resume --last reopens the most recent session from the folder you are in, and codex resume opens a picker. In Claude Code the same two are claude --continue and claude --resume, or /resume from inside a running session. Both start a new process on the conversation saved on the machine where it ran, so a resume gets the history back, not a process that died; Claude Code’s docs say a command cut off mid-run is not rerun. When a session you expect is missing, it is usually one of three things: the list is filtered to the current folder, it was a scripted run, which both agents leave out by default, or, in Claude Code, it is older than the 30 days Claude Code keeps transcripts by default.

The commands, side by side

ToCodexClaude Code
Reopen the latest session here
codex resume --lastclaude --continue (-c)
Choose from a list
codex resume, or /resume insideclaude --resume (-r), or /resume inside
Open one by ID or name
codex resume <id or name>claude --resume <id or name>
See sessions from other folders
codex resume --allCtrl+A in the picker
Include scripted runs
--include-non-interactiveBy ID only, or claude -p --continue
Continue a scripted run
codex exec resume --last "…"claude -p --resume <id> "…"
Try another way, keeping the original
codex fork, or /fork insideclaude --continue --fork-session, or /branch inside

The commands are from OpenAI’s Codex command reference and Claude Code’s page on managing sessions, as of October 23, 2026. A name works as a handle once you have given one: in Codex the help text for codex resume takes a session ID or a session name, and in Claude Code you name a session with claude -n auth-refactor at the start or /rename during it. An unnamed Claude Code session can still be resumed by the title it generates from your first prompt.

Why the session you want isn’t in the list

What a resume brings back, and what it doesn’t

A resume reloads the conversation, not the process. Codex “reloads the selected chat’s transcript so you can pick up where you left off, keeping the original history intact,” and codex resume accepts model and sandbox overrides on the command line. Claude Code’s list of what a resumed session restores is longer and has the edges worth knowing:

Resuming one session in two terminals at once, without forking, makes the messages from both “interleave into one transcript,” by Claude Code’s docs. Fork or branch when you want two lines of work.

On a server: tmux for a dropped connection, resume for a reboot

The two tools answer different losses. When an SSH connection drops, a session started inside tmux keeps running on the server, mid-task, and you reattach to the same live process from any device; the tmux guide has the commands. tmux does not survive the machine restarting, and that is where resume comes in: after a reboot, a crash or an update, the process is gone, and codex resume --last or claude --continue, run in the same folder, starts a new process on the saved conversation.

The history lives on the machine where the session ran: Claude Code’s under ~/.claude/projects/, one file per session, and Codex’s under ~/.codex (or wherever CODEX_HOME points). So a session started on a server is resumed on that server, from whatever you SSH in with, and does not appear in the agent on your laptop. OpenCode documents a way to carry one session to another machine: opencode export writes it as JSON and opencode import reads it back. Claude Code’s --resume also accepts the absolute path of a transcript file, but its docs call the format internal and liable to change between versions.

In Claude Code, a session you sent to the background keeps running after you leave, and claude --resume on one that is still running opens the running session itself rather than reloading its transcript. Steering a session on a server from your phone is a different route, covered in the Remote Control guide.

Keeping sessions longer than 30 days

On a machine you keep working on for months, Claude Code’s default sweep deletes every transcript older than 30 days. Raise it in ~/.claude/settings.json:

{
  "cleanupPeriodDays": 365
}

The minimum is 1, and 0 is refused with a validation error rather than read as “keep forever.” Weigh it against what the transcripts hold: Claude Code’s docs say they are plaintext, protected only by file permissions, and that anything a tool read or printed, a .env file or a credential included, is written into them. A longer history on a server is a longer record of everything the agent saw there.

Codex’s docs give no age limit for its saved sessions.

OpenCode and Pi

OpenCode continues the last session with opencode -c and a given one with opencode -s <id>, adds --fork to either to branch instead, and takes the same flags on opencode run; opencode session list prints the IDs. Pi saves sessions by folder: pi --continue in the same folder reopens the most recent, /resume opens another, and /tree, /fork and /clone try another approach without losing the first. The rest of Pi’s command line is in the Pi guide.

Run Claude Code, Codex, OpenCode, Pi, Hermes or OpenClaw on an always-on developer pod.

A developer pod is a permanent cloud computer (VPS), set up and secured for you, with your pick of Claude Code, Codex, OpenCode, Pi, Hermes and OpenClaw installed. Run more agents at once than your laptop can hold, and keep them working when it’s closed. From $24 a month, built in about ten minutes.