Follow Discord
Sweep 27 Oct 2026 · 19:04Z Build v2.1.312 531 read Stable v2.1.308 Latest v2.1.312 Next v2.1.312 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.310, published 11 hours 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+13added
Lines−13removed
From line 938 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits25to this page, all time

The whole hunk

from line 938, old and new numbered
/
lines
from line 938
938938 
939939### Bash command response
940940 
941```text Output
941```json Output
942942{
943943 "type": "server_tool_use",
944944 "id": "srvtoolu_01B3C4D5E6F7G8H9I0J1K2L3",
from line 964
964964 
965965**View file:**
966966 
967```text Output wrap
967```json Output
968968{
969969 "type": "server_tool_use",
970970 "id": "srvtoolu_01C4D5E6F7G8H9I0J1K2L3M4",
from line 990
990990 
991991**Create file:**
992992 
993```text Output wrap
993```json Output
994994{
995995 "type": "server_tool_use",
996996 "id": "srvtoolu_01D5E6F7G8H9I0J1K2L3M4N5",
from line 1013
10131013 
10141014**Edit file (str\_replace):**
10151015 
1016```text Output wrap
1016```json Output
10171017{
10181018 "type": "server_tool_use",
10191019 "id": "srvtoolu_01E6F7G8H9I0J1K2L3M4N5O6",
from line 1060
10601060 
10611061**Common errors (all tools):**
10621062 
1063```text Output wrap
1063```json Output
10641064{
10651065 "type": "bash_code_execution_tool_result",
10661066 "tool_use_id": "srvtoolu_01VfmxgZ46TiHbmXgy928hQR",
from line 1100
11001100 
11011101### Resource limits
11021102 
1103* **Memory:** 5 GiB RAM
1104* **Disk space:** 5 GiB workspace storage
1105* **CPU:** 1 CPU
1106* **Execution time:** A tool call that runs past the maximum execution time returns an `execution_time_exceeded` [error](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool#errors). With [programmatic tool calling](https://platform.claude.com/docs/en/agents-and-tools/tool-use/programmatic-tool-calling), each REPL cell also has a 90-second wall-clock limit
1103* **Memory:** The container has 5 GiB of RAM.
1104* **Disk space:** The container has 5 GiB of workspace storage.
1105* **CPU:** The container has 1 CPU.
1106* **Execution time:** A tool call that runs past the maximum execution time returns an `execution_time_exceeded` [error](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool#errors). With [programmatic tool calling](https://platform.claude.com/docs/en/agents-and-tools/tool-use/programmatic-tool-calling), each REPL cell also has a 90-second wall-clock limit.
11071107 
11081108### Networking and security
11091109 
from line 1111
11111111* **External connections:** No outbound network requests allowed
11121112* **Sandbox isolation:** Full isolation from host system and other containers
11131113* **File access:** Limited to workspace directory only
1114* **Workspace scoping:** Like the [Files API](https://platform.claude.com/docs/en/build-with-claude/files), containers are scoped to the request's workspace
1115* **Expiration:** Containers expire 30 days after creation
1114* **Workspace scoping:** Scoped to the request's workspace, like the [Files API](https://platform.claude.com/docs/en/build-with-claude/files)
1115* **Expiration:** 30 days after creation
11161116 
11171117### Pre-installed libraries
11181118 
from line 1443
14431443 
14441444With [streaming](https://platform.claude.com/docs/en/build-with-claude/streaming) enabled (`"stream": true`), you'll receive code execution events as they occur. The sub-tool input streams as `input_json_delta` events, and each result block arrives whole in a single `content_block_start` event:
14451445 
1446```text
1446```sse
14471447event: content_block_start
14481448data: {"type": "content_block_start", "index": 1, "content_block": {"type": "server_tool_use", "id": "srvtoolu_xyz789", "name": "bash_code_execution"}}
14491449 
from line 1475
14751475 
14761476Code execution usage is tracked in the response:
14771477 
1478```text wrap
1478```json
14791479{
14801480 "usage": {
14811481 "input_tokens": 105,
Feedback