## Compatibility
The whole hunk
from line 2, old and new numbered
/
lines
from line 2
22title: Code execution tool
33url: https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool
44description: Run Python and bash code in a sandboxed container to analyze data, generate files, and iterate on solutions.
5featureMetadata:
6 status: ga
7 zdr: not-eligible
8 supportedModels:
9 - claude-fable-5-1
10 - claude-mythos-5-1
11 - claude-fable-5
12 - claude-mythos-5
13 - claude-opus-5
14 - claude-opus-4-8
15 - claude-opus-4-7
16 - claude-opus-4-6
17 - claude-opus-4-5-20251101
18 - claude-sonnet-5
19 - claude-sonnet-4-6
20 - claude-sonnet-4-5-20250929
21 - claude-haiku-4-5-20251001
22 supportedPlatforms:
23 Claude API: ga
24 Claude Platform on AWS: ga
25 Amazon Bedrock: not available
26 Google Cloud: not available
27 Microsoft Foundry:
28 availability: ga
29 note: On [Microsoft Foundry](https://platform.claude.com/docs/en/build-with-claude/claude-in-microsoft-foundry), code execution requires a [Hosted on Anthropic deployment](https://platform.claude.com/docs/en/build-with-claude/claude-in-microsoft-foundry#additional-features-not-supported-when-hosted-on-azure).
30 details:
31 - Every supported model accepts all three [tool versions](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool#tool-versions). On Claude Haiku 4.5, programmatic tool calling and REPL state persistence aren't available, so the newer versions behave like `code_execution_20250825` there.
32 - For [Claude Mythos Preview](https://anthropic.com/glasswing), code execution is supported on the Claude API and Microsoft Foundry.
533---
6
7## Compatibility
8- [ZDR](https://platform.claude.com/docs/en/manage-claude/api-and-data-retention): not eligible
9- Supported models: `claude-fable-5-1`, `claude-mythos-5-1`, `claude-fable-5`, `claude-mythos-5`, `claude-opus-5`, `claude-opus-4-8`, `claude-opus-4-7`, `claude-opus-4-6`, `claude-opus-4-5-20251101`, `claude-sonnet-5`, `claude-sonnet-4-6`, `claude-sonnet-4-5-20250929`, `claude-haiku-4-5-20251001`
10- Platforms: Claude API, Claude Platform on AWS, Microsoft Foundry [1]; not available on Amazon Bedrock, Google Cloud
11- Every supported model accepts all three [tool versions](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool#tool-versions). On Claude Haiku 4.5, programmatic tool calling and REPL state persistence aren't available, so the newer versions behave like `code_execution_20250825` there.
12- For [Claude Mythos Preview](https://anthropic.com/glasswing), code execution is supported on the Claude API and Microsoft Foundry.
131. On [Microsoft Foundry](https://platform.claude.com/docs/en/build-with-claude/claude-in-microsoft-foundry), code execution requires a [Hosted on Anthropic deployment](https://platform.claude.com/docs/en/build-with-claude/claude-in-microsoft-foundry#additional-features-not-supported-when-hosted-on-azure).
1434
1535Claude can analyze data, create visualizations, perform complex calculations, run system commands, create and edit files, and process uploaded files directly within the API conversation. The code execution tool allows Claude to run Bash commands and manipulate files, including writing code, in a secure, sandboxed environment.
1636