claude-code - 💡(How to fix) Fix [DOCS] Bash timeout limit missing from tool and SDK references [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48861Fetched 2026-04-16 06:48:56
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×4
RAW_BUFFERClick to expand / collapse

Documentation Type

Missing documentation (feature not documented)

Documentation Location

https://code.claude.com/docs/en/tools-reference

Section/Topic

Bash tool behavior and the Bash input schema references in the SDK and hooks docs

Current Documentation

The current Bash tool reference says:

The Bash tool runs each command in a separate process with the following persistence behavior:

  • When Claude runs cd in the main session, the new working directory carries over to later Bash commands...
  • Environment variables do not persist. An export in one command will not be available in the next.

The env vars page separately says:

BASH_DEFAULT_TIMEOUT_MS | Default timeout for long-running bash commands (default: 120000, or 2 minutes)

BASH_MAX_TIMEOUT_MS | Maximum timeout the model can set for long-running bash commands (default: 600000, or 10 minutes)

The Python SDK Bash input documents the limit explicitly:

"timeout": int | None, # Optional timeout in milliseconds (max 600000)

But the TypeScript SDK Bash input omits that limit:

type BashInput = { command: string; timeout?: number; description?: string; run_in_background?: boolean; };

And the hooks docs omit it too:

| timeout | number | 120000 | Optional timeout in milliseconds |

What's Wrong or Missing?

Claude Code v2.1.110 changed Bash timeout handling so the tool now enforces the documented maximum timeout instead of accepting arbitrarily large values.

The problem is that this maximum is not documented in the places where users actually look up Bash tool inputs. The main Bash tool reference does not explain the timeout limit at all, and the TypeScript SDK and hooks Bash schemas show a timeout field without telling users that Bash timeouts are capped.

That leaves the limit documented only indirectly on the env vars page and in the Python SDK, which is easy to miss and creates inconsistent expectations across Claude Code interfaces.

Suggested Improvement

Add one canonical explanation of Bash timeout behavior to the Bash tool docs, then cross-reference it from the SDK and hooks pages.

Suggested minimum content:

  • Document that Bash timeout values are in milliseconds.
  • Document the default timeout (BASH_DEFAULT_TIMEOUT_MS, 120000 by default).
  • Document the maximum timeout (BASH_MAX_TIMEOUT_MS, 600000 by default).
  • Document what Claude Code does when a caller supplies a value above the maximum, since v2.1.110 now enforces that limit.

Then update the Bash input tables/snippets in the TypeScript SDK, hooks, and related input-schema docs so they mention the cap instead of showing an unconstrained timeout field.

Impact

Medium - Makes feature difficult to understand

Additional Context

Affected Pages:

PageContext
https://code.claude.com/docs/en/tools-referenceCanonical Bash tool behavior page; currently explains shell persistence but not timeout limits
https://code.claude.com/docs/en/env-varsDocuments BASH_DEFAULT_TIMEOUT_MS and BASH_MAX_TIMEOUT_MS
https://code.claude.com/docs/en/agent-sdk/pythonPython Bash input documents max 600000
https://code.claude.com/docs/en/agent-sdk/typescriptTypeScript BashInput shows timeout?: number without the cap
https://code.claude.com/docs/en/hooksBash tool schema lists timeout in milliseconds but does not mention the maximum
https://code.claude.com/docs/en/agent-sdk/user-inputLists Bash input fields but does not surface the timeout constraint

Total scope: 6 pages affected

Source: Changelog v2.1.110

Exact changelog entry:

Bash tool now enforces the documented maximum timeout instead of accepting arbitrarily large values

extent analysis

TL;DR

Update the Bash tool documentation to include the maximum timeout limit and cross-reference it from the SDK and hooks pages to ensure consistent information across all interfaces.

Guidance

  • Add a section to the Bash tool documentation explaining the timeout behavior, including the default and maximum timeout values, and what happens when a caller supplies a value above the maximum.
  • Update the TypeScript SDK and hooks documentation to mention the maximum timeout cap for the timeout field.
  • Cross-reference the updated Bash tool documentation from the SDK and hooks pages to ensure consistency.
  • Review the affected pages (listed in the Additional Context section) to ensure the changes are applied correctly.

Example

The updated Bash tool documentation could include a section like:

### Timeout Behavior
The Bash tool has a default timeout of 120000 milliseconds (2 minutes) and a maximum timeout of 600000 milliseconds (10 minutes). If a caller supplies a timeout value above the maximum, it will be capped at the maximum value.

Notes

The changes should be applied to the 6 affected pages listed in the Additional Context section to ensure consistency across all interfaces.

Recommendation

Apply the workaround by updating the documentation to include the maximum timeout limit and cross-referencing it from the SDK and hooks pages, as this will provide consistent information to users and clarify the Bash timeout behavior.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING