{"id":2532,"date":"2026-11-06T09:00:00","date_gmt":"2026-11-06T03:30:00","guid":{"rendered":"https:\/\/swapnilzambare.com\/blog\/scratch-org-definition-org-shape\/"},"modified":"2026-11-15T22:00:50","modified_gmt":"2026-11-15T16:30:50","slug":"scratch-org-definition-org-shape","status":"publish","type":"post","link":"https:\/\/swapnilzambare.com\/blog\/scratch-org-definition-org-shape\/","title":{"rendered":"Scratch Org Definition Files and Org Shape Explained"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">A Scratch Org Definition file is the recipe for a fresh Salesforce org. It names the edition, switches on the features your code needs, and sets the org settings that would otherwise be clicked by hand. Everything about the org comes from that file, which is why it belongs in Git next to the code.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is what makes a scratch org reproducible. Two developers running the same command get identical orgs, and so does the build server. A sandbox, by contrast, carries whatever its source org happened to have switched on.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><a href=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/scratch-org-definition-org-shape-diagram-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/scratch-org-definition-org-shape-diagram-1-1024x640.png\" alt=\"Scratch Org Definition diagram showing definition file, creation and source push\" class=\"wp-image-2530\" srcset=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/scratch-org-definition-org-shape-diagram-1-1024x640.png 1024w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/scratch-org-definition-org-shape-diagram-1-300x188.png 300w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/scratch-org-definition-org-shape-diagram-1-768x480.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Caption: Nothing in the org exists unless the definition file, the source or the seed data put it there.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What Is a Scratch Org Definition File<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A Scratch Org Definition is a small JSON file, normally at <code>config\/project-scratch-def.json<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"orgName\": \"Bright Path Tutors Dev\",\n  \"edition\": \"Developer\",\n  \"features\": [\n    \"EnableSetPasswordInApi\",\n    \"PersonAccounts\",\n    \"DebugApex\"\n  ],\n  \"settings\": {\n    \"lightningExperienceSettings\": {\n      \"enableS1DesktopEnabled\": true\n    },\n    \"securitySettings\": {\n      \"passwordPolicies\": {\n        \"minimumPasswordLength\": 10\n      }\n    }\n  }\n}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Key<\/th><th>What it controls<\/th><\/tr><\/thead><tbody><tr><td>orgName<\/td><td>The name shown in the org, which is cosmetic<\/td><\/tr><tr><td>edition<\/td><td>Developer, Enterprise, Group or Professional<\/td><\/tr><tr><td>features<\/td><td>Capabilities to switch on, as a list of names<\/td><\/tr><tr><td>settings<\/td><td>Org settings, grouped by settings type<\/td><\/tr><tr><td>sourceOrg<\/td><td>The org shape to copy, instead of declaring settings<\/td><\/tr><tr><td>snapshot<\/td><td>A saved org snapshot to create from<\/td><\/tr><tr><td>hasSampleData<\/td><td>Whether to include the standard sample data<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Creating the Org<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sf org create scratch \\\n  --definition-file config\/project-scratch-def.json \\\n  --alias dev1 \\\n  --duration-days 7 \\\n  --set-default\n\nsf project deploy start --target-org dev1\nsf apex run test --target-org dev1 --wait 20<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The duration on a Scratch Org Definition matters more than people expect. A scratch org expires, and an expired org takes your unsaved work with it. Short durations for daily work and longer ones for a feature branch is the usual pattern. The post on <a href=\"https:\/\/swapnilzambare.com\/blog\/scratch-orgs-vs-sandboxes-developer-edition\/\">scratch orgs and sandboxes<\/a> compares the environment types.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Features and Settings Are Different Things<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This distinction causes most of the confusion with a Scratch Org Definition.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Concept<\/th><th>What it is<\/th><th>Example<\/th><\/tr><\/thead><tbody><tr><td>A feature<\/td><td>A capability to switch on<\/td><td>PersonAccounts, Sites, ServiceCloud<\/td><\/tr><tr><td>A setting<\/td><td>A configuration value inside a settings type<\/td><td>A password length, a Chatter toggle<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Some features take a quantity, written with a colon in the name, such as a number of extra licences. Settings follow the metadata settings structure, so the key names match the Metadata API rather than the Setup page labels.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"features\": [\"MultiCurrency\", \"AuthorApex\", \"ProcessBuilder\"],\n\"settings\": {\n  \"chatterSettings\": { \"enableChatter\": false },\n  \"omniChannelSettings\": { \"enableOmniChannel\": true }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When a deployment fails in a scratch org but works in a sandbox, a missing feature is almost always the reason. The error names the component, and the fix is one line in the definition file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Org Shape for Complicated Orgs<\/h2>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><a href=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/scratch-org-definition-org-shape-diagram-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/scratch-org-definition-org-shape-diagram-2-1024x640.png\" alt=\"Scratch Org Definition and org shape comparison diagram\" class=\"wp-image-2531\" srcset=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/scratch-org-definition-org-shape-diagram-2-1024x640.png 1024w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/scratch-org-definition-org-shape-diagram-2-300x188.png 300w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/scratch-org-definition-org-shape-diagram-2-768x480.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Caption: A hand written definition file is clearer, and a shape is more honest about a messy production org.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A Scratch Org Definition for a large production org would hold hundreds of settings, and nobody wants to transcribe them. Org shape captures the shape of a real org and lets a scratch org be created from it.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sf org create shape --target-org production<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"orgName\": \"Shape of production\",\n  \"sourceOrg\": \"00D...\"\n}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Behaviour<\/th><th>What it means<\/th><\/tr><\/thead><tbody><tr><td>Settings come from the source org<\/td><td>No transcription by hand<\/td><\/tr><tr><td>Features come from the source org<\/td><td>Including ones nobody documented<\/td><\/tr><tr><td>Data is not copied<\/td><td>A shape is configuration, not records<\/td><\/tr><tr><td>It is a snapshot in time<\/td><td>Capture it again when the org changes<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">That third row is worth repeating. A shape gives you an empty org configured like production, which is exactly what a developer wants and not at all what a tester wants.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Snapshots for Faster Setup<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If a Scratch Org Definition, a deploy and a data seed take twelve minutes together, a snapshot turns that into one command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sf org create snapshot \\\n  --source-org dev1 \\\n  --snapshot-name base-with-data \\\n  --description 'Metadata plus seed data'<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"orgName\": \"Feature work\",\n  \"snapshot\": \"base-with-data\"\n}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Approach<\/th><th>Setup time<\/th><th>Keeps up with changes<\/th><\/tr><\/thead><tbody><tr><td>Definition file plus deploy plus seed<\/td><td>The longest<\/td><td>Always current<\/td><\/tr><tr><td>Org shape plus deploy plus seed<\/td><td>Long, but matches production<\/td><td>Current if recaptured<\/td><\/tr><tr><td>Snapshot<\/td><td>The shortest<\/td><td>Only as fresh as the snapshot<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The trap with snapshots is staleness. A snapshot taken three weeks ago contains three weeks old metadata, so most teams refresh it on a schedule and keep the definition file as the source of truth.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">A Real Scratch Org Definition Example<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Our Scratch Org Definition used to be guesswork. Bright Path Tutors ran into the same conversation every Monday. A developer created a scratch org, the deployment failed, somebody remembered the missing feature, and forty minutes went by.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Problem<\/th><th>What it cost<\/th><\/tr><\/thead><tbody><tr><td>Features discovered by trial and error<\/td><td>Forty minutes per new developer<\/td><\/tr><tr><td>Three definition files in three branches<\/td><td>Different orgs for different people<\/td><\/tr><tr><td>No seed data step<\/td><td>Tests passed locally and failed in review<\/td><\/tr><tr><td>Twelve minute setup<\/td><td>Nobody created a clean org when they should have<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We settled on one definition file, one seed script and a weekly snapshot.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Measure<\/th><th>Before<\/th><th>After<\/th><\/tr><\/thead><tbody><tr><td>Time to a working org<\/td><td>40 minutes, with help<\/td><td>90 seconds from the snapshot<\/td><\/tr><tr><td>Definition files in the repo<\/td><td>3<\/td><td>1<\/td><\/tr><tr><td>Deployment failures from missing features<\/td><td>Weekly<\/td><td>None<\/td><\/tr><tr><td>Clean orgs created per developer per week<\/td><td>Under 1<\/td><td>4 or 5<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The same script runs in the pipeline, which is covered in the post on <a href=\"https:\/\/swapnilzambare.com\/blog\/salesforce-ci-cd-github-actions\/\">CI and CD<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The last row is the point of the whole exercise. When a fresh org is cheap, people throw orgs away instead of nursing broken ones.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Seeding Data<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A Scratch Org Definition builds an empty org, so data is a separate step. A small plan file keeps it repeatable.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sf data import tree --plan data\/sample-plan.json --target-org dev1<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Keep the data set small and deliberate. Ten courses and six contacts that exercise the edge cases beat a thousand random rows, and the post on <a href=\"https:\/\/swapnilzambare.com\/blog\/salesforce-cli-deploy-retrieve-metadata\/\">the Salesforce CLI<\/a> covers building that set.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Limits and Things to Watch<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Scratch orgs expire, and an expired org cannot be recovered<\/li>\n\n<li>Your Dev Hub has daily and active allowances, which a busy team can exhaust<\/li>\n\n<li>Settings key names follow the Metadata API, not the Setup page labels<\/li>\n\n<li>Not every feature is available in every edition you can choose<\/li>\n\n<li>A shape is configuration only, with no records<\/li>\n\n<li>A snapshot ages, so it needs refreshing<\/li>\n\n<li>Some features need a case with Salesforce before they can be used in a scratch org<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The Scratch Org Definition is only half the story during a release week, because allowances bite. Several developers creating orgs all day can use the daily number, and the error message is not always obvious. Expiring orgs you no longer need with <code>sf org delete scratch<\/code> is a good habit.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Common Mistakes with a Scratch Org Definition<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Mistake<\/th><th>What you see<\/th><th>Fix<\/th><\/tr><\/thead><tbody><tr><td>Features found by trial and error<\/td><td>Repeated deployment failures<\/td><td>Record each one in the definition file<\/td><\/tr><tr><td>Several definition files in one repo<\/td><td>Different orgs per developer<\/td><td>Keep one, with named variants if needed<\/td><\/tr><tr><td>Setup page labels used as settings keys<\/td><td>The create call is rejected<\/td><td>Use the Metadata API names<\/td><\/tr><tr><td>A seven day org for a long feature<\/td><td>Work lost on expiry<\/td><td>Set the duration to match the work<\/td><\/tr><tr><td>A snapshot never refreshed<\/td><td>Old metadata in new orgs<\/td><td>Refresh on a schedule<\/td><\/tr><tr><td>No seed data step<\/td><td>Tests that pass only on one machine<\/td><td>Keep a plan file in the repo<\/td><\/tr><tr><td>Leaving unused orgs active<\/td><td>The allowance exhausted<\/td><td>Delete orgs when you are done<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Best Practices for a Scratch Org Definition<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Keep one definition file in the repo and treat it as part of the build<\/li>\n\n<li>Add every feature you discover, with a comment saying what needed it<\/li>\n\n<li>Set the duration to the expected life of the branch<\/li>\n\n<li>Script the whole path, from create to deploy to seed to test, in one command<\/li>\n\n<li>Use a shape when production configuration is too complex to transcribe<\/li>\n\n<li>Use a snapshot for speed, and refresh it on a schedule<\/li>\n\n<li>Delete orgs you are finished with<\/li>\n\n<li>Make the same script run in your pipeline so the build uses the same org<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Most Asked Scratch Org Definition Interview Questions<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q1: What does a definition file control?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The edition, features and settings of a newly created scratch org.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q2: Where does it usually live?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the config folder of the project, as project-scratch-def.json.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q3: Which editions can you choose?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Developer, Enterprise, Group and Professional.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q4: What is the difference between a feature and a setting?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A feature switches a capability on, and a setting configures a value inside a settings type.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q5: Where do settings key names come from?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The Metadata API settings types, not the Setup page labels.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q6: What happens when a deployment fails in a scratch org but works in a sandbox?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Usually a feature is missing from the definition file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q7: How long can a scratch org live?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is set by the duration when you create it, up to the maximum your Dev Hub allows.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q8: What happens when it expires?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is gone, along with anything in it that was not committed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q9: What is org shape?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A captured configuration of a real org, which a scratch org can be created from.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q10: Which key points a definition file at a shape?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The sourceOrg key, naming the org the shape came from.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q11: Does a shape include data?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">No. It is configuration only.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q12: When is a shape the better choice?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When a production org has too many settings to transcribe by hand.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q13: What is an org snapshot?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A saved copy of an org including its metadata and data, used to create new orgs quickly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q14: Which key creates from a snapshot?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The snapshot key, naming the snapshot.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q15: What is the drawback of a snapshot?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It ages, so it has to be refreshed or it hands out stale metadata.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q16: Which of the three is the source of truth?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The definition file, since it is readable, reviewable and lives in Git.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q17: How do you seed data?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With a data plan file and the CLI import command, run after the deployment.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q18: How big should the seed data set be?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Small and deliberate, covering the edge cases rather than filling the org.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q19: Why keep only one definition file?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So every developer and the build server create the same org.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q20: What limits apply to scratch orgs?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Daily and active allowances on the Dev Hub, which a busy team can exhaust.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q21: How do you avoid exhausting them?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Delete orgs when you finish with them rather than letting them expire.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q22: Can every feature be enabled in a scratch org?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">No. Some depend on the edition, and a few need a case with Salesforce.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q23: Why is a reproducible org worth the effort?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Because a failing test can then be trusted, since the environment is the same everywhere.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q24: Scenario: a new developer loses forty minutes on a failed deployment. What went wrong?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A feature the code needs is missing from the definition file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q25: Scenario: two developers see different behaviour in their orgs. Why?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">They are creating from different definition files or an out of date snapshot.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q26: Scenario: a week of work vanished. What happened?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The org expired, which is why work belongs in Git rather than in an org.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q27: Scenario: the create command fails on a settings key. What do you check?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The Metadata API name for that settings type, since Setup labels do not match.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q28: Should the pipeline use the same definition file?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. That is the main reason to keep it in the repo.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q29: What is the single habit that makes scratch orgs work?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Script the whole path in one command, so creating a clean org is cheaper than fixing a dirty one.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Official Resources<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/developer.salesforce.com\/docs\/atlas.en-us.sfdx_dev.meta\/sfdx_dev\/\" target=\"_blank\" rel=\"noopener noreferrer\">Salesforce DX Developer Guide<\/a><\/li>\n\n<li><a href=\"https:\/\/developer.salesforce.com\/docs\/atlas.en-us.api_meta.meta\/api_meta\/\" target=\"_blank\" rel=\"noopener noreferrer\">Metadata API Developer Guide<\/a><\/li>\n\n<li><a href=\"https:\/\/developer.salesforce.com\/docs\/atlas.en-us.sfdx_cli_reference.meta\/sfdx_cli_reference\/\" target=\"_blank\" rel=\"noopener noreferrer\">Salesforce CLI Command Reference<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">What Is Next<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Next, read <a href=\"https:\/\/swapnilzambare.com\/blog\/salesforce-data-seeding\/\">Salesforce Data Seeding for Scratch Orgs Explained<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A Scratch Org Definition file is the recipe for a fresh Salesforce org. It names the edition, switches on the features your code needs,&hellip;<\/p>\n","protected":false},"author":1,"featured_media":2529,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_swapz_level":"","_swapz_series_part":0,"_swapz_hide_toc":false,"_swapz_hide_featured":false,"_swapz_description":"","footnotes":""},"categories":[247,8,96],"tags":[68,51,130],"swapz_series":[],"class_list":["post-2532","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops-packaging","category-salesforce","category-salesforce-developer","tag-advanced","tag-collaboration","tag-devops"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Scratch Org Definition Files and Org Shape<\/title>\n<meta name=\"description\" content=\"A Scratch Org Definition file decides the edition, features and settings a new org gets. Learn the keys that matter, plus org shape and snapshots.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/swapnilzambare.com\/blog\/scratch-org-definition-org-shape\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Scratch Org Definition Files and Org Shape\" \/>\n<meta property=\"og:description\" content=\"A Scratch Org Definition file decides the edition, features and settings a new org gets. Learn the keys that matter, plus org shape and snapshots.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/swapnilzambare.com\/blog\/scratch-org-definition-org-shape\/\" \/>\n<meta property=\"og:site_name\" content=\"Swapnil Zambare - Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-06T03:30:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-11-15T16:30:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/scratch-org-definition-org-shape-featured.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2400\" \/>\n\t<meta property=\"og:image:height\" content=\"1260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Swapnil Zambare\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Swapnil Zambare\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/scratch-org-definition-org-shape\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/scratch-org-definition-org-shape\\\/\"},\"author\":{\"name\":\"Swapnil Zambare\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/person\\\/10b09224c8bcc562716e86789427592a\"},\"headline\":\"Scratch Org Definition Files and Org Shape Explained\",\"datePublished\":\"2026-11-06T03:30:00+00:00\",\"dateModified\":\"2026-11-15T16:30:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/scratch-org-definition-org-shape\\\/\"},\"wordCount\":1857,\"publisher\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/scratch-org-definition-org-shape\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/scratch-org-definition-org-shape-featured.png\",\"keywords\":[\"Advanced\",\"Collaboration\",\"DevOps\"],\"articleSection\":[\"DevOps and Packaging\",\"Salesforce\",\"Salesforce Developer\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/scratch-org-definition-org-shape\\\/\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/scratch-org-definition-org-shape\\\/\",\"name\":\"Scratch Org Definition Files and Org Shape\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/scratch-org-definition-org-shape\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/scratch-org-definition-org-shape\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/scratch-org-definition-org-shape-featured.png\",\"datePublished\":\"2026-11-06T03:30:00+00:00\",\"dateModified\":\"2026-11-15T16:30:50+00:00\",\"description\":\"A Scratch Org Definition file decides the edition, features and settings a new org gets. Learn the keys that matter, plus org shape and snapshots.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/scratch-org-definition-org-shape\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/scratch-org-definition-org-shape\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/scratch-org-definition-org-shape\\\/#primaryimage\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/scratch-org-definition-org-shape-featured.png\",\"contentUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/scratch-org-definition-org-shape-featured.png\",\"width\":2400,\"height\":1260,\"caption\":\"Scratch Org Definition featured image showing a definition file creating a fresh org\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/scratch-org-definition-org-shape\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Scratch Org Definition Files and Org Shape Explained\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/\",\"name\":\"Swapnil Zambare - Blog\",\"description\":\"Salesforce &amp; Tech Guides\",\"publisher\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#organization\",\"name\":\"Swapnil Zambare - Blog\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/site-icon-512.png\",\"contentUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/site-icon-512.png\",\"width\":512,\"height\":512,\"caption\":\"Swapnil Zambare - Blog\"},\"image\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/theSwapnilZambare\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/person\\\/10b09224c8bcc562716e86789427592a\",\"name\":\"Swapnil Zambare\",\"sameAs\":[\"https:\\\/\\\/swapnilzambare.com\\\/blog\"],\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/author\\\/swapnil-zambare\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Scratch Org Definition Files and Org Shape","description":"A Scratch Org Definition file decides the edition, features and settings a new org gets. Learn the keys that matter, plus org shape and snapshots.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/swapnilzambare.com\/blog\/scratch-org-definition-org-shape\/","og_locale":"en_US","og_type":"article","og_title":"Scratch Org Definition Files and Org Shape","og_description":"A Scratch Org Definition file decides the edition, features and settings a new org gets. Learn the keys that matter, plus org shape and snapshots.","og_url":"https:\/\/swapnilzambare.com\/blog\/scratch-org-definition-org-shape\/","og_site_name":"Swapnil Zambare - Blog","article_published_time":"2026-11-06T03:30:00+00:00","article_modified_time":"2026-11-15T16:30:50+00:00","og_image":[{"width":2400,"height":1260,"url":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/scratch-org-definition-org-shape-featured.png","type":"image\/png"}],"author":"Swapnil Zambare","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Swapnil Zambare","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/swapnilzambare.com\/blog\/scratch-org-definition-org-shape\/#article","isPartOf":{"@id":"https:\/\/swapnilzambare.com\/blog\/scratch-org-definition-org-shape\/"},"author":{"name":"Swapnil Zambare","@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/person\/10b09224c8bcc562716e86789427592a"},"headline":"Scratch Org Definition Files and Org Shape Explained","datePublished":"2026-11-06T03:30:00+00:00","dateModified":"2026-11-15T16:30:50+00:00","mainEntityOfPage":{"@id":"https:\/\/swapnilzambare.com\/blog\/scratch-org-definition-org-shape\/"},"wordCount":1857,"publisher":{"@id":"https:\/\/swapnilzambare.com\/blog\/#organization"},"image":{"@id":"https:\/\/swapnilzambare.com\/blog\/scratch-org-definition-org-shape\/#primaryimage"},"thumbnailUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/scratch-org-definition-org-shape-featured.png","keywords":["Advanced","Collaboration","DevOps"],"articleSection":["DevOps and Packaging","Salesforce","Salesforce Developer"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/swapnilzambare.com\/blog\/scratch-org-definition-org-shape\/","url":"https:\/\/swapnilzambare.com\/blog\/scratch-org-definition-org-shape\/","name":"Scratch Org Definition Files and Org Shape","isPartOf":{"@id":"https:\/\/swapnilzambare.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/swapnilzambare.com\/blog\/scratch-org-definition-org-shape\/#primaryimage"},"image":{"@id":"https:\/\/swapnilzambare.com\/blog\/scratch-org-definition-org-shape\/#primaryimage"},"thumbnailUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/scratch-org-definition-org-shape-featured.png","datePublished":"2026-11-06T03:30:00+00:00","dateModified":"2026-11-15T16:30:50+00:00","description":"A Scratch Org Definition file decides the edition, features and settings a new org gets. Learn the keys that matter, plus org shape and snapshots.","breadcrumb":{"@id":"https:\/\/swapnilzambare.com\/blog\/scratch-org-definition-org-shape\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/swapnilzambare.com\/blog\/scratch-org-definition-org-shape\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/swapnilzambare.com\/blog\/scratch-org-definition-org-shape\/#primaryimage","url":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/scratch-org-definition-org-shape-featured.png","contentUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/scratch-org-definition-org-shape-featured.png","width":2400,"height":1260,"caption":"Scratch Org Definition featured image showing a definition file creating a fresh org"},{"@type":"BreadcrumbList","@id":"https:\/\/swapnilzambare.com\/blog\/scratch-org-definition-org-shape\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/swapnilzambare.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Scratch Org Definition Files and Org Shape Explained"}]},{"@type":"WebSite","@id":"https:\/\/swapnilzambare.com\/blog\/#website","url":"https:\/\/swapnilzambare.com\/blog\/","name":"Swapnil Zambare - Blog","description":"Salesforce &amp; Tech Guides","publisher":{"@id":"https:\/\/swapnilzambare.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/swapnilzambare.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/swapnilzambare.com\/blog\/#organization","name":"Swapnil Zambare - Blog","url":"https:\/\/swapnilzambare.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/09\/site-icon-512.png","contentUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/09\/site-icon-512.png","width":512,"height":512,"caption":"Swapnil Zambare - Blog"},"image":{"@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.linkedin.com\/in\/theSwapnilZambare"]},{"@type":"Person","@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/person\/10b09224c8bcc562716e86789427592a","name":"Swapnil Zambare","sameAs":["https:\/\/swapnilzambare.com\/blog"],"url":"https:\/\/swapnilzambare.com\/blog\/author\/swapnil-zambare\/"}]}},"_links":{"self":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts\/2532","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/comments?post=2532"}],"version-history":[{"count":2,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts\/2532\/revisions"}],"predecessor-version":[{"id":3410,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts\/2532\/revisions\/3410"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/media\/2529"}],"wp:attachment":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/media?parent=2532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/categories?post=2532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/tags?post=2532"},{"taxonomy":"swapz_series","embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/swapz_series?post=2532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}