View Source Anthropic.Tools.Bash (anthropic_community v0.5.0)
Builds the bash
server tool definition. Pass the result inside the :tools list to
Anthropic.Messages.create/2 — Claude runs shell commands server-side in a sandbox and
the result comes back as a %Anthropic.Messages.Content.BashCodeExecutionToolResult{}
block; no client-side execute/1 needed.
Examples
Anthropic.Messages.create(client,
model: "claude-opus-4-8",
max_tokens: 1024,
tools: [Anthropic.Tools.Bash.new()],
messages: [%{role: "user", content: "List the files in the current directory."}]
)
Summary
Functions
Options
:version(String.t/0) - The tool's versionedtypestring. Override to pin an older API version. The default value is"bash_20250124".
Functions
Options
:version(String.t/0) - The tool's versionedtypestring. Override to pin an older API version. The default value is"bash_20250124".:cache_control(map/0) - AnAnthropic.CacheControlmap.