Answer: Create and delete environments programmatically so each CI run gets a clean one, using the same endpoints as the Cloud environments admin page with the `anthropic-beta: ccr-byoc-2025-07-29` header. Mint an Owner-role admin token, POST to create the environment, then DELETE it when the run finishes. Status: Confirmed Entry: tool/claude-code/admin-and-enterprise/create-test-environment Revision: 2 Digest: sha256:db576bd8eebfefcf (changes whenever the content changes) Timeline: Created: 2026-11-13T03:05:43Z Last changed: 2026-11-18T12:20:09Z (runner env var: — → SELF_HOSTED_RUNNER_ENVIRONMENT_SECRET=$ENVIRONMENT_SECRET) Last verified: 2026-11-20T12:25:08Z Next check: 2026-11-21T12:25:08Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of beta header | ccr-byoc-2025-07-29 | [1] | 2026-11-20 create endpoint | https://api.anthropic.com/v1/code/runners/self-hosted/pools | [1] | 2026-11-20 environment name in example | ci-test-environment | [1] | 2026-11-20 refresh-grant cap | 30-day | [1] | 2026-11-20 minimum curl version | 7.55 | [1] | 2026-11-20 runner env var | SELF_HOSTED_RUNNER_ENVIRONMENT_SECRET=$ENVIRONMENT_SECRET | [1] | 2026-11-20 Sources: [1] Anthropic. "Test self-hosted environments end to end". https://code.claude.com/docs/en/self-hosted-environments-testing.md Role: primary. Accessed: 2026-11-20T12:25:08Z Quote: "they require the `anthropic-beta: ccr-byoc-2025-07-29` header" (Supports: beta header) Quote: "https://api.anthropic.com/v1/code/runners/self-hosted/pools" (Supports: create endpoint) Quote: "-d '{"name":"ci-test-environment"}'" (Supports: environment name in example) Quote: "the same 30-day refresh-grant cap applies" (Supports: refresh-grant cap) Quote: "requires curl 7.55 or later" (Supports: minimum curl version) Quote: "Start a runner on this host with `SELF_HOSTED_RUNNER_ENVIRONMENT_SECRET=$ENVIRONMENT_SECRET`" (Supports: runner env var) Published: 2026-11-20T03:48:50Z Snapshot SHA-256: b3c6e8a5d7872e279c8228218555bd8ec42232c995093c21a513796cc9a0d8d7 (captured 2026-11-20T12:25:07Z) 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]. Cross-check: not-available at 2026-11-20T12:25:08Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:25:08Z Last attempt: 2026-11-20T12:25:08Z Notes and limitations: Extracted automatically from a single official source (section "Create a dedicated test environment"). Related: https://latestn.com/tool/claude-code/admin-and-enterprise/custom-ca-certificates How do I make Claude Code trust a custom CA certificate? https://latestn.com/tool/claude-code/admin-and-enterprise/default-mod-behavior What happens by default with mods in Claude Code if I change nothing? https://latestn.com/tool/claude-code/admin-and-enterprise/deliver-managed-settings How do I deliver managed settings to Claude Code devices in my organization? https://latestn.com/tool/claude-code/admin-and-enterprise/configure-proxy-server How do I configure a proxy server for Claude Code in an enterprise environment? https://latestn.com/tool/claude-code/admin-and-enterprise/configure-server-managed-settings How do I configure server-managed settings for Claude Code in the claude.ai console? https://latestn.com/tool/claude-code/admin-and-enterprise/corporate-proxy-aws How do I route Claude Code through a corporate proxy on Claude Platform on AWS? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-18T12:20:09Z | changed | runner env var: — → SELF_HOSTED_RUNNER_ENVIRONMENT_SECRET=$ENVIRONMENT_SECRET | [1] 2026-11-18T12:20:09Z | changed | minimum curl version: — → 7.55 | [1] 2026-11-18T12:20:09Z | changed | refresh-grant cap: — → 30-day | [1] 2026-11-18T12:20:09Z | changed | environment name in example: — → ci-test-environment | [1] 2026-11-18T12:20:09Z | changed | create endpoint: — → https://api.anthropic.com/v1/code/runners/self-hosted/pools | [1] 2026-11-18T12:20:09Z | changed | beta header: — → ccr-byoc-2025-07-29 | [1] 2026-11-18T12:20:09Z | changed | Curl version requirement: curl 7.55 or later → — | [1] 2026-11-18T12:20:09Z | changed | Runner env var: SELF_HOSTED_RUNNER_ENVIRONMENT_SECRET=$ENVIRONMENT_SECRET → — | [1] 2026-11-18T12:20:09Z | changed | Delete endpoint: https://api.anthropic.com/v1/code/runners/self-hosted/pools/$ENVIRONMENT_ID → — | [1] 2026-11-18T12:20:09Z | changed | Create endpoint: https://api.anthropic.com/v1/code/runners/self-hosted/pools → — | [1] 2026-11-18T12:20:09Z | changed | Admin token role: Owner role → — | [1] 2026-11-18T12:20:09Z | changed | Required header: anthropic-beta: ccr-byoc-2025-07-29 → — | [1] 2026-11-18T12:20:09Z | changed | Approach: Create and delete environments programmatically so each CI run gets a clean one → — | [1] 2026-11-13T03:05:43Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/admin-and-enterprise/create-test-environment/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/admin-and-enterprise/create-test-environment POST: https://latestn.com/dispute/tool/claude-code/admin-and-enterprise/create-test-environment with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/admin-and-enterprise/create-test-environment?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I create a dedicated test environment for Claude Code self-hosted environments? Revision 2, last verified 2026-11-20T12:25:08Z. https://latestn.com/tool/claude-code/admin-and-enterprise/create-test-environment (accessed 2026-11-21T09:59:13Z). @misc{LatestN_tool_claude_code_admin_and_enterprise_create_test_environment_r2, title = {How do I create a dedicated test environment for Claude Code self-hosted environments?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/admin-and-enterprise/create-test-environment}}, note = {Revision 2; digest sha256:db576bd8eebfefcf; last verified 2026-11-20T12:25:08Z; accessed 2026-11-21T09:59:13Z} } 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/admin-and-enterprise/create-test-environment