Skip to content

Bash

Executes shell commands in a persistent session.

Runtime Comparison

Aspect Claude Code Opencode
Tool name Bash bash
Shell Persistent bash session Persistent bash session
Timeout Default 2 min, max 10 min Configurable
Background execution run_in_background parameter Not supported
Working directory Maintained across calls Maintained across calls

From Anthropic's best practices: the agent has access to your shell environment. You can build convenience scripts and functions for it just like you would for yourself.

Bash is the primary tool layer. The agent inherits your complete shell environment: custom functions, aliases, and standard CLI tools (git, npm, docker) work natively.

Prefer specialized tools for file operations:

Instead of... Use
cat file.txt Read
echo "..." > file Write
sed -i 's/.../.../' Edit
grep -r "pattern" Grep
find . -name "*.ts" Glob