AFK auto-continue on unanswered AskUserQuestion (`afkTimeoutMs`) is undocumented and has no opt-out
Environment
- Claude Code version: 2.1.198 (Homebrew native binary)
- OS: macOS (darwin 25.5.0)
- Install:
brew install --cask claude-code(/opt/homebrew/bin/claude)
Summary
As of a recent 2.1.x release, when Claude asks a question via AskUserQuestion and the user doesn't respond within ~60 seconds, the harness injects a synthetic user tool_result with empty answers and instructs the model to proceed without the answer. The model then continues working - including running tools - without the user's input.
This behavior is:
- Undocumented - it appears in no changelog entry, no settings/env reference, and no existing issue.
- Not opt-out-able - there is no boolean disable, and no
settings.jsonkey. It is only tunable via an undocumented environment variable (CLAUDE_AFK_TIMEOUT_MS) that a user cannot discover without reverse-engineering the bundle.
Expected behavior
When Claude asks the user a question, it waits for the user to answer (as in earlier versions). If an AFK/auto-continue timeout exists, it should be documented and have a first-class opt-out.
Actual behavior
~60s after an unanswered AskUserQuestion, a synthetic user tool_result is injected:
content: "No response after 60s - the user may be away from keyboard. Proceed using
your best judgment based on the context so far; you can re-ask this question
later if it's still relevant."
answers: {}
afkTimeoutMs: 60000
The model treats this as permission to proceed and continues acting without the user, who was simply thinking / reading and not "away from keyboard."
Reproduction
- On 2.1.198, get Claude into a flow where it calls
AskUserQuestion(e.g. a clarifying/scoping question with multiple options). - Do not answer for ~60 seconds.
- Observe: the countdown banner appears, then Claude proceeds on its own best guess and may start running tools - no answer was provided.
Findings (from the shipped bundle)
The timeout is env-var controlled, defaulting to 60000ms; it is not a settings.json key:
CLAUDE_AFK_TIMEOUT_MS- ms before auto-continue fires (default60000)CLAUDE_AFK_COUNTDOWN_MS- ms before the timeout that the "auto-continue in Ns" banner shows (default20000)
Auto-continue is suppressed when a screen reader is active or in background/daemon sessions, but there is no general boolean off-switch.
Requests
- Document
CLAUDE_AFK_TIMEOUT_MSandCLAUDE_AFK_COUNTDOWN_MS(and the AFK/auto-continue behavior itself) in the settings + environment-variable reference and the changelog entry for the release that introduced it. - Provide a first-class opt-out - e.g. a
settings.jsonkey (afkAutoContinue: falseor similar) or a documented sentinel value meaning "never auto-continue." - Fix the disable footgun: setting
CLAUDE_AFK_TIMEOUT_MS=0currently makes it fire immediately (0 is a valid int that overrides the default), so the only way to "disable" today is a very large integer (e.g.2147483647). A value of0(or-1) meaning "never" would match user expectations.
Related
- #13922 (configurable timeout for the idle_prompt notification hook - related but about notifications, not auto-continue)
- #22597 (auto-continue after user timeout - was closed as "not planned", yet the behavior now ships)
- #29733 / #29889 (AskUserQuestion returning empty answers without waiting - likely the same mechanism observed before it had the
afkTimeoutMsmarker)
Showing cached comments. Read the full discussion on GitHub ↗
3 Comments
See #73125
Independent confirmation from static analysis of the shipped 2.1.198 binary (macOS arm64,
/Users/.../claude, same install path shape as OP):2.1.198is2026-07-01T16:50:16Z, and the changelog entry for that release (background agent notifications) makes no mention of AFK/auto-continue — so this is confirmed to have shipped with zero changelog line, not just an omission in this issue's writeup.tengu_ask_user_question_afk_auto_advance, logged with fieldstimeoutMs,questionCount,hadPartialAnswers, andisInPlanMode. That last field matters: this doesn't only fire on read-only scoping questions, it fires on Plan Mode approval prompts too. Plan Mode's whole purpose is "pause until a human actually signs off before write/execute actions" — auto-advancing that on a timeout is a materially bigger deal than auto-advancing a clarifying question.afk-mode-2026-01-31. Dated Jan 31 2026, ~5 months before this reached stable — so this reads as a staged/gated rollout, not a rushed same-day addition, which makes the lack of a changelog entry more notable rather than less.Doesn't change the ask from the OP (document it, real opt-out, fix the
TIMEOUT_MS=0immediate-fire footgun) — just corroborating that this is a deliberate, telemetry-tracked feature rather than a bug/regression, which seems relevant for triage.Thank you for the precise write-up — this matches what I found grepping the 2.1.198 binary myself, down to
CLAUDE_AFK_TIMEOUT_MS/CLAUDE_AFK_COUNTDOWN_MSand the=0fires-immediately footgun. Strong +1 on all three asks.The bit that bothers me most is the one the comments here already nailed: this isn't a bug or a rushed accident. A
afk-mode-2026-01-31feature gate plus dedicated telemetry means it was a deliberate, staged decision to change a default users depend on — and it still shipped with no changelog entry and no opt-out. That it also fires on Plan Mode approval prompts makes it worse: the entire point of Plan Mode is "do not proceed until a human signs off."Obligatory https://xkcd.com/1172/. The usual reading of that comic is "every change breaks someone's workflow, so tread carefully" — and "a question waits for its answer" is about as fundamental an expectation as software has. Changing behavior this load-bearing should clear a very high bar, because each silent default-flip spends user trust, and there's been a visible run of these lately.
None of this is unfixable, and your three requests are exactly right: opt-in by default, a documented first-class opt-out, and make
0/-1mean "never." And please — just put it in the changelog next time. That alone would go a long way.