# BASH_MAX_TIMEOUT_MS

> It sets the longest time Claude may ask a command to run.

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

## Think of it like

It is like the latest time you may stay out. You can ask, but not past it.

## Definition

BASH_MAX_TIMEOUT_MS sets the longest time Claude may ask for when it runs a shell command. The value is in milliseconds. The default is 600,000, which is 10 minutes. The real top is whichever is larger, this or the default timeout.

## Example

Jack's full build takes 20 minutes. He raises the top to 30 minutes, so Claude can ask for enough time on that one command.

## Example code

```bash
export BASH_MAX_TIMEOUT_MS=1800000
claude
```

Let Claude ask for up to 30 minutes.

## Why it matters

Most commands stay short, while the few long ones can still finish when Claude asks.

## Common mistake

Raising only this and expecting every command to get longer. Claude has to ask. The default stays as it is.

## Three principles

- **The top.** Claude can ask up to it.
- **Default 10 minutes.** 600,000.
- **Larger of the two.** This or the default.

## Related terms

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

## 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-max-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.
