[FEATURE] Make the auto-mode permission classifier timeout configurable
Problem Statement
In auto permission mode, every tool call passes through the small-model safety classifier with hardcoded timeout budgets (observed in v2.1.258: 60 s base, scaled up with context size, ~120 s cap per stage, up to ~5 min including retries). When the classifier times out, the call fails closed — the model receives a "temporarily unavailable, retry later" denial, which stalls the agentic loop.
None of this is configurable: the CLAUDE_CODE_AUTO_MODE_* env vars expose the model, temperature, retry counts, etc., but no timeout; the server-side config gate likewise has no timeout field.
Two failure shapes in practice:
- High-latency / unstable network to the API: the fixed budget is either too short (repeated fail-closed denials with backoff) or needlessly long.
- Unattended runs (scheduled tasks, CI): a classifier outage wedges the session — see #85820 for permission requests wedging scheduled sessions with no timeout.
Proposed Solution
Expose the classifier timeout as a setting, e.g.:
settings.json:"permissions": { "autoModeClassifierTimeoutMs": ... }- or an env var like
CLAUDE_CODE_AUTO_MODE_TIMEOUT_MS
Ideally two knobs (overall budget + single-attempt timeout), with defaults unchanged from today's behavior.
Alternative Solutions
- Switch out of
automode (e.g.bypassPermissions/acceptEdits) — loses the safety property that motivated using auto mode in the first place. - Manually re-running blocked actions — not viable for unattended sessions.
Priority
Medium - Would be very helpful
Feature Category
Configuration and settings
Use Case Example
- I run Claude Code in
automode for overnight scheduled tasks on a machine with a high-latency route to the API. - The classifier occasionally exceeds its timeout budget and the tool call is denied fail-closed ("temporarily unavailable").
- With this feature, I could raise the budget to match my network conditions — or lower it so failures surface quickly and the run can fall back to a different permission strategy.
- Today there is no knob; the only options are retry-by-luck or abandoning auto mode entirely.
Additional Context
- Observed behavior (v2.1.258, from the installed binary): token-scaled deadline
min(120 s, 60 s + 10 s per 50k tokens above 50k)for the fast stage, fixed 120 s for the thinking stage, ~5 min overall retry ceiling; timeouts surface asautomode-unavailabledenials (fail-closed); read-only operations bypass the classifier. - Related: #69002 and #74311 (classifier model/effort configurability — the same gap for timeouts), #86339 (classifier timeout never firing), #86926 (distinguishing timeout from denied).
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)