Environments

An environment defines which repositories, machine size, and setup commands prepare a fresh cloud computer for coding sessions. When an environment installs dependencies, starts services, and runs your test suite, agents can verify changes before opening a pull request instead of guessing.

Inspect an environment's settings, with its snapshots and builds a tab away.

Setup

Sync your repositories

Make sure the repositories you need are connected under Settings → Repositories.

Create the environment

As an organization owner or admin, open Settings → Environments → New environment. Enter a name, select a machine size and one or more repositories, and select Create.

Select it in new sessions

Choose the environment when starting a coding session. If a repository does not appear, check both the GitHub App installation access and the environment's Repositories list.

Repository configuration

Store repository setup in .company/environment.json so your team can review environment changes in pull requests. Put heavy dependency installation in scripts.install so snapshots cache it, and keep branch-checkout preparation fast and repeatable:

{
  "$schema": "https://api.thecompany.company/schemas/v1/environment.json",
  "scripts": {
    "install": {
      "command": "bun install --frozen-lockfile",
      "timeout": 900
    },
    "prepare": {
      "command": "bun run db:generate",
      "timeout": 300
    },
    "start": {
      "command": "bun run dev"
    }
  },
  "env": {
    "NODE_ENV": "development"
  }
}
FieldPurpose
scripts.installInstall dependencies, toolchains, and build caches during snapshot builds.
scripts.prepareRun a quick, repeatable refresh step after checking out a branch.
scripts.startStart background services (databases, local dev servers) the repository needs.
envSet non-secret environment variables. Store credentials in Secrets, never in Git.
Inspect the API repository and draft .company/environment.json. Verify the install command on this computer and open a draft PR with just the setup file.
Inspect the latest failed build for the API environment. Identify the first failing command and explain how to fix it without changing any settings.

Builds and snapshots

A successful build captures the post-setup filesystem into a warm snapshot, so new cloud computers boot with repositories and dependencies already on disk.

  • Inspect build logs: Open Builds to review each build attempt and per-repository command output.
  • Check active snapshots: Open Snapshots to see which snapshot new computers will start from.
  • Rebuild after fixes: If a setup command fails, fix the configuration and select Rebuild. Creating an environment with repositories starts an initial build automatically; adding or removing repositories or changing machine size can also trigger a new build.
  • Running computers stay untouched: A new snapshot applies only to newly started computers and does not overwrite a computer that is already running.

Troubleshooting

  • Repository missing in a session: Verify the repository is granted to the GitHub App and listed under the environment's Repositories tab.
  • Build fails during setup: Open Builds to inspect the first failing command and its output. Previous active snapshots remain usable until a replacement build succeeds.
  • Changes not reflected in an active session: Start a new session or boot a new computer after a snapshot finishes building; running computers keep the snapshot they started with.

Next steps