claude-code - 💡(How to fix) Fix Plugins: deferred tools (AskUserQuestion) unavailable in skill context — need preload-tools frontmatter [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48081Fetched 2026-04-15 06:33:46
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1

Root Cause

  1. AskUserQuestion is a deferred tool — its schema isn't in context by default.
  2. Listing it in a skill's allowed-tools frontmatter only grants permission; it does NOT pre-load the schema.
  3. When a skill tries to call AskUserQuestion, it fails because the schema isn't loaded.
  4. Additionally, when AskUserQuestion IS in allowed-tools, the permission system's early-return path bypasses requiresUserInteraction(), causing silent empty answers (related: #29547).

Fix Action

Fix / Workaround

Workarounds attempted

  1. 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.

Neither workaround reliably ensures the tool is available when the skill runs.

Code Example

---
name: my-plugin:config
description: Configure the plugin
allowed-tools: Read, Write, Edit, Bash
preload-tools: AskUserQuestion
---
RAW_BUFFERClick to expand / collapse

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

  1. AskUserQuestion is a deferred tool — its schema isn't in context by default.
  2. Listing it in a skill's allowed-tools frontmatter only grants permission; it does NOT pre-load the schema.
  3. When a skill tries to call AskUserQuestion, it fails because the schema isn't loaded.
  4. Additionally, when AskUserQuestion IS in allowed-tools, the permission system's early-return path bypasses requiresUserInteraction(), causing silent empty answers (related: #29547).

Workarounds attempted

  1. 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.

  2. 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).

extent analysis

TL;DR

Adding a preload-tools field to the skill YAML frontmatter to guarantee deferred tool schemas are loaded into the skill's execution context may resolve the issue.

Guidance

  • Verify that the proposed solution of adding a preload-tools field to the skill YAML frontmatter is implemented correctly, ensuring that the AskUserQuestion tool schema is loaded before the skill runs.
  • Test the skill with the updated frontmatter to confirm that the AskUserQuestion tool is reliably available and functional.
  • Consider the potential impact on other skills that use deferred tools and ensure that the preload-tools field is applied consistently across all affected skills.
  • Review the implementation to ensure that it does not introduce any security vulnerabilities or performance issues.

Example

---
name: my-plugin:config
description: Configure the plugin
allowed-tools: Read, Write, Edit, Bash
preload-tools: AskUserQuestion
---

This example demonstrates how to add the preload-tools field to the skill YAML frontmatter to preload the AskUserQuestion tool schema.

Notes

The proposed solution assumes that the preload-tools field is properly handled by the runtime and that the tool schemas are correctly loaded into the skill's execution context. Additional testing and verification may be necessary to ensure that the solution works as expected in all scenarios.

Recommendation

Apply the workaround by adding the preload-tools field to the skill YAML frontmatter, as it appears to be the most promising solution to ensure that deferred tool schemas are loaded into the skill's execution context. This approach provides a more reliable and consistent way to make the AskUserQuestion tool available to skills that require it.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING