Our companies
How do you keep a coding agent running after you close your laptop?
Move the session to a machine that stays on. With Sandboxer, sbx handoff moves a local Claude Code or Codex session and its repo into a cloud sandbox and resumes the agent there, headless, so you can close your laptop. When you're back, sbx handoff --back brings the work and the session home.
Updated November 9, 2026
Why does a coding agent stop when the laptop closes?
A coding agent like Claude Code or Codex runs as a process on your machine. When the laptop sleeps or the terminal closes, so does the agent, halfway through a migration or a long test run. Keeping it going means moving the work, the repo and the conversation to a computer that stays on. For why a cloud VM suits unattended work, see coding agents in the cloud.
What does sbx handoff do?
Run it in the repo where the agent is working. According to Sandboxer's CLI docs, it:
- saves every change, untracked files too, on a temporary branch without touching yours;
- pushes that branch into a sandbox over SSH, never to a remote;
- moves the session file and resumes the agent there, headless.
It shows what will move and asks first. You can point it at a specific agent, give it a next instruction, and pick the sandbox size:
sbx handoff
sbx handoff --agent codex --prompt "Finish the migration, then run the tests"
sbx handoff --backHow do you bring the work back?
sbx handoff --back brings the sandbox's work back as uncommitted changes on your branch, and the session back so you can continue with claude --resume or codex resume. If your repo changed in the meantime, nothing is applied automatically: the sandbox's work is fetched to a branch and the merge command is printed. The sandbox keeps running afterwards, so stop it when you're done; a stopped sandbox costs nothing.
What should you know before handing off?
- API key only. The agent runs in the sandbox with the Anthropic or OpenAI API key saved on your Sandboxer Agents page, never a subscription login. Without a key, nothing moves.
.envfiles stay behind unless you pass--include-env, because they may hold secrets.- One handoff per repo at a time, and the repo needs at least one commit.
- Sandboxes stop on a deadline. Every sandbox stops an hour after it starts unless you change that, so extend it for long work; see pause and resume.
Can an agent hand itself off?
Yes. Sandboxer's local MCP server, sbx mcp, includes a handoff_session tool that does the same thing, so an agent can move its own session into a sandbox. It's only in the local server, not the hosted one, because it moves a session from your own machine; see the Sandboxer MCP server. Once the work is back, ship it behind a feature flag so it can be turned off without a deploy; read trunk-based development with AI agents.
Frequently asked questions
Does sbx handoff push my code to GitHub?
No. It pushes a temporary branch into the sandbox over SSH, never to a remote.
Can I use my Claude subscription in the sandbox?
Not for a handoff. The agent runs with the API key saved on your Sandboxer Agents page.
Which agents does sbx handoff support?
Claude Code and Codex.
What happens if I changed the repo while the agent worked?
sbx handoff --back doesn't overwrite anything. It fetches the sandbox's work to a branch and prints the merge command.