LIVE
Google Introduces "Gemini 4 Carbon" as Next Step in Its Model Lineup28/10/26 · Google|DeepMind unveils Genie 4, a new generation of world model27/10/26 · Google DeepMind|Anthropic files IPO prospectus, with risk disclosures taking center stage26/10/26 · Anthropic|Robot policy trained only in simulation matches top real-world systems26/10/26|OpenAI unveils GPT-6.1 Terra, a model built for computer use26/10/26 · OpenAI|Google's AI gives evasive answers about who won the 2020 US election28/10/26 · Google|NVIDIA introduces Nemotron 3.5 Transcribe, a promptable multilingual transcription model28/10/26 · NVIDIA|OpenAI and ServiceNow deepen partnership on enterprise workflows28/10/26 · OpenAI|Failed startups' data finds a second life training AI models28/10/26|Anthropic expands AI for Science program to 20 foundations and research institutions28/10/26 · Anthropic|Anthropic shares early results on using Claude to accelerate drug development27/10/26 · Anthropic|GEPA-Curator: Filtering Failures to Better Train LLM Agents27/10/26|Google Introduces "Gemini 4 Carbon" as Next Step in Its Model Lineup28/10/26 · Google|DeepMind unveils Genie 4, a new generation of world model27/10/26 · Google DeepMind|Anthropic files IPO prospectus, with risk disclosures taking center stage26/10/26 · Anthropic|Robot policy trained only in simulation matches top real-world systems26/10/26|OpenAI unveils GPT-6.1 Terra, a model built for computer use26/10/26 · OpenAI|Google's AI gives evasive answers about who won the 2020 US election28/10/26 · Google|NVIDIA introduces Nemotron 3.5 Transcribe, a promptable multilingual transcription model28/10/26 · NVIDIA|OpenAI and ServiceNow deepen partnership on enterprise workflows28/10/26 · OpenAI|Failed startups' data finds a second life training AI models28/10/26|Anthropic expands AI for Science program to 20 foundations and research institutions28/10/26 · Anthropic|Anthropic shares early results on using Claude to accelerate drug development27/10/26 · Anthropic|GEPA-Curator: Filtering Failures to Better Train LLM Agents27/10/26|
Toolofficial publisher

code_execution (Anthropic)

Tool : A precise action the AI can call · requires anthropic-api

Runs Python and bash in an Anthropic sandbox, with a file editor.

Ideal for data analysis; code execution means it should be treated as a risk even in a sandbox.

Overall score
6.9 /10
Security: one caveat, see the card
Utility
8.0
Reliability
6.0
Security
One caveat
Ease
5 min · Comfortable

Security reflects where data goes, requested permissions and incidents on record at the verification date. It is not a guarantee of zero risk: check the deployment mode and the connections you enable.

What it does, concretely

Many analysis or calculation tasks go beyond what a language model can reliably handle through reasoning alone: statistics on large files, visualizations, simulations, structured data processing. Anthropic's code_execution tool addresses this need by allowing Claude to run code directly during a conversation, without you having to manage the execution environment yourself.

In practice, the tool is added to an API request and gives Claude access to two sub-tools: Bash command execution and a file editor. Claude writes Python or shell commands, runs them in an isolated server-side container, retrieves the results, and incorporates them into its response. You can send your own files via the Files API (CSV, Excel, JSON, images, text) and retrieve files produced by Claude, such as charts or reports.

This tool is aimed at developers and technical teams building applications via the Anthropic API who need to automate data analysis, complex calculations, or file generation. It also suits those who want to delegate file processing tasks to Claude without exposing their own infrastructure.

However, it is not suited to users looking for a ready-to-use graphical interface: access is through the API only. It is also not appropriate for cases requiring internet access from the container, as it is network-isolated and cannot download additional packages at runtime.

What it offers

  • ·Bash command execution in a secure server-side container, without any action required on your part.
  • ·Built-in file editor allowing Claude to create, read, and modify files, including source code.
  • ·Support for files uploaded via the Files API: CSV, Excel, JSON, XML, images, text files.
  • ·Retrieval of generated files (charts, reports, etc.) via the Files API after execution.
  • ·Container reuse across multiple requests by passing the container ID, with Python state persistence between calls (versions code_execution_20260120 and later).
  • ·Free execution when the tool is used alongside the web_search or web_fetch tools (beyond standard token costs).
  • ·Automatic C2PA signing of image, video, and audio files produced in the sandbox, enabling origin verification.
  • ·Dynamic filtering of web search results directly within the execution environment, at no additional code execution cost.

In practice

Price
Freemium
Commercial use
Commercial use: yes
Available on
api
Host
anthropic-api
FR interface
No

Security and data

Rating
Security: one caveat, see the card
Capabilities
readswritesexecutesnetwork
Your data
Data with the vendor
Maintenance
Active

Links and repository checked on 25 October 2026 · added on 1 May 2025

How to install code_execution (Anthropic)

1. Obtain an API key at platform.claude.com and install the Anthropic SDK for your language (Python, TypeScript, etc.). 2. Add the tool to your API request with the type field set to the desired version (for example: code_execution_20250825) and name fixed to code_execution. 3. To send your own files, upload them first via the Files API and reference their ID in a container_upload block in your message. 4. Retrieve files produced by Claude by extracting the file_id entries from the result blocks, then download them via the Files API. 5. To reuse the same container across multiple requests, pass the container ID returned in the response via the container parameter of the next request. 6. Precaution: the container is isolated from your machine and the network, but treat any executed code as a sensitive operation and review generated files before using them in production.
tools=[{"type":"code_execution_20260120","name":"code_execution"}]

Official documentation ↗

In the same category

Whole category Feed (memory, context) →