How to run Claude Code in the cloud
Run Claude Code off your laptop with Anthropic's cloud sessions, GitHub Actions, your own server, or Vespin.
Updated · Published
You can run Claude Code in the cloud with Anthropic's Claude Code on the web, or with a cloud workspace such as Vespin, which runs Claude Code on your own Claude plan in a sandbox per agent and opens a pull request.
We build Vespin, so we have a stake in this. Most of this page is about the other ways to do it, though, and for a lot of people one of them is the better choice. The reason to leave your laptop at all is that a cloud session keeps going after you close the lid. Each one also gets its own machine and its own copy of the repository, so you can run several without them editing the same checkout, and each pushes its work to a branch you review as a pull request.
Claude Code on the web
Claude Code on the web is Anthropic's own, and if you already pay for a Claude plan it's the shortest way in. Each session runs in an isolated VM that Anthropic manages, and the VM costs nothing on top of your plan.
- Open claude.ai/code and connect GitHub: authorize the Claude GitHub App, or run
/web-setupin your terminal to use yourghlogin. - Keep the Default environment, or set network access, environment variables, and a setup script in a cloud environment.
- Pick a repository and describe the task. From a terminal,
claude --cloud "<task>"starts a session on your current branch as GitHub has it, not your local checkout, so push your commits first. That holds when the Claude GitHub App is installed on the repository. Otherwise, even with/web-setup, Claude Code uploads your local repository instead: its commits and changes to tracked files, but no untracked files. On native Windows that includes uncommitted changes to files like.env, so stash any you don't want to send. - Review the diff in the session and create a pull request. With Auto-fix on, Claude responds to failing checks and review comments.
- Run
claude --teleportto carry on with the session in your terminal.
Cloning and pull requests need GitHub, so a repository hosted somewhere else is harder going. A session that sits idle also loses its VM. When you reopen it you get the conversation back, but on a fresh machine (limitations). If you run one or two sessions at a time and you like working in claude.ai, this is what we'd tell a friend to use.
GitHub Actions
The Claude Code GitHub Action runs Claude Code inside your repository's workflows. You mention @claude in a comment on an issue or pull request, and it answers in that thread, pushes commits, or opens a pull request.
- Run
/install-github-appin Claude Code, or install the Claude GitHub App yourself. - Add a repository secret:
ANTHROPIC_API_KEYfor an API key, orCLAUDE_CODE_OAUTH_TOKENfor your Claude plan, made withclaude setup-token. /install-github-appopens a pull request with the workflow, which you merge. By hand, copy the example workflow to.github/workflows/claude.yml. It readsANTHROPIC_API_KEY, so for a plan token change that line toclaude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}.- Mention
@claudein a comment.
Each run spends GitHub Actions minutes on top of tokens. Because every exchange happens in comments, we'd reach for it for small, well-described jobs that start from an issue, and less for work that needs a lot of back-and-forth.
On a server you run
If you want the machine to be yours, any Linux VM will run Claude Code.
- Install Claude Code on the VM and clone your repository.
- Sign in with
/login. On a machine with no browser, presscto copy the login link and open it on another computer. - Start
claudeinsidetmuxso it keeps running after you disconnect. - Run
/remote-controlto follow and steer the session from your phone or browser. It needs the claude.ai login from step 2, and refuses an API key or aclaude setup-tokentoken. On Team and Enterprise plans, an Owner has to turn it on first (Remote Control).
The cost of that control is upkeep. You patch and secure the server yourself, and if you want two sessions going at once, you set up a second checkout so they don't edit the same files.
The four side by side
| Claude Code on the web | GitHub Actions | Your own server | Vespin | |
|---|---|---|---|---|
| Runs on | Anthropic's VMs | GitHub's runners | Your machine | A Vercel Sandbox per agent, or your own Mac |
| Pays with | Your Claude plan | API key or Claude plan | API key or Claude plan | Your Claude plan or API key |
| Starts from | Browser, Claude app, terminal | An @claude comment or workflow | SSH | Mac app, web app |
| Pull requests | Yes | Yes | You set it up | Yes |
| Several at once | Yes | Yes | You set it up | Yes |
How we run it in Vespin
Vespin is what we built for running many coding agents at once. Each cloud agent runs Claude Code on your Claude plan in a sandbox of its own, with its own checkout of your repository. It works on a branch, opens a pull request, and fixes the checks that fail on it. When it has a question or wants a review, it posts to your inbox, so you don't have to keep opening sessions to find the one that's waiting on you.
- Download the Mac app or open vespin.dev/app, sign in, and connect GitHub in Settings › Workspace.
- In Settings › Agents, add your Claude plan: run
claude setup-tokenin a terminal and paste the token it prints. You can also add an Anthropic API key. - Make a task, describe the work, and start an agent on it.
- Answer its questions in your inbox and review its pull request.
Agents can also run on your own Mac, or on another machine you add, if you'd rather keep the work there. And if you only ever run one session at a time, Claude Code on the web asks less of you, since there's no token to paste.
Frequently asked questions
Can it use my Claude Max plan?
Yes. Anthropic's cloud sessions run on Pro, Max, Ultra, and Team plans, and on Enterprise premium or Chat + Claude Code seats. GitHub Actions, your own server, and Vespin can all use a token from claude setup-token, which needs a Pro, Max, Ultra, Team, or Enterprise plan.
Can it run tests and a dev server?
Yes. A cloud session runs commands in its own VM, and a setup script installs what your project needs, though its network access starts out Limited. In Vespin, an agent can start a dev server in its sandbox, share it with you by link, and open it in its own browser to look at the page.
How do I watch it work?
Anthropic lists your cloud sessions at claude.ai/code and in the Code tab of the Claude app. A GitHub Action answers in comments on the issue or pull request. On your own server, Remote Control shows the session on your phone or in a browser. In Vespin, you open the agent's transcript in the Mac app or the web app.
Can I run several at once?
Yes. Each claude --cloud command starts its own session, and in Vespin each agent gets its own sandbox and can start other agents. Sessions that run on your Claude plan count toward its usage limits, so several at once use them up faster. A session on an API key is billed as API usage instead.
Related guides
How the Vespin Inbox works
The Inbox is where you answer your agents' decisions, to-dos, and questions. Here's how each kind of ask works.
How to run Codex in the cloud
Three ways to run Codex in the cloud. OpenAI's Codex cloud, Codex CLI on a machine you control, or Vespin.
How Vespin isolates coding agents
What a cloud agent's sandbox holds, what it can reach, and how long it lasts.