Parameters
A bash tool definition has two required fields, type and name, and the name must be bash. The tool is schema-less: you don't provide an input_schema, because the schema is built into Claude's model and can't be modified. The following table lists the input fields Claude sets when it calls the tool.
| Parameter | Required | Description |
|---|---|---|
command | Yes* | The bash command to run |
restart | No | Set to true to restart the bash session |
*Required unless using restart
To handle restart: true, kill the shell process, start a new one, and return a tool_result that confirms the restart. A restarted session starts clean: the working directory, environment variables, and any running processes are gone.
Run a command:
json
{
"command": "ls -la *.py"
}Restart the session:
json
{
"restart": true
}