Blog / Remote
Claude Code on the Web vs a VPS vs Codespaces (2027)
Where should Claude Code run when the laptop closes? Anthropic's cloud sessions, your own VPS and GitHub Codespaces compared on cost, limits, control and repos.

Claude Code on the web costs nothing extra but runs on a fixed 4 vCPU, GitHub-only VM; a VPS gives you a machine you control for a flat monthly fee; Codespaces bills by the core-hour and was built for people, not for unattended agents.
You want Claude Code to keep working after you close the laptop. There are three common places to put it. Anthropic runs one for you (Claude Code on the web, now called cloud sessions). You can rent a VPS and run the CLI there. Or you can use GitHub Codespaces, a hosted dev environment you may already use for your code. They solve the same problem with very different trade-offs in cost, control and what survives a long run.
Code Tycoon is a fourth option built on the VPS idea (a dedicated server with your Claude Code setup on it). This comparison is built from each provider's official documentation and price pages, read on 2026-11-23. Every fact links to its source, and where a page is silent we write "Not listed".
Table of contents
- Verdict
- How each option works
- Facts at a glance
- What each one costs
- Control and limits
- Repos, credentials and secrets
- Long runs, idle time and parallel sessions
- Pick Claude Code on the web if
- Pick a VPS if
- Pick Codespaces if
- FAQ
Verdict
Start with Claude Code on the web if your code is on GitHub, you are on Pro, Max, Ultra or Team, and your tasks are a few commands and a pull request. It has no extra bill and no server to maintain. Anthropic's docs say "there's no separate charge for the cloud VM" (Claude Code docs).
Move to a VPS when you hit its walls: the VM is capped at roughly 4 vCPUs, 16 GB of RAM and 30 GB of disk, it needs GitHub for cloning and pull requests, and a paused VM can be reclaimed. A VPS has none of those walls, and it costs a flat fee. We priced the small end in Claude Code VPS cost.
Choose Codespaces only if your team already lives in it and you want the agent in the same environment as the human. It is the most expensive of the three for always-on use, and a 30 minute default idle timeout makes it a questionable home for long unattended work, and GitHub's timeout docs (2026-11-26) count only typing, mouse use and terminal input or output as activity, so an agent that prints nothing for 30 minutes can be stopped.
Our rating, from documentation alone: web for the lowest effort, VPS for the most control per dollar, Codespaces for shared dev environments. If you want the VPS route without the setup, see how Code Tycoon puts your setup on a server.
How each option works
Claude Code on the web (cloud sessions)
A cloud session is "a Claude Code session that runs on cloud infrastructure" and by default "runs on infrastructure Anthropic manages" (docs). You start one from claude.ai/code, the Code tab of the Claude mobile app, the Desktop app, or the terminal with claude --cloud "task".
Each session gets a fresh VM. The environment docs describe it as "Ubuntu 24.04 on x86_64 ... with your repository cloned and common toolchains pre-installed", with Docker available (cloud environments). You configure an environment once: a network access level (None, Limited or Full), environment variables, and a setup script that runs before Claude starts.
Because it is Anthropic's product, it integrates tightly. You get a diff view with inline comments, pull request creation, and an optional auto-fix mode that responds to CI failures and review comments. You can pull a session into your terminal with claude --teleport, but the docs say you "can't push an existing terminal session to the cloud" from the CLI.
A VPS you run yourself
You rent a Linux server, install Node and the claude CLI, log in once, and run sessions inside tmux or similar. Nothing about it is special to Claude Code: it is a normal machine. That is the appeal. You choose the size, the region, the tools, the git host and how long things run.
The costs are your time (updates, firewall, backups, access) and the plumbing for reaching sessions from a phone. Our guide to putting Claude Code on a dedicated server walks through the setup, and Tailscale vs Cloudflare Tunnel vs WireGuard covers how to connect safely.
GitHub Codespaces
Codespaces is GitHub's hosted development environment, billed by the hour per machine size. It is meant for a person editing code in a browser or VS Code. You can install Claude Code in one like on any Linux box, but Codespaces is not an agent product, and GitHub's billing and timeout docs (2026-11-23 and 2026-11-26) do not mention unattended agents.
Facts at a glance
All rows were checked on 2026-11-23. Prices and limits change, so confirm on the linked pages.
| Fact | Claude Code on the web | VPS (Hetzner example) | GitHub Codespaces |
|---|---|---|---|
| Who runs the machine | Anthropic, or your org's self-hosted environment | You | GitHub |
| Extra cost for compute | "no separate charge for the cloud VM" (source) | Flat monthly fee, e.g. CPX22 (2 vCPU, 4 GB) EUR 19.99 at Nuremberg, EUR 16.99 at Helsinki, excl. VAT (source) | $0.18/hour (2 core), $0.36 (4 core), $0.72 (8 core) (source) |
| Included usage | Counts toward plan limits shared with all Claude use | Whole machine, plus a traffic allowance listed by the provider | Free: 120 core hours and 15 GB-month storage; Pro: 180 and 20 (source) |
| Size | "4 vCPUs, 16 GB of RAM, 30 GB of disk" approximate ceilings (source) | Your choice | Your choice, 2 to 32 cores listed |
| Plans needed | Pro, Max, Ultra, Team, or Enterprise with premium seats (source) | Any Claude plan or API key | Any Claude plan or API key |
| Git host | GitHub for cloning in Anthropic-hosted environments | Any | GitHub-centric |
| Idle behavior | "after a few minutes without activity, a session's VM pauses" (source) | Runs until you stop it | Default idle timeout 30 minutes, adjustable 5 to 240 (source) |
| Third-party model providers | Not available with Bedrock or Vertex (source) | Yes | Yes |
What each one costs
Pricing is where these three differ most, so work through it with numbers. Fees change, so verify current rates on the official pages before you budget.
Claude Code on the web: no extra cost, shared limits
You pay for your Claude plan, and cloud sessions come with it. As of 2026-11-23, Pro is $20 monthly ($200 with the annual discount), Max 5x is $100, and the top tier is $200, listed as Ultra on the pricing page (Claude pricing). The catch is in the Limitations section: "cloud sessions share rate limits with all other Claude and Claude Code usage within your account. Running multiple tasks in parallel consumes more rate limits proportionately."
So the cloud VM is free, but the tokens are not. Six parallel cloud sessions draw on the same five-hour and weekly limits as one local session would, only faster. Our post on Claude Code usage limits explains how those windows work.
VPS: a flat fee on top of your plan
A VPS adds a monthly bill and removes the per-hour meter. On Hetzner, a CPX22 with 2 vCPUs, 4 GB RAM and 80 GB NVMe is EUR 19.99 a month at Nuremberg and EUR 16.99 in Helsinki, excluding VAT, and the bill "will never exceed its monthly price cap" (Hetzner). The 4 vCPU, 8 GB CPX32 is EUR 35.99 at Nuremberg and EUR 30.49 in Helsinki. When we fetched the page, its order buttons said these plans were "currently unavailable", so check stock before you plan around them. We compare three providers in Hetzner vs DigitalOcean vs Linode for Claude Code.
Model usage still runs on your Claude subscription or API key, so the VPS fee is purely for the place the agent runs. One server can host several sessions, which is why the flat fee gets cheaper per session as you add them.
Codespaces: billed by core-hour and by storage
Codespaces compute is "proportional to the number of processor cores": $0.18 an hour for 2 cores, $0.36 for 4, $0.72 for 8 (GitHub billing docs). That works out to $0.09 per core-hour, which is our arithmetic. Storage is $0.07 per GB-month. A personal GitHub Free account includes 120 core hours and 15 GB-month each month, and Pro includes 180 and 20.
Worked example, ours and not a measurement: a 4-core codespace running 8 hours a day for 20 days is 160 hours, or 640 core hours. After the 120 free core hours on a Free account, 520 core hours at $0.09 is $46.80, plus storage. The same 4-core machine running around the clock for a 730-hour month would be 730 x $0.36, or $262.80, before the free allowance. A 4 vCPU VPS at EUR 35.99 does the same job for a fraction of that, though you manage it.
| Always-on cost, one month | Claude Code on the web | VPS (4 vCPU, 8 GB) | Codespaces (4-core) |
|---|---|---|---|
| Compute | $0 extra | EUR 35.99 (Hetzner CPX32, Nuremberg) | $262.80 before free quota (730 h x $0.36) |
| Model usage | Your plan limits | Your plan or API key | Your plan or API key |
The comparison is not exactly fair. Codespaces stops itself when idle, so you rarely pay for 730 hours. But if your goal is an agent that works while you are away, "always on" is the number that matters.
Control and limits
The web VM has a ceiling
The environment docs list "approximate resource ceilings that may change over time" of 4 vCPUs, 16 GB of RAM and 30 GB of disk, and warn "the VM may stop tasks that need significantly more memory, such as large build jobs or memory-intensive tests." For heavier work they point you to Remote Control on your own hardware or a self-hosted environment.
Other limits worth knowing:
- Commands: Claude waits 2 minutes for a foreground command by default and can ask for up to 10. Long commands move to the background.
- Setup scripts are cached only if they finish in roughly five minutes.
- You cannot replace the base image yet. The docs say "Replacing the base image entirely isn't supported yet" and suggest running your own container beside Claude with
docker compose. - Network access is None, Limited or Full, and Limited is the default.
A small monorepo with a quick test suite fits fine. A repo whose build needs 32 GB, a GPU, or a service you cannot run in Docker does not.
A VPS has the limits you buy
Pick the size. Install anything. Keep a database running between sessions. Run Claude Code, Codex and your own scripts side by side. The downside is you also own the failure modes: the disk fills up, a package update breaks a tool, a port is exposed by mistake.
Codespaces sizes are generous, with timers
You can choose 2 to 32 cores. The default idle timeout is 30 minutes and can be set between 5 and 240 minutes (GitHub docs). The same page says typing, mouse use and "terminal activity, either input or output" reset the timer, and a codespace where "no terminal output is generated" times out (checked 2026-11-26). A Claude Code run that prints to the terminal keeps it awake; a quiet wait, such as a long test with no output, may not, so test it before relying on it for overnight work.
Repos, credentials and secrets
This is the clearest split, and often the deciding one.
Web. Cloning in Anthropic-hosted environments and pull request creation "require GitHub". A GitLab or Bitbucket repo can be uploaded as a local bundle with CCR_FORCE_BUNDLE=1, but "the session can't push results back to that remote." On the plus side, the credential handling is strong: "your GitHub credentials stay encrypted on Anthropic's servers and never enter a session's VM", and keys you add as network secrets "stay outside the sandbox" and are attached to matching requests after they leave the session.
VPS. Any git host works because it is your machine. You put an SSH key or token on the box, which means you need to protect it, with a key scoped to the repos you want and a firewall that closes everything you do not use.
Codespaces. Tied to GitHub by design, with its own secrets feature. Per GitHub's Codespaces secrets docs (checked 2026-11-26), you set secrets at the user, repository or organization level, choose which repositories may use each one, and can store up to 100 of up to 48 KB each. A secret "is exported as an environment variable into the user's terminal session", so unlike the web option's network secrets, the key sits inside the environment where anything running there can read it. The same page warns that for credentials you authorize inside a codespace, "code running in that codespace, such as dependencies, extensions, and lifecycle scripts, can use the credential."
One more constraint on the web option: --cloud "requires an Anthropic account. It's not available when Claude Code is configured for Amazon Bedrock, Google Cloud's Agent Platform, or another third-party provider." If your company routes Claude through a cloud provider, the web option is out, and the other two remain.
Long runs, idle time and parallel sessions
Idle and expiry on the web. The docs say cloud sessions "stop after a period of inactivity and the session's VM is reclaimed." Reopening the session gives a fresh VM. Your conversation history comes back, but background shell commands, subagents and scheduled tasks do not. If Claude asked a question and nobody answered, you can still answer "up to environment expiry". The length of that period is not listed.
This matters for waiting. A task that ends with "needs your answer" is fine for a few minutes. A question left overnight may land on a fresh VM with your background work gone.
VPS. A tmux session survives disconnects. The server keeps running. Waiting on you costs nothing but time, though a cold prompt cache will cost tokens when you come back, as we covered in Claude Code prompt caching and cold resumes.
Parallel sessions. On the web, each claude --cloud command "creates its own cloud session that runs independently", and parallel use "consumes more rate limits proportionately." On a VPS you decide how many fit in the RAM you rented. On Codespaces, you either share one machine or pay for several.
If sessions touch the same files, isolation matters on all three. Worktrees keep sessions from overwriting each other on disk; the web VM gives each session its own clone.
Pick Claude Code on the web if
- Your repos are on GitHub and the Claude GitHub App or a
ghtoken is acceptable to you. - You are on Pro, Max, Ultra or Team and want no extra bill.
- Tasks are self-contained: fix a bug, update docs, open a pull request.
- You want PR auto-fix and a built-in diff review from your phone.
- You do not want to maintain a server.
Pick a VPS if
- You use GitLab, Bitbucket, a self-hosted git, or a repo too large for 30 GB of disk.
- You run three or more sessions most days, so a flat fee beats metered hours.
- Your project needs services, GPUs, or memory the web VM cannot give.
- You want your own CLAUDE.md, skills, MCP servers and hooks on a machine that stays set up (there are a few ways to keep skills in sync across computers).
- You are fine owning updates and security, or you use a tool to handle that part.
The setup takes time, and Code Tycoon does the server side for you. See how the hosted plans work, or self-host it for free on a VPS you already pay for. It is not for you if you only ever run one session at your desk.
Pick Codespaces if
- Your team already uses Codespaces and wants the agent in the same devcontainer as the humans.
- Sessions are short and supervised, so the 30 minute idle timer is not an issue.
- You value a browser IDE alongside the agent.
- Your usage fits inside the free monthly core hours, or your employer pays for it.
Can you combine them?
Yes, and many people do. The docs treat cloud sessions as one surface among several: start a task with claude --cloud from a laptop, pull it back with claude --teleport when you want to continue locally, and use a VPS for the repos and workloads the web VM cannot handle. For steering a session that is already running on your own machine from a phone, Anthropic's Remote Control is a separate feature; see Claude Code Remote Control vs Happy vs Code Tycoon.
Frequently asked questions
Is Claude Code on the web free?
There is no separate charge for the cloud VM, according to Anthropic's docs. Sessions count toward your plan's usage limits, so you still need Pro, Max, Ultra or Team (or an eligible Enterprise seat).
Can Claude Code on the web use my GitLab or Bitbucket repo?
Partly. You can send it as a local bundle with CCR_FORCE_BUNDLE=1, but the session cannot push results back to that remote. Cloning and pull request creation in Anthropic-hosted environments require GitHub.
How much CPU and RAM does a Claude Code cloud session get?
The docs list approximate ceilings of 4 vCPUs, 16 GB of RAM and 30 GB of disk, and say they may change. Memory-heavy builds may be stopped.
How much does GitHub Codespaces cost for Claude Code?
Compute is $0.18 an hour for 2 cores and $0.36 for 4, plus $0.07 per GB-month of storage. Personal accounts include 120 core hours (Free) or 180 (Pro) each month. Check GitHub's billing page for current rates.
Do Claude Code web sessions keep running when I close my laptop?
Yes. The docs say the session keeps running and you can check or steer it from any device. After a period of inactivity the VM is paused or reclaimed, and reopening provisions a new VM with your conversation history but not your background processes.
Is a VPS cheaper than Codespaces for always-on agents?
On list prices, yes by a wide margin: a 4 vCPU Hetzner server is EUR 35.99 a month excluding VAT, while a 4-core codespace running all month is about $263 at $0.36 an hour before free allowances. Codespaces stops when idle, so real bills are lower, and a VPS needs maintenance.
Can I use Bedrock or Vertex with Claude Code on the web?
No. --cloud requires an Anthropic account and is not available with Amazon Bedrock, Google Cloud's Agent Platform or another third-party provider.
The bottom line
For a small team on GitHub, Claude Code on the web is the lowest-effort way to keep agents working while you are away, and the only one with no extra bill. When your repos, memory needs or number of sessions outgrow a 4 vCPU VM, a VPS is the better value and gives you control. Codespaces fits shared dev environments more than unattended agents. Start with the cheapest option that covers your repos, and move when a specific limit bites. If it is the server you need, get a Code Tycoon server or run the self-hosted version.
Related articles
- Claude Code VPS cost: what a server for Claude Code costs per month.
- Put Claude Code on a dedicated server: the step-by-step setup.
- Claude Code usage limits: the five-hour and weekly windows that cloud sessions share.
About this research
This comparison is based on Anthropic's Claude Code documentation, GitHub's Codespaces billing and timeout pages, and Hetzner's price page, all read on 2026-11-23. Arithmetic is labeled as ours. Prices and limits change, so verify on the linked pages.
Content reviewed and updated: 2026-11-26
Keep reading
Codex Cloud vs Jules vs Copilot Coding Agent (2026)
Codex cloud vs Jules vs GitHub Copilot's cloud agent: where tasks run, daily and plan limits, repo access, December 2026 prices, and when your own server wins.
Hosted Claude Code Servers: What Each Option Costs
What it costs per month to run Claude Code on a server you do not babysit: Claude Code on the web, a VPS, Codespaces and Code Tycoon, plus the model bill.
Code Tycoon Self-Hosted vs Hosted: What Each Plan Includes
Self-hosted Code Tycoon is free and has every view, alerts and the task manager. Solo, Team and Max add a dedicated server from $39 a month. Which to pick.