Bash tool execution timeout needs to be configurable
Status Fixed / completed
Maintainer reply ✓ Yes — bcherny
Activity 10 comments · opened May 3, 2025 · closed May 3, 2025
💡 Likely answer: A maintainer (bcherny, collaborator)
responded on this thread — see the highlighted reply below.
I use Claude Code with my Java/Spring project. When running mvn clean package, it may take more than 2 minutes. Therefore, this command causes a timeout issue. I think the execution timeout for Bash tools needs to be configurable.
10 Comments
Just hit this too. When running complex integration tests, 2 mins is far too short. I guess this is a new feature because I don't recall it being an issue before.
+1
But this needs to be thought thoroughly.
You do not want to put it on 10+ minutes and for non-relevant tasks be stucked in a bug-loop. The AI should understand the command and then use the right timeouts
The timeout is already configurable -- just as claude to use a longer timeout.
That's a neat trick but it seems like a new kind of UI discoverability problem. How are we supposed to realize this? It would be good if the error message tells the user that Claude controls the timeout.
@bcherny Agree with @mikehearn. We use claude code primarily in CI, and it would be nice to be able to configure that timeout in a deterministic way, as I'm not sure if I trust Claude to follow that instruction reliably. Not a huge deal but could be nice. Even if it started as an undocumented hacky env var flag.
In https://github.com/anthropics/claude-code/issues/958 I suggested that Claude be sent the output from a command every minute or so, and it should be able to decide then whether to let it continue or not. So as long as your command is emitting progress events to the console Claude will know to let it keep running. If it's hung in a "obviously hung" kinda way, Claude can request termination.
And the suggestion seems to have been accepted! So I think that'll be a nice default for most tasks where you don't have to configure timeouts verbally or otherwise.
@mikehearn interesting, though to be honest one of the things I'm using Claude Code in CI for is very big Typescript refactors where I ask it to run typechecking after each change to validate its work. Typescript emits nothing until the very end, so that might not work so well there.
I'm actually not even sure asking claude to follow the timeout works?
!Image
@bcherny Can you re-open this issue?
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.