In GitHub Codespaces, how are compute and storage measured for billing, and which settings reduce each one?
answer
- two meters, not one
- cores multiply the clock
- storage accumulates hourly all month
- the default image has a perk
basics
~20 sCompute is active time multiplied by the machine's core count; storage is disk occupied while a codespace exists, measured hourly. Idle timeout, stopping and smaller machines cut compute; deletion, shorter retention and the default image cut storage.
solid answer
~40 sGitHub Codespaces has two meters. **Compute** counts the hours a codespace is active, multiplied by its machine type's core multiplier, so an hour on a 16-core machine costs eight times an hour on a 2-core one. **Storage** counts the disk each codespace and prebuild occupies while it exists, metered hourly in GB-hours and accumulating across the monthly cycle; deleting a codespace slows that accumulation but does not lower the month's figure so far. Compute falls with a shorter idle timeout, explicit stops and the smallest machine type that does the job. Storage falls with deleting finished codespaces, a shorter retention period, fewer extensions and the default dev container image, whose base container is not counted. Personal accounts get a monthly included quota; organization and enterprise accounts do not.
go deeper
Remember there are two meters: compute while running, storage while existing. A bigger machine multiplies the compute meter.
Explain core hours, why storage is cumulative within the cycle, what counts towards it, and why the default image's base container is not counted.
Read a usage report and say which lever moves it: machine size and idle time for compute, stale codespaces, prebuilds and custom images for storage.
Decide where an organization should spend: larger machines that save engineer time, or tighter limits that save hours, and how budgets and quotas fail when they run out.
## Two meters Every codespace runs two separate meters, and they respond to different levers. | Meter | What it measures | Unit | Runs when | |---|---|---|---| | **Compute** | Processing time and power | Core hours: active hours x machine multiplier | Only while the codespace is active | | **Storage** | Disk occupied by codespaces and prebuilds | GB-hours, priced per GB-month | For as long as the codespace exists, active or stopped | Prices change and are not the point here; what matters is the shape of the bill. ## Compute: hours times cores A codespace becomes **active** when it is created or started, and stops being active when it is stopped or deleted, by a person or automatically. Compute is that active time multiplied by the **machine type's multiplier**, which equals its core count: 2 for a 2-core machine, 8 for an 8-core machine. The billing documentation's own example: an hour on a 16-core machine costs eight times an hour on a 2-core machine. Totals are reported to the billing service hourly and billed monthly, charged to the **account that owns the codespace**, a user or an organization. Machine types range from 2 to 32 cores. By default a new codespace gets the **lowest-resourced valid machine type**; a repository's dev container configuration can demand a minimum, and an organization policy can remove large types from the menu. ## Storage: everything on the disk, all month Storage is time-based: the gigabytes a codespace occupies, measured every hour it exists. It counts: - the cloned repository and configuration files; - data the software in the codespace reads or writes; - installed editor extensions; - **prebuilds**, even when nobody currently has a codespace for that repository; - the dev container itself when it is built from a **custom image**. The exception: a container built from the **default dev container image** is not counted, even if dev container features are added to it. Only the repository and the files added afterwards are. The `devcontainer-info` command inside a codespace reports a definition ID of `universal` when the default image was used. Storage is **cumulative within the billing cycle**: the month-to-date figure only rises or stays flat, and resets at the start of the next cycle. Deleting a codespace or a prebuild lowers the *rate* of accumulation from then on; it does not refund what was already counted. ## Included usage and who pays - **Personal accounts** include a monthly quota of compute and storage. As of October 2026 that is 120 core hours and 15 GB-month on GitHub Free, and 180 core hours and 20 GB-month on GitHub Pro. The quota is counted in core hours, so a 2-core machine uses it twice as fast as the wall clock. - **Organization and enterprise plans include no free quota.** Every hour an organization pays for is billed. - Without a payment method, use is blocked once the quota runs out; with one, **budgets** can cap spending. When a budget or quota is exhausted, codespaces billable to that account cannot be created or resumed, but work can still be exported to a branch. - Prebuilds are also produced with GitHub Actions minutes; configuring them belongs with the dev container configuration. ## The levers, by meter 1. **Compute**: lower the idle timeout, stop codespaces explicitly, choose the smallest machine that works, and as an organization restrict machine types and the maximum idle timeout. 2. **Storage**: delete finished codespaces, shorten the retention period, prefer the default image where it suffices, prune extensions (`du -h -s ~/.vscode-remote/extensions` shows their size), and as an organization cap retention and the number of codespaces each person can hold. ## A worked reading of a bill An engineer runs an 8-core codespace for six hours a day, twenty days a month, and leaves four stopped codespaces lying around. Compute is 6 x 20 x 8 = 960 core hours, and the machine size multiplies all of it: moving to 4 cores halves it. The four stopped codespaces bill nothing for compute, yet all four accrue storage every hour until they are deleted. Two different conversations follow: right-sizing the machine, and cleaning up. Lowering the idle timeout helps only the first meter, and shortening retention only the second, which is why a cost review starts by asking which meter grew.
- Why can an account's Codespaces storage keep growing when nobody has a codespace open?Stopped codespaces still occupy disk and bill storage until deleted, and prebuilds consume storage even when no codespace exists for that repository. Storage is also cumulative within the billing cycle, so the month-to-date figure never falls. Delete unused codespaces and prebuild configurations, and check a usage report to see which repositories account for the storage.
- Why might switching a repository to a custom dev container image raise storage usage?A container built from the default dev container image is not counted as storage; only the repository and the files added afterwards are. With a custom base image, the container itself is counted as well, in every codespace built from it. The default image with added features keeps the free treatment.
- Compute is billed by wall-clock hours, whatever the machine size.
- A stopped codespace drops off the bill entirely.
- Deleting codespaces late in the month shrinks that month's storage charge.
- Organization accounts get the same free monthly quota as personal accounts.
- Adding dev container features to the default image makes the whole container count as storage.