Plugins: deferred tools (AskUserQuestion) unavailable in skill context — need preload-tools frontmatter
Problem
Plugin skills that need AskUserQuestion (or other deferred tools) cannot reliably use them. The tool schema is not loaded in the skill's execution context, causing either "tool not available" errors or silent empty-response failures.
Current behavior
AskUserQuestionis a deferred tool — its schema isn't in context by default.- Listing it in a skill's
allowed-toolsfrontmatter only grants permission; it does NOT pre-load the schema. - When a skill tries to call
AskUserQuestion, it fails because the schema isn't loaded. - Additionally, when
AskUserQuestionIS inallowed-tools, the permission system's early-return path bypassesrequiresUserInteraction(), causing silent empty answers (related: #29547).
Workarounds attempted
- ToolSearch pre-flight instruction in SKILL.md — Added "run ToolSearch with query select:AskUserQuestion" as step 0 in all interactive skills. Problem: the LLM executing the skill doesn't reliably follow this instruction. It's a prompt-level workaround with no enforcement.
- Removing AskUserQuestion from allowed-tools — Addresses the silent-failure bug from #29547, but doesn't solve the deferred-schema loading problem.
Neither workaround reliably ensures the tool is available when the skill runs.
Proposed solution
Add a preload-tools field to skill YAML frontmatter that guarantees deferred tool schemas are loaded into the skill's execution context before the skill runs:
---
name: my-plugin:config
description: Configure the plugin
allowed-tools: Read, Write, Edit, Bash
preload-tools: AskUserQuestion
---
When the skill is invoked, the runtime would load the schemas for all tools listed in preload-tools (via the same mechanism ToolSearch uses) before handing control to the LLM. This makes the tool reliably available without depending on the LLM following a prompt instruction.
Environment
- Claude Code CLI (latest)
- Plugin installed via
--plugin-dir/~/.claude/plugins/ - Skills with
context: fork - macOS (Darwin 25.2.0)
Impact
Any plugin that uses interactive prompts via AskUserQuestion is affected. This is a foundational capability for plugin skills that need user input (config wizards, setup flows, confirmation prompts).
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗