---
title: "Keep prepared environments ready for agent work"
description: "Move repeated provisioning and setup into prepared environments so agent sessions can start from a usable workspace."
url: https://starsling.dev/ci-playbooks/techniques/warm-agent-environments
canonicalUrl: https://starsling.dev/ci-playbooks/techniques/warm-agent-environments
---

# Keep prepared environments ready for agent work

Move repeated provisioning and setup into prepared environments so agent sessions can start from a usable workspace.

## How to choose an approach

Compare the examples by repository setup, prerequisites, and risks before adopting one. Each company implemented this in its own environment; measure each change against your own baseline.

- **[DoorDash](https://starsling.dev/ci-playbooks/doordash#cloud-agent-sandboxes)**: Use it when Agents run builds and tests on developer laptops, or each agent job spends minutes cloning and installing before it starts work. Check before adopting: Fast sandbox setup depends on prebuilt images and warm repository caches; measure setup time as its own number and keep secrets scoped per task. Adapted for GitHub Actions; compare the original system with yours.
- **[Shopify](https://starsling.dev/ci-playbooks/shopify#warm-agent-machines)**: Use it when Each agent or CI session spends a long first step on checkout, install and build before it does any work. Check before adopting: Idle machines in the pool cost money and need refreshing from main on a schedule, so size the pool to the sessions you run. Adapted for GitHub Actions; compare the original system with yours.

## Apply this technique

````text
Evaluate and apply this CI technique to my repository: Keep prepared environments ready for agent work.

Move repeated provisioning and setup into prepared environments so agent sessions can start from a usable workspace.

Read the technique and its source-backed company examples: https://starsling.dev/ci-playbooks/techniques/warm-agent-environments.md

Inspect this repository’s CI workflows, build and test commands, dependencies, and recent run timings. Identify where this technique applies and explain the expected benefit using this repository’s evidence.
Measure a baseline from recent comparable runs: elapsed time, queue time, runner minutes and failures where available. If data is unavailable, say what cannot be measured.
Compare relevant company approaches, checking prerequisites, platform differences and tradeoffs. Rank applicable options by evidence, fit and measurable opportunity; do not present company results as predictions for this repo.
Recommend the smallest safe change, show what checks and fallback paths remain, and ASK ME WHICH CHANGE TO APPROVE BEFORE EDITING ANY FILES.
Only after approval, work on a new feature branch, make one reversible change, and open a reviewable pull request. Never merge or push to a default or protected branch.
Keep required checks, test coverage, deployment and release behavior intact. Validate the change and compare equivalent runs where possible; report limitations and what should be monitored after merge.
````

## How companies used this technique

Read what each company changed and follow the original sources.

### DoorDash: Run agent builds and tests in isolated cloud sandboxes that start in seconds

**Translated to GitHub Actions**

- What DoorDash built: Flux, DoorDash's cloud agents platform, runs each task in a Firecracker microVM sandbox, with a p95 service-level target of under five seconds for full setup.
- Your GitHub Actions version: Run agent builds and tests in isolated, short-lived runners provisioned with the repositories and tools each task declares.

Flux, DoorDash's cloud agents platform, runs each task in a Firecracker microVM sandbox provisioned with the repositories, developer tools, secrets and runtime dependencies it needs, so builds, tests and large searches run in parallel and unattended. Its 95th percentile objective for full setup, from starting the microVM through cloning repositories, installing build tools and configuring the coding agent, is under five seconds. Each playbook declares the tools it needs, and DoorDash's Agent Gateway exposes only that approved set. In one month of 2026, Flux automated 130,000 engineering tasks.

Evidence: Documented technique

Use it when: Agents run builds and tests on developer laptops, or each agent job spends minutes cloning and installing before it starts work.

Before applying it: Fast sandbox setup depends on prebuilt images and warm repository caches; measure setup time as its own number and keep secrets scoped per task.

GitHub Actions adaptation: Compare the source system with your own workflow before applying this translation.

[Read more in the DoorDash playbook](https://starsling.dev/ci-playbooks/doordash#cloud-agent-sandboxes)

[Primary source](https://careersatdoordash.com/blog/delegating-engineering-work-to-cloud-based-agents/)

### Shopify: Keep warm, prebuilt machines ready for agent sessions

**Translated to GitHub Actions**

- What Shopify built: Shopify's Remote Dev keeps a pool of warm Macs, with main checked out, tools installed and apps built, for each River agent session.
- Your GitHub Actions version: A pool of warm, prebuilt machines that an agent claims, syncs to its branch and replaces when its session ends.

Shopify's Remote Dev gives each River agent session its own environment, so several agents can build and test mobile apps in parallel without maxing out a laptop. Preparing a Mac after a request arrived meant initial app compilation and the main checkout took over 30 minutes. Shopify now keeps a pool of warm Macs: main checked out, tools installed, apps built and caches warm. An agent claims a Mac, synchronizes its branch and runs its scripts and builds there. Each Mac is destroyed when its session ends and replaced, and idle Macs are refreshed on a staggered rotation that pulls fresh main and rebuilds the apps and caches. As context, River's share of merged mobile pull requests grew from 6% to 61% in 2026, as Shopify's broader River rollout, including internal advocacy, increased adoption.

Evidence: Company-reported result or observation

2026: The time from requesting a Mac to inspecting code changes on a running device went down to just a few minutes. ([Source](https://shopify.engineering/remote-dev))

Use it when: Each agent or CI session spends a long first step on checkout, install and build before it does any work.

Before applying it: Idle machines in the pool cost money and need refreshing from main on a schedule, so size the pool to the sessions you run.

GitHub Actions adaptation: Compare the source system with your own workflow before applying this translation.

[Read more in the Shopify playbook](https://starsling.dev/ci-playbooks/shopify#warm-agent-machines)

[Primary source](https://shopify.engineering/remote-dev)

## CI optimization is continuous work.

Apply this technique yourself, or use StarSling Runners for faster GitHub Actions and optional agent-driven optimization PRs, which teams on eligible paid plans can turn on.

[Get self-improving CI](https://starsling.dev/products/runners)

## Related techniques

### [Warm reusable caches while building the image](https://starsling.dev/ci-playbooks/techniques/warm-image-caches)

Prepare image-local caches before normal CI runs so repeated downloads or cold initialization leave the critical path.

1 implementation · 1 company (Ramp)

## Company Playbooks

### [Anthropic](https://starsling.dev/ci-playbooks/anthropic)

Run only affected tests

### [DoorDash](https://starsling.dev/ci-playbooks/doordash)

Run build and test in parallel, sharded across CI agents

### [Linear](https://starsling.dev/ci-playbooks/linear)

Benchmark the same job on faster hardware

### [Mastra](https://starsling.dev/ci-playbooks/mastra)

StarSling runners for the slowest test workflow

### [OpenAI](https://starsling.dev/ci-playbooks/openai)

Rank CI fixes by the minutes they save

### [Ramp](https://starsling.dev/ci-playbooks/ramp)

Move a CPU-bound test suite to a faster CPU

### [Shopify](https://starsling.dev/ci-playbooks/shopify)

Let an agent iterate against one CI metric

### [Spotify](https://starsling.dev/ci-playbooks/spotify)

Build arm64 on native arm64 runners

### [Stripe](https://starsling.dev/ci-playbooks/stripe)

Run only the tests a change can reach

### [Uber](https://starsling.dev/ci-playbooks/uber)

Build the merge-queue speculations most likely to be needed
