SfSkills Domains Docs GitHub

Home / devops / scratch-org-snapshots

scratch-org-snapshots

Use Scratch Org Snapshots to reduce CI bring-up time from 10–20 minutes to under 2. NOT for persistent sandbox provisioning — use devops/scratch-org-pools.

Open the skill folder on GitHub


Scratch Org Snapshots

Scratch Org Snapshots (GA) capture a fully configured scratch org so new ones can be created from the snapshot in seconds. For orgs with multiple managed package installs and large metadata pushes, this cuts CI bring-up from 15 minutes to under 2.

Adoption Signals

CI bring-up >5 minutes, especially with 3+ managed package installs or heavy data seed.

  1. Create a base scratch org with all managed packages installed, baseline metadata pushed, and seed data loaded.
  2. sf org create snapshot --name nightly-base --source-org <aliased-scratch> — takes 10–15 min, Dev Hub operation.
  3. Reference the snapshot in your scratch-def.json: "snapshot": "nightly-base".
  4. Add a nightly GitHub Action to recreate the snapshot so it stays fresh against package updates.
  5. CI workflows create scratch orgs from the snapshot with sf org create scratch --definition-file ... — sub-2-minute bring-up.

Key Considerations

Worked Examples (see references/examples.md)

Common Gotchas (see references/gotchas.md)

Top LLM Anti-Patterns (full list in references/llm-anti-patterns.md)

Official Sources Used

Package files