GitHub Codespaces
GitHub's cloud development environments: a Dev Container running on a freshly built, dedicated VM per codespace, created from the web, gh CLI or REST API, billed per core-hour with a free monthly quota. A solid VM-isolated workspace for humans and their assistants on GitHub, but its lifecycle and API are not designed for autonomous agent fleets.
Overview
GitHub Codespaces is a cloud development environment attached to a repository or template. Each codespace is a Docker container built from the repo's devcontainer.json (or a default Ubuntu image) that runs on "its own newly-built virtual machine" with its own virtual network, so isolation is at the VM level. You open it in the browser, VS Code or over SSH, and create or control it from the web UI, the gh codespace CLI (create, ssh, stop, delete, ports, cp) or the REST API (POST /repos/{owner}/{repo}/codespaces, start, stop, delete). Machine types run from 2 cores / 8 GB / 32 GB to 32 cores / 128 GB / 128 GB.
Lifecycle is designed around humans: a codespace stops after 30 minutes idle by default, has a hard 12-hour maximum lifetime per session, and stopped codespaces are retained for 30 days before deletion. Saved files persist across stops. Billing is per core-hour ($0.18/hour for 2 cores) plus $0.07 per GB-month of storage, with free monthly quotas for personal accounts. There is no snapshot or fork API, no GPU and no documented startup figure. GitHub's Copilot coding agent uses separate infrastructure and is not covered here.
Notable
- Personal GitHub Free accounts include 120 core-hours and 15 GB-month of Codespaces usage per month; Pro includes 180 core-hours and 20 GB-month.
- Hard limits: 12-hour maximum active lifetime, 30-minute default idle timeout, 30-day default retention.
- Compute is billed per core at $0.09 per core-hour (2-core $0.18/hour up to 32-core $2.88/hour).
GitHub Codespaces specifications
| Attribute | Details |
|---|---|
| Isolation | Docker container on a dedicated virtual machine — "Each codespace is hosted on its own newly-built virtual machine (VM)" with its own virtual network; two codespaces never share a VM |
| Deployment | Hosted platform |
| Open source | No |
| SDKs and interfaces | CLI, REST API |
| Cold start (vendor claim) | Not documented |
| Max session length | Stops after 30 minutes of inactivity by default (customisable); a fixed maximum lifetime of 12 hours even while in use; stopped codespaces are deleted after 30 days of inactivity by default (customisable) |
| Persistence | Stopping preserves saved changes and terminal history; /workspaces survives rebuilds; full rebuilds clear everything outside /workspaces; retained for 30 days by default |
| GPU | No — machine types listed on the billing page are 2- to 32-core CPU machines only |
| Networking | Firewalls block inbound internet connections and inter-codespace traffic; forwarded ports default to private (authenticated) and can be made organisation-visible or public |
| Pricing | 2-core $0.18/hour, 4-core $0.36/hour, 8-core $0.72/hour, 16-core $1.44/hour, 32-core $2.88/hour; storage $0.07 per GB-month; prebuilds consume Actions compute and storage |
| Free tier | Personal accounts: 120 core-hours and 15 GB-month per month on GitHub Free, 180 core-hours and 20 GB-month on GitHub Pro; organisations and enterprises have no included quota |
| Compliance | Not documented |
| Regions | Set automatically from your location or chosen manually in user settings; the region list is shown in the settings dropdown rather than documented |
Facts from GitHub Codespaces’s public documentation, verified November 9, 2026. Performance numbers are vendor claims.
Strengths and trade-offs
Strengths
- You want repo-linked Dev Container workspaces on dedicated VMs with a REST API and CLI
- You need per-user isolation, private port forwarding and GitHub secrets without running infrastructure
- You are a personal account that can use the free monthly core-hour quota
Trade-offs
- 12-hour maximum session and human-oriented idle/retention policies rather than an agent lifecycle
- No snapshot, fork or pause-with-memory APIs; no GPU machine types
- Cannot run on your own cloud; organisations pay for every core-hour with no included quota
Good fit for: Developer-driven workspaces tied to GitHub repositories, where an agent assists a human inside a Dev Container.
Use cases GitHub Codespaces fits
- Coding agents: Dev Container workspaces tied to GitHub repositories, one VM per codespace with prebuilds and port forwarding, where an agent works alongside a developer.
How GitHub Codespaces compares
| Sandbox | Isolation | Open source | Self-host / BYOC | Cold start (vendor) | Max session | Snapshots / pause | GPU | SDKs |
|---|---|---|---|---|---|---|---|---|
| GitHub Codespaces | Dedicated VM per codespace | No | No / No | Not documented | 12 h, 30 min idle | No / Yes | No | CLI, REST API |
| Ona (formerly Gitpod) | Dedicated cloud VM | No | No / Yes | Not documented | Not documented | Not documented / Yes | Yes | Python, JavaScript/TypeScript, Go, CLI, REST API |
| Coder | Template-defined (VM/pod/container) | Yes | Yes / No | Not documented | Not documented | Not documented / Yes | Not documented | CLI, REST API, MCP server |
| Together Code Sandbox | MicroVM | No | No / Not documented | 0.5 s (snapshot) | Until terminated | Yes / Yes | Not documented | Python, TypeScript |
| Daytona | Containers or VMs | No | Not documented / Yes | <90 ms | Unlimited | Yes / Yes | Yes | Python, TypeScript, Ruby, Go, Java |
| Control Plane Sandboxes | Container (runtime not named) | No | Yes / Yes | 60-90 s | Not documented | Not documented / Yes | Not documented | CLI |
Frequently asked questions
What is GitHub Codespaces?
gh CLI or REST API, billed per core-hour with a free monthly quota. A solid VM-isolated workspace for humans and their assistants on GitHub, but its lifecycle and API are not designed for autonomous agent fleets.How does GitHub Codespaces isolate code?
Is GitHub Codespaces open source?
How much does GitHub Codespaces cost?
What are the alternatives to GitHub Codespaces?
Sources
- docs.github.com/en/codespaces/about-codespaces/what-are-codespaces
- docs.github.com/en/codespaces/about-codespaces/the-codespace-lifecycle
- docs.github.com/en/codespaces/reference/security-in-github-codespaces
- docs.github.com/en/billing/managing-billing-for-your-products/managing-billing-for-github-codespaces/about-billing-for-github-codespaces
- docs.github.com/en/codespaces/setting-your-user-preferences/setting-your-default-region-for-github-codespaces
- docs.github.com/en/rest/codespaces/codespaces
- docs.github.com/en/codespaces/developing-in-a-codespace/using-github-codespaces-with-github-cli
Cite this page
Agent Sandboxes. (2026). GitHub Codespaces. agentsandboxes.org. Last reviewed November 9, 2026. https://agentsandboxes.org/sandboxes/github-codespaces/
Found an error or a missing sandbox? Submit a correction — every entry links to the sources it relies on.