[BUG] [-p / print mode] AskUserQuestion tool was available in 2.1.185 but removed in later versions — please make it opt-in instead of hard-disabling

Status Fixed / completed
Reported on v2.1.185
Maintainer reply None cached
Activity 1 comment · opened Jul 16, 2026 · closed Aug 17, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Summary

The AskUserQuestion tool was available under claude -p (non-interactive / print mode) in v2.1.185, but has been disabled/removed in later versions. This is a breaking change for headless / CI workflows that depend on it.

We would like the ability to opt back in via a flag or setting, rather than having the tool hard-disabled in -p mode.

### Environment

  • Last known working version: 2.1.185
  • Broken since: some version after 2.1.185 (please confirm exact commit / release)
  • Mode: claude -p (non-interactive / print mode)
  • OS: Linux

### Reproduction

```bash
# Works in 2.1.185
npx @anthropic-ai/claude-code@2.1.185 -p "please call AskUserQuestion with two options"
# → AskUserQuestion is listed as an available tool, model can call it

# Broken in latest
npx @anthropic-ai/claude-code@latest -p "please call AskUserQuestion with two options"
# → AskUserQuestion is NOT present in the tool list; model cannot call it
```

### Why this matters

We use -p mode as the execution engine for automated pipelines where the model still needs to route a decision back to an external system (another service, a chat bot, an upstream job that supplies the answer, a human-in-the-loop
reviewer, etc.).

In our setup, AskUserQuestion is intercepted by a hook / MCP layer that supplies the answer from that external source — the "user" doesn't have to be a live terminal. Removing the tool entirely breaks this pattern and there is no
drop-in replacement.

What Should Happen?

Expected behavior

AskUserQuestion should remain callable in -p mode, gated by an explicit opt-in so users who don't want it are unaffected. For example:

  • A CLI flag: --enable-ask-user-question (or the more general --allowed-tools AskUserQuestion)
  • A settings.json field, e.g.

``json
{
"nonInteractive": {
"allowAskUserQuestion": true
}
}
``

  • Or: honor AskUserQuestion if a corresponding hook / MCP handler is registered to answer it, and only disable it when nothing is listening.

### Current workaround

  • Pin to @anthropic-ai/claude-code@2.1.185.
  • Re-implement the semantics as a custom MCP tool.

Both are workable but the version pin blocks us from upgrading, and the MCP re-implementation duplicates functionality that already exists in the harness.

### Proposal

Please do not hard-disable interactive-only tools in -p mode. Instead:

  1. Keep the safe default (disabled in -p) — no behavior change for most users.
  2. Add an explicit opt-in (flag / settings key) so headless workflows that have a way to answer the question can re-enable it.
  3. Ideally, document the recommended pattern for "the answerer is not a human terminal" (hook / MCP intercept).

Thanks!

Error Messages/Logs

{"type":"system","subtype":"init","cwd":"/super-preview/node_modules/.bin","session_id":"ff8ff305-e0f0-435b-a3a2-3e54c030db72","tools":["Task","Bash","CronCreate","CronDelete","CronList","DesignSync","Edit","EnterWorktree","ExitWorktree","NotebookEdit","Read","ReportFindings","ScheduleWakeup","SendMessage","Skill","TaskCreate","TaskGet","TaskList","TaskOutput","TaskStop","TaskUpdate","ToolSearch","WebFetch","WebSearch","Workflow","Write"],"mcp_servers":[],"model":"claude-opus-4-7[1m]","permissionMode":"bypassPermissions","slash_commands":["deep-research","design-sync","dataviz","update-config","verify","debug","code-review","simplify","batch","fewer-permission-prompts","loop","claude-api","run","run-skill-generator","agents","clear","compact","config","context","heapdump","init","__remote-workflow","reload-skills","review","security-review","usage","insights","recap","goal","design","design-consent","design-revoke","team-onboarding"],"apiKeySource":"none","claude_code_version":"2.1.204","output_style":"default","agents":[],"skills":["deep-research","design-sync","dataviz","update-config","verify","debug","code-review","simplify","batch","fewer-permission-prompts","loop","claude-api","run","run-skill-generator"],"plugins":[],"analytics_disabled":false,"product_feedback_disabled":false,"uuid":"","fast_mode_state":"off"}

Steps to Reproduce

export IS_SANDBOX=1 && ./claude "hello" --output-format stream-json --verbose --max-turns 1


"tools": [
"Task",
"Bash",
"CronCreate",
"CronDelete",
"CronList",
"DesignSync",
"Edit",
"EnterWorktree",
"ExitWorktree",
"NotebookEdit",
"Read",
"ReportFindings",
"ScheduleWakeup",
"SendMessage",
"Skill",
"TaskCreate",
"TaskGet",
"TaskList",
"TaskOutput",
"TaskStop",
"TaskUpdate",
"ToolSearch",
"WebFetch",
"WebSearch",
"Workflow",
"Write"]

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.185

Claude Code Version

2.1.204

Platform

Other

Operating System

Other Linux

Terminal/Shell

Non-interactive/CI environment

Additional Information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗