Answer: To add a setup script, add or edit the environment and select the Setup script row, then type or paste the script or choose a file up to 64 KB and select Add environment or Save changes. The setup script runs the first time you start a session; when setup completes within roughly five minutes, Anthropic snapshots the filesystem and reuses that snapshot as the starting point for later sessions, which skip the setup script step. Status: Check failed Entry: tool/claude-code/settings/cloud-setup-scripts-and-caching Revision: 2 Digest: sha256:4bff12c798d44d85 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:03:40Z Last changed: 2026-11-19T12:14:56Z Last verified: 2026-11-19T12:14:56Z Last attempt: 2026-11-20T12:19:12Z (failed) Next check: 2026-11-20T13:19:12Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Unit | Source | As of how to add | select the **Setup script** row | | [1] | 2026-11-19 file size limit | 64 KB | KB | [1] | 2026-11-19 cache build time limit | roughly five minutes | | [1] | 2026-11-19 cache expiry | roughly seven days | | [1] | 2026-11-19 what cache keeps | The cache is a filesystem snapshot | | [1] | 2026-11-19 Sources: [1] Anthropic. "Configure cloud environments". https://code.claude.com/docs/en/cloud-environments.md Role: primary. Accessed: 2026-11-19T12:14:57Z Quote: "Add or edit the environment](#configure-your-environment) and select the **Setup script** row." (Supports: how to add) Quote: "select **Choose file** to replace the box's contents with the text of a file up to 64 KB" (Supports: file size limit) Quote: "When setup completes within [roughly five minutes](#script-requirements), Anthropic snapshots the filesystem and reuses that snapshot as the starting point for later sessions." (Supports: cache build time limit) Quote: "when the cache reaches its expiry after roughly seven days" (Supports: cache expiry) Quote: "The cache is a filesystem snapshot, so it keeps what the setup script writes to disk and loses anything that was only running." (Supports: what cache keeps) Published: 2026-11-19T03:54:42Z Snapshot SHA-256: 41cbff6f5355a974266a4dc6659bd786ffa124b997cd277f1f4e6727b8c32c64 (captured 2026-11-17T12:23:54Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-18T12:14:50Z, so the values verified then were kept. Cross-check: not-available at 2026-11-19T12:14:56Z. No independent second source is configured for this entry Last successful check: 2026-11-19T12:14:56Z Last attempt: 2026-11-20T12:19:12Z (failed) Notes and limitations: Extracted automatically from a single official source (section "Setup scripts"). Related: https://latestn.com/tool/claude-code/settings/code-review-defaults How do I set when Code Review runs and how thorough reviews are in Claude? https://latestn.com/tool/claude-code/settings/code-review-frequency How often do Claude Code Review reviews run by default and how can I change that? https://latestn.com/tool/claude-code/settings/configure-extension-settings How do I configure Claude Code extension settings in VS Code? https://latestn.com/tool/claude-code/settings/choose-right-file Which file should I use in Claude Code for instructions, settings, skills, or subagents? https://latestn.com/tool/claude-code/settings/choose-xcode-for-simulator-pane How do I choose which Xcode version the Claude Code simulator pane uses? https://latestn.com/tool/claude-code/settings/claude-directory-locations Where does Claude Code store its configuration files in the project and home directory? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-20T12:19:12Z | check-failed | Extraction did not pass verification: most fields failed verification: fields[0] How to add setup script: quote not found verbatim in the source: "Add or edit the environment and select the **Setup script** row." | — 2026-11-19T12:14:56Z | changed | what cache keeps: — → The cache is a filesystem snapshot | [1] 2026-11-19T12:14:56Z | changed | cache expiry: — → roughly seven days | [1] 2026-11-19T12:14:56Z | changed | cache build time limit: — → roughly five minutes | [1] 2026-11-19T12:14:56Z | changed | file size limit: — → 64 KB | [1] 2026-11-19T12:14:56Z | changed | how to add: — → select the **Setup script** row | [1] 2026-11-19T12:14:56Z | changed | Script runtime limit: five minutes → — | [1] 2026-11-19T12:14:56Z | changed | Cache expiry: roughly seven days → — | [1] 2026-11-19T12:14:56Z | changed | Caching time limit: roughly five minutes → — | [1] 2026-11-19T12:14:56Z | changed | File size limit: 64 KB → — | [1] 2026-11-18T12:14:50Z | recovered | Check succeeded again | — 2026-11-17T12:23:57Z | check-failed | Extraction did not pass verification: most fields failed verification: fields[0] How to add setup script: quote not found verbatim in the source: "Add or edit the environment and select the **Setup script** row." | — 2026-11-13T03:03:40Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/settings/cloud-setup-scripts-and-caching/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/claude-code/settings/cloud-setup-scripts-and-caching POST: https://latestn.com/dispute/tool/claude-code/settings/cloud-setup-scripts-and-caching with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/settings/cloud-setup-scripts-and-caching?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I add a setup script to a Claude Code cloud environment and how does environment caching work? Revision 2, last verified 2026-11-19T12:14:56Z. https://latestn.com/tool/claude-code/settings/cloud-setup-scripts-and-caching (accessed 2026-11-21T09:52:53Z). @misc{LatestN_tool_claude_code_settings_cloud_setup_scripts_and_caching_r2, title = {How do I add a setup script to a Claude Code cloud environment and how does environment caching work?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/settings/cloud-setup-scripts-and-caching}}, note = {Revision 2; digest sha256:4bff12c798d44d85; last verified 2026-11-19T12:14:56Z; accessed 2026-11-21T09:52:53Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/claude-code/settings/cloud-setup-scripts-and-caching