Follow Discord
Sweep 22 Oct 2026 · 04:32Z Build v2.1.308 527 read Stable v2.1.308 Latest v2.1.308 Next v2.1.308 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · api

spawn.sh: called once per claimed work item changedmanaged-agents/self-hosted-sandboxes

Nearest release: v2.1.238, published under an hour after this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.

Recorded here
Lines+24added
Lines−16removed
From line 83 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits17to this page, all time

The whole hunk

from line 83, old and new numbered
/
lines
from line 83
8383 }'
8484 ```
8585 
86 ```bash CLI
87 ant beta:environments create \
88 --name self-hosted \
89 --config '{"type": "self_hosted"}'
90 ```
86 <MultiFileExample language="cli" label="CLI">
87 ```bash CLI
88 ant beta:environments create < environment.yaml
89 ```
9190 
91 <File filename="environment.yaml">
92 ```yaml
93 name: self-hosted
94 config:
95 type: self_hosted
96 ```
97 </File>
98 </MultiFileExample>
99 
92100 ```python Python
93101 client = anthropic.Anthropic()
94102 
from line 214
206214 For Linux environments, download the release binary directly.
207215 
208216 ```bash
209 VERSION=1.22.1
217 VERSION=1.26.1
210218 OS=$(uname -s | tr '[:upper:]' '[:lower:]')
211219 case $(uname -m) in
212220 x86_64) ARCH=amd64 ;;
from line 253
245253 
246254 ```text
247255 FROM your-base-image
248 ARG ANT_VERSION=1.22.1
256 ARG ANT_VERSION=1.26.1
249257 ARG TARGETARCH
250258 RUN ARCH=$([ "$TARGETARCH" = "arm64" ] && echo arm64 || echo amd64) && \
251259 curl -fsSL "https://github.com/anthropics/anthropic-cli/releases/download/v${ANT_VERSION}/ant_${ANT_VERSION}_linux_${ARCH}.tar.gz" \
from line 678
670678 
671679 * `.run()`: runs indefinitely, picking up sessions as they arrive.
672680 * `.handle_item()`: handles a single claimed work item and exits. Pass the work, session, and environment identifiers explicitly, or let it read the `ANTHROPIC_*` variables that `ant beta:worker poll --on-work` sets for the process it spawns. To let the session mount its [memory stores](https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes#use-memory-stores), also pass the work item's `secret` as `work_secret` (`workSecret` in TypeScript, `WorkSecret` in Go) or set `ANTHROPIC_WORK_SECRET`; `ant beta:worker poll --on-work` does not set that variable, so read the secret from the work item JSON it writes to your script's standard input, as shown in [Run one sandbox per session](https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes#run-one-sandbox-per-session).
673 * `memory_sync_interval` (`memorySyncIntervalMs` in TypeScript, `MemorySyncInterval` in Go) and `memory_sync_deletes` (`memoryRemoteDeletes`, `MemorySyncDeletes`): how often attached memory stores reconcile with the server while the session runs, and whether files the agent deletes locally are also deleted from the store. See [Configure sync](https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes#configure-sync) for units, defaults, and how to disable memory support.
681 * `memory_sync_interval` (`memorySyncIntervalMs` in TypeScript, `MemorySyncInterval` in Go) and `memory_sync_deletions` (`memorySyncDeletions`, `MemorySyncDeletions`): how often attached memory stores reconcile with the server while the session runs, and whether files the agent deletes locally are also deleted from the store. See [Configure sync](https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes#configure-sync) for units, defaults, and how to disable memory support.
674682 
675683* **`work.poller()`:** polls the work queue on your behalf and gives you each claimed session. Use this when you want to decide what happens for each session, for example launching a sandbox rather than running tools in-process.
676684 
from line 1284
12761284Two `EnvironmentWorker` options control memory behavior:
12771285 
12781286* **`memory_sync_interval`** (Python, in seconds; `memorySyncIntervalMs` in TypeScript, in milliseconds; `MemorySyncInterval` in Go, a duration): how often attached stores reconcile with the server while the session runs. Defaults to 15 seconds; the minimum is 5 seconds. A shorter interval narrows the window in which another session sees stale memories, at the cost of more memory store requests. `None` in Python, `null` in TypeScript, or a negative duration in Go disables memory support entirely: the worker neither downloads nor syncs stores, and a session with memory stores attached runs without them even though its system prompt still describes them, so disable memory support only on workers whose sessions attach no memory stores. While memory support is enabled, a work item that arrives without a per-session `secret` for a session with attached stores fails rather than running without memory (see [Troubleshoot memory mounts](https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes#troubleshoot-memory-mounts)).
1279* **`memory_sync_deletes`** (`memoryRemoteDeletes` in TypeScript, `MemorySyncDeletes` in Go): whether a file the agent deletes locally is also deleted from the store. The value is one of `"enabled"` (the default), `"log_only"`, or `"disabled"` in Python and TypeScript, and one of the constants `environments.MemorySyncDeletesEnabled` (the zero value), `environments.MemorySyncDeletesLogOnly`, or `environments.MemorySyncDeletesDisabled` in Go. When enabled, the worker deletes the memory from the store once a later sync confirms the file is still gone; in log-only mode it runs the same checks but only logs what it would have deleted, which lets you watch what your workers would delete before you trust the enabled mode; when disabled, it never deletes from the store. Uploads and downloads are unaffected by this setting.
1287* **`memory_sync_deletions`** (`memorySyncDeletions` in TypeScript, `MemorySyncDeletions` in Go): whether a file the agent deletes locally is also deleted from the store. The value is one of `"enabled"` (the default), `"log_only"`, or `"disabled"` in Python and TypeScript, and one of the constants `environments.MemorySyncDeletionsEnabled` (the zero value), `environments.MemorySyncDeletionsLogOnly`, or `environments.MemorySyncDeletionsDisabled` in Go. When enabled, the worker deletes the memory from the store once a later sync confirms the file is still gone; in log-only mode it runs the same checks but only logs what it would have deleted, which lets you watch what your workers would delete before you trust the enabled mode; when disabled, it never deletes from the store. Uploads and downloads are unaffected by this setting.
12801288 
12811289Set these options where you construct the worker, whether through the `EnvironmentWorker` constructor or, in Python and TypeScript, the `client.beta.environments.work.worker()` factory that the webhook handler uses.
12821290 
from line 1298
12901298 environment_key=environment_key,
12911299 workdir="/workspace",
12921300 memory_sync_interval=10, # seconds
1293 memory_sync_deletes="log_only",
1301 memory_sync_deletions="log_only",
12941302 )
12951303 ```
12961304 
from line 1309
13011309 environmentKey,
13021310 workdir: "/workspace",
13031311 memorySyncIntervalMs: 10_000,
1304 memorySyncDeletes: "log_only"
1312 memorySyncDeletions: "log_only"
13051313 });
13061314 ```
13071315 
from line 1319
13111319 
13121320 ```go Go
13131321 worker := environments.NewEnvironmentWorker(client, environments.EnvironmentWorkerOptions{
1314 EnvironmentID: environmentID,
1315 EnvironmentKey: environmentKey,
1316 Workdir: "/workspace",
1317 MemorySyncInterval: 10 * time.Second,
1318 MemorySyncDeletes: environments.MemorySyncDeletesLogOnly,
1322 EnvironmentID: environmentID,
1323 EnvironmentKey: environmentKey,
1324 Workdir: "/workspace",
1325 MemorySyncInterval: 10 * time.Second,
1326 MemorySyncDeletions: environments.MemorySyncDeletionsLogOnly,
13191327 })
13201328 ```
13211329 
Feedback