Model | Tool Version |
---|---|
Claude 4 & Sonnet 3.7 | bash_20250124 |
Claude Sonnet 3.5 | bash_20241022 |
computer-use-2024-10-22
beta header when using the bash tool.The bash tool is generally available in Claude 4 and Sonnet 3.7.Parameter | Required | Description |
---|---|---|
command | Yes* | The bash command to run |
restart | No | Set to true to restart the bash session |
restart
Example usage
Set up a bash environment
Handle command execution
Process Claude's tool calls
Implement safety measures
Command execution timeout
Command not found
Permission denied
Use command timeouts
Maintain session state
Handle large outputs
Log all commands
Sanitize outputs
ulimit
to set resource constraintssudo
, rm -rf
, etc.)pytest && coverage report
npm install && npm run build
git status && git add . && git commit -m "message"
wc -l *.csv && ls -lh *.csv
find . -name "*.py" | xargs grep "pattern"
tar -czf backup.tar.gz ./data
df -h && free -m
ps aux | grep python
export PATH=$PATH:/new/path && echo $PATH
vim
, less
, or password prompts