BashTool
Executes a shell command and returns its stdout, stderr, and exit code. Supports long-running commands, pipeline expressions, and any program available in yourPATH.
Parameters
The bash command to execute.
Maximum time to wait for the command to complete, in milliseconds. Defaults to
120000 (2 minutes). The maximum allowed value is configurable per deployment.A brief human-readable description of what the command does (e.g.
"Install npm dependencies"). Shown in the UI while the command runs.Absolute path to the directory in which to run the command. Defaults to the current working directory of the session.
Returns
The combined stdout and stderr output of the command, truncated if it exceeds the result size limit.Example
Running tests in a specific directory:Each BashTool invocation runs in a fresh shell. Environment variables,
cd changes, and shell functions do not persist between calls. To run a command in a specific directory, use the workdir parameter rather than cd && command.PowerShellTool
Executes a PowerShell command on Windows. Available only on Windows platforms.Parameters
The PowerShell command or script to execute.
Maximum time to wait for the command to complete, in milliseconds. Defaults to
120000 (2 minutes).A brief human-readable description of what the command does.
Absolute path to the directory in which to run the command. Defaults to the current working directory of the session.
Returns
The combined output of the PowerShell command.Example
Listing processes matching a name:PowerShellTool is only available when Claude Code is running on Windows. On macOS and Linux, use BashTool instead.