# BASH_DEFAULT_TIMEOUT_MS

> It sets how long a command runs before it is stopped.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** BASH_DEFAULT_TIMEOUT_MS environment variable

## Think of it like

It is like a kitchen timer. It rings if a dish takes too long.

## Definition

BASH_DEFAULT_TIMEOUT_MS sets how long a shell command may run before Claude Code stops it, when Claude does not ask for a time. The value is in milliseconds. The default is 120,000, which is 2 minutes. It covers PowerShell commands too.

## Example

Lucy's test suite takes 4 minutes, and it kept being stopped at 2. She sets the default to 5 minutes, and the tests finish.

## Example code

```bash
export BASH_DEFAULT_TIMEOUT_MS=300000
claude
```

Give commands 5 minutes by default.

## Why it matters

Slow builds and tests get cut off for no reason when the timer is too short.

## Common mistake

Writing seconds. 300 means 0.3 seconds here. Write 300000 for 5 minutes.

## Three principles

- **Milliseconds.** Not seconds.
- **Default 2 minutes.** 120,000.
- **When Claude asks none.** The usual case.

## Related terms

- [Bash Tool](https://learn.benibix.com/term/ai/bash-tool)
- [BASH_MAX_TIMEOUT_MS](https://learn.benibix.com/term/ai/bash-max-timeout-ms-variable)

## Told apart from

- [BASH_DEFAULT_TIMEOUT_MS vs BASH_MAX_TIMEOUT_MS](https://learn.benibix.com/compare/bash-default-timeout-ms-variable-vs-bash-max-timeout-ms-variable): People think raising BASH_MAX_TIMEOUT_MS gives every command more time. It does not. BASH_DEFAULT_TIMEOUT_MS is the time a command gets when Claude asks for none, 2 minutes unless you change it. BASH_MAX_TIMEOUT_MS is the most Claude may ask for, 10 minutes unless you change it. Raise the default when all your commands are slow, and the top when only a few are.

![A command stops at 2 minutes unless Claude asks for more, up to 10 minutes.](https://learn.benibix.com/diagrams/env-bash-timeouts.svg)

---

Source: https://learn.benibix.com/term/ai/bash-default-timeout-ms-variable
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
