Use case · Session resume

I started on my laptop, and now I am at my desktop. Pick up where you left off.

Your agent on the desktop gets back the work you did on the laptop, so you do not explain it again. One command rebuilds it there as a session file, and your agent's own resume opens it.

Laptop to desktop

At the desktop, you type claude --resume.

Built-in resume

  • Reads session files on this computer
  • Laptop session: copy the file yourself
  • File deleted: session gone
  • Same agent only

With Context Mode

  • Reads the copy the gateway keeps
  • One command, on any machine
  • File deleted: rebuilt from the copy
  • Claude Code or Codex

From the comparison in the Session resume docs.

In the console: Sessions, then Open in Claude Code. Copy the line.

# on the desktop, in the project folder
$ curl -fsSL https://<host>/cm-resume.mjs \
    -o /tmp/cm-resume.mjs \
  && node /tmp/cm-resume.mjs \
    --gw https://<host> \
    --handoff 'scope=…&t=…' --launch

The console fills in the host and the token. The line works for 15 minutes.

The script writes a session file and opens it.

~/.claude/projects/<folder>/<id>.jsonl
$ claude --resume <id>

Comes back

  • The latest 200 messages per session
  • A summary of older messages
  • Tool names, as (tool: Bash)

Stays behind

  • Tool output
  • Text the client adds on its own
  • Sessions that went direct to the model

Each text block is cut at 6,000 characters.

Started in Claude Code. Carry on in Codex.

~/.codex/sessions/YYYY/MM/DD/
  rollout-<time>-<id>.jsonl
$ codex resume <id>

The copy belongs to the workspace, not to the agent. The Codex writer was tested with Codex 0.156.1.

No resume. A new session, the next morning.

"Morning. Where did I leave off yesterday, and which ticket am I on?"

⏺ context-mode · memory +1 record about user
You're on PAY-1432 ... You already made the commit yesterday.

Memory adds the facts that match to the first request, on any machine. The Memory screen lists user current_ticket PAY-1432.

The problem

The session is on the laptop. You are not.

Resume reads this computer

Built-in resume opens session files on the machine you sit at. The laptop's sessions are not there.

Copying files is a chore

To move a session, you find its file and copy it yourself. If the file is gone, so is the session.

One agent only

A session from one agent does not open in the other. You explain the task again.

How it works

Work as usual. Paste one line.

  1. 01Work on the laptop

    Each request adds its new messages to the copy of your workspace: one project, one worktree.

  2. 02Copy the command

    In the console, open Sessions and click Open in Claude Code or Open in Codex. The command works for 15 minutes.

  3. 03Paste it on the desktop

    In the project folder. You need curl, Node.js and your agent. The script writes a session file and starts claude --resume or codex resume.

On the laptop, your agent sends each request through Context Mode to the model. Context Mode keeps a copy of the conversation. On the desktop, one command reads that copy and your agent's own resume opens it. Laptop: your agent works as usual Context Mode keeps a copy of the conversation saving does not change the request The model your own account Desktop one command then resume
Saving happens before the gateway changes anything. The desktop reads the copy, not the laptop.
Proof

What comes back, and what does not.

200 messagesthe latest per session, with a summary of older ones and tool names
50 sessionsthe most recent in the workspace, joined into one conversation, oldest message first
15 minutesuntil the command expires. It reads only your own account's workspaces. Until then, anyone with it can read the session, so do not paste it in a shared channel.
Context ModeBuilt-in resume
Where sessions liveThe gatewayThis computer
On another machineOne commandCopy the file yourself
Local file deletedRebuilt from the copySession gone
Other agentClaude Code or CodexNo
What comes backMessage text, tool names, a summary before the latest 200 messagesThe whole local file

Built-in resume brings back more detail, because it reads the full file with tool output. The first request after a resume sends the rebuilt history to your model, so a long history adds tokens. Session resume is not a cost feature and is not measured on its own; for the gateway as a whole, see Benchmarks. The full comparison →

Products used

What this uses.

Session resume

Rebuilds a conversation as a session file on any machine, in either agent.

Memory

For a new session instead of a resume: the facts that match go to the first request, on any machine.

Session resume docs

The command, where the file goes, and what comes back.

Memory docs

How facts are kept, scoped and added to a new session.

Related: Shared context · All-day session · Search past sessions

Same work, next machine.

npx @context-mode/cli connects your agents. 1,000 requests free, no card.

Get started free

Your coding agent costs less and remembers your project.

Start free: 1,000 requests, every feature, no card. After you sign in, the console gives you one command to connect Claude Code or Codex.

Read the docs