Custom timeout lengths for specific commands
In the .claude/settings[.local].json we can set permissions for allowing or denying all kinds of commands. It would be great if we could also specify custom timeouts for single commands.
For example if Claude Code runs npm start actively, without running it in the background. This starts the frontend dev server. The command never finishes and needs to time out until Claude Code continues. In this case npm start should time out after 30 seconds.
If Claude runs npm test however it should absolutely not time out after 30 seconds. A comprehensive test-suite could take well 30 minutes. The commands must definitely have enough time to run.
I know that I can override the timeout length for bash commands via the env vars BASH_DEFAULT_TIMEOUT_MS and BASH_MAX_TIMEOUT_MS but these apply to all commands. If I set the timeout very high, Claude Code will wait 30 minutes for npm start to timeout. Unfortunately it's using the "max timeout" unreliably so even with specific prompting it's hard to differentiate.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗