Guides
How to keep Claude Code running after you close your laptop
Run Claude Code in a persistent cloud computer so agent sessions keep working after your laptop sleeps, disconnects, or runs out of battery.
Your Claude Code session dies the moment your laptop sleeps. Every developer who runs agents has hit this wall.
You queue up a meaningful task: refactoring a module, triaging a backlog of Sentry errors, drafting a PR description for a gnarly diff, or working through a test failure. Then you close the lid. When you come back, the terminal is dead. The work stopped when your machine went to sleep.
That is the core problem with running AI coding agents locally: your laptop becomes the uptime guarantee.
Why Claude Code sessions die when you disconnect
Claude Code runs as a process on your machine. When your laptop sleeps, suspends, loses network, or runs out of battery, that process can stop. The terminal is local, the runtime is local, and the session is only as persistent as the device under it.
You can fight this with tmux or screen on a remote VPS you configure yourself. That works, and many developers are doing exactly that. But it creates a second job: provisioning the machine, installing dependencies, configuring SSH, managing keys, keeping repo state in sync, and rebuilding the setup when something drifts.
The underlying need is simpler: Claude Code needs a computer that stays on. Your laptop is not that computer.
The straightforward fix: a persistent cloud session
The right mental model is a dedicated machine in the cloud that runs your agents continuously. You start Claude Code there, hand it a task, disconnect, and come back to progress. Your devices become viewers and control surfaces. The work lives on the cloud computer.
Matrix OS provisions that kind of workspace: a dedicated hosted machine with your files, repositories, terminals, previews, and agent sessions in one place.
Sessions survive because they run on the hosted machine, not on your laptop. You can close your laptop, switch to a phone browser, or step away entirely. Claude Code keeps working.
Setting up a persistent Claude Code session
Here is what the workflow looks like in practice.
1. Provision your cloud machine
Sign up at matrix-os.com and pick a hosted runtime plan. The Starter tier is enough for most single-agent workflows. If you want to run Claude Code alongside Codex, Cursor, or another agent in parallel, the Builder tier gives you more headroom.
Once your machine provisions, you have a dedicated Linux environment with persistent files, repos, terminals, and runtime state.
2. Open the web shell
Open app.matrix-os.com, launch a terminal, and you are working directly on your cloud machine. No local SSH ceremony is required for the browser workflow.
Clone your repo, install dependencies, authenticate the tools you use, and set up Claude Code the same way you would on any Linux machine. The difference is that this environment stays on after your laptop disconnects.
3. Start Claude Code and hand it a task
With the repo ready, start Claude Code inside the Matrix terminal and give it scoped work:
claude "Fix the open bug-tagged issues in this repo. Create one branch per fix, run the relevant tests, and open draft PRs."Claude Code can read the codebase, make changes, run tests, and leave branch or PR artifacts behind.
4. Close your laptop
This is the part that changes the habit. Close the lid. The session keeps running on the Matrix machine.
When you reopen the workspace from any browser, the terminal is still there. The files are still there. The agent did not depend on your laptop staying awake.
5. Attach from the CLI
If you prefer a terminal over the browser, the Matrix CLI is designed around the same durable workspace model. You can attach to running work from another machine instead of recreating the setup locally.
The important point is that the session was never paused. You are reconnecting to work that stayed alive.
What to hand to Claude Code overnight
Persistent sessions are most useful when the task has clear inputs and outputs and does not need your attention every few minutes. Good candidates include:
- Bug triage from Linear, GitHub, or Sentry - point Claude Code at a bounded list of issues and ask for one branch per attempted fix.
- Dependency updates - upgrade packages, run the test suite, and summarize what broke.
- Test coverage - generate focused tests for modules below a coverage threshold.
- Release notes - summarize merged PRs into a draft changelog.
- Code review prep - clean up a diff, add missing docs, and prepare a PR description before human review.
Tasks that require judgment calls still need human checkpoints. The goal is not to remove you from the loop. It is to stop making your laptop the thing that keeps the loop alive.
Running multiple agents in parallel
One benefit of a persistent cloud computer is that you are not constrained to one local terminal session. You can run Claude Code on one branch, Codex on another task, and Cursor in a third terminal without tying up your laptop CPU, RAM, or battery.
Matrix OS is built around this kind of agent workspace. Terminals, repos, previews, files, and review artifacts live together, so parallel work is easier to inspect when you return.
The practical workflow becomes:
- give each agent a bounded task,
- keep each task on a separate branch,
- let the sessions continue in the background,
- review the diffs and logs from any device.
Matrix OS vs a raw VPS
A raw VPS is the right instinct. It gives Claude Code a machine that stays on. The tradeoff is that you own every layer of the developer experience.
With a raw VPS, you handle OS setup, SSH, keys, package installs, browser access, session tools, mobile access, previews, and cleanup. That can be a good fit if you want total control.
Matrix OS is for developers who want the persistent machine plus the product layer around it: browser shell, durable terminals, files, app surfaces, CLI access, agent-oriented workflows, and a workspace that is designed for long-running coding agents from the start.
The practical difference
Running Claude Code locally means the session is only as reliable as your laptop. A sleep cycle, dead battery, network drop, or accidental terminal close can stop the work.
Running Claude Code on a persistent cloud computer means the session is tied to the uptime of the hosted machine. You can come back to progress instead of a dead terminal.
That is the whole shift: stop treating AI coding agents like a local tab. Give them a computer that stays on.
FAQs
Does Claude Code work out of the box on Matrix OS?
You install and configure Claude Code on your Matrix machine the same way you would on any Linux machine. Matrix OS does not need to change how Claude Code works. It gives Claude Code a persistent computer to run on.
Can I run Claude Code and Cursor at the same time?
Yes. Open separate terminal sessions and run each tool independently. For parallel agent work, use separate branches or worktrees so the agents do not collide on the same files.
Is my code private on Matrix OS?
Matrix OS gives each user an isolated hosted workspace with owner-controlled files and runtime state. Your code and agent artifacts live in your environment, not in a shared short-lived sandbox.
Why not just use a VPS?
You can. A raw VPS is flexible and powerful, but it leaves the workflow layer to you. Matrix OS packages the persistent machine with a web shell, CLI access, session continuity, and agent-oriented workspace surfaces.
Can I check progress from my phone?
Yes. The web workspace is available from a browser, including mobile browsers, so you can inspect progress without reopening the original laptop.
How much does it cost?
The current hosted runtime plans start at $14/month for a dedicated Starter machine. Heavier parallel agent workflows fit better on larger plans.