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.
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=…' --launchThe 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 session is on the laptop. You are not.
Built-in resume opens session files on the machine you sit at. The laptop's sessions are not there.
To move a session, you find its file and copy it yourself. If the file is gone, so is the session.
A session from one agent does not open in the other. You explain the task again.
Work as usual. Paste one line.
- 01Work on the laptop
Each request adds its new messages to the copy of your workspace: one project, one worktree.
- 02Copy the command
In the console, open Sessions and click Open in Claude Code or Open in Codex. The command works for 15 minutes.
- 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.
What comes back, and what does not.
| Context Mode | Built-in resume | |
|---|---|---|
| Where sessions live | The gateway | This computer |
| On another machine | One command | Copy the file yourself |
| Local file deleted | Rebuilt from the copy | Session gone |
| Other agent | Claude Code or Codex | No |
| What comes back | Message text, tool names, a summary before the latest 200 messages | The 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 →
What this uses.
Rebuilds a conversation as a session file on any machine, in either agent.
For a new session instead of a resume: the facts that match go to the first request, on any machine.
The command, where the file goes, and what comes back.
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.