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

code-execution-tool changedagents-and-tools/tool-use/code-execution-tool

Nearest release: v2.1.304, 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+16added
Lines−15removed
From line 289 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits23to this page, all time

The whole hunk

from line 289, old and new numbered
/
lines
from line 289
289289 
290290<CodeGroup>
291291 ```bash cURL
292 # First, upload a file and capture the file ID (using jq)
293 FILE_ID=$(curl --fail-with-body -sS https://api.anthropic.com/v1/files \
292 # First, upload a file
293 curl --fail-with-body -sS https://api.anthropic.com/v1/files \
294294 -H "x-api-key: $ANTHROPIC_API_KEY" \
295295 -H "anthropic-version: 2023-06-01" \
296 -F "[email protected]" | jq -r '.id')
297297 
298 # Then use the file_id with code execution
298 # Then use the file with code execution: FILE_ID is the id from the upload response
299299 curl --fail-with-body -sS https://api.anthropic.com/v1/messages \
300300 -H "x-api-key: $ANTHROPIC_API_KEY" \
301301 -H "anthropic-version: 2023-06-01" \
from line 318
318318 ```
319319 
320320 ```bash CLI
321 # First, upload a file and capture the file ID
322 FILE_ID=$(ant files upload --file ./data.csv --transform id --raw-output)
321 # First, upload a file
322 ant files upload --file ./data.csv
323323 
324 # Then use the file_id with code execution
324 # Then use the file with code execution: FILE_ID is the id from the upload response
325325 ant messages create <<YAML
326326 model: claude-opus-5-5
327327 max_tokens: 4096
from line 1139
11391139 
11401140<CodeGroup>
11411141 ```bash cURL
1142 # First request: Create a file with a random number, capturing the container ID (using jq)
1143 CONTAINER_ID=$(curl -s https://api.anthropic.com/v1/messages \
1142 # First request: Create a file with a random number
1143 curl https://api.anthropic.com/v1/messages \
11441144 -H "x-api-key: $ANTHROPIC_API_KEY" \
11451145 -H "anthropic-version: 2023-06-01" \
11461146 -H "content-type: application/json" \
from line 1155
11551155 "type": "code_execution_20250825",
11561156 "name": "code_execution"
11571157 }]
1158 }' | jq -r '.container.id')
1158 }'
11591159 
11601160 # Second request: Reuse the container to read the file
1161 # CONTAINER_ID is the container.id from the first response
11611162 curl https://api.anthropic.com/v1/messages \
11621163 -H "x-api-key: $ANTHROPIC_API_KEY" \
11631164 -H "anthropic-version: 2023-06-01" \
from line 1180
11791180 
11801181 ```bash CLI
11811182 # First request: Create a file with a random number
1182 CONTAINER_ID=$(ant messages create \
1183 ant messages create \
11831184 --model claude-opus-5-5 \
11841185 --max-tokens 4096 \
11851186 --message '{role: user, content: Write a file with a random number and save it to "/tmp/number.txt"}' \
1186 --tool '{type: code_execution_20250825, name: code_execution}' \
1187 --transform container.id --raw-output)
1187 --tool '{type: code_execution_20250825, name: code_execution}'
11881188 
11891189 # Second request: Reuse the container to read the file
1190 # CONTAINER_ID is the container.id from the first response
11901191 ant messages create \
11911192 --container "$CONTAINER_ID" \
11921193 --model claude-opus-5-5 \
Feedback