Feature Request: Add skills parameter to Task tool for dynamic skill injection at spawn time

Resolved 💬 3 comments Opened Feb 26, 2026 by codeisme621 Closed Mar 3, 2026

Feature Request

Problem

When spawning subagents via the Task tool, there is no way to dynamically attach skills at spawn time. Currently, skills can only be statically defined in subagent frontmatter files (.claude/agents/*.md).

This means if you want the same subagent type to load different skills depending on context, you must either:

  1. Create separate subagent .md files for each skill combination
  2. Embed the skill content manually in the prompt parameter (loses the benefits of the skill system)

Proposed Solution

Add an optional skills parameter to the Task tool, similar to the skills frontmatter field in custom subagent definitions:

Task(
  subagent_type="general-purpose",
  description="Validate spec plan",
  skills=["spec-validate", "remotion-best-practices"],
  prompt="Validate the mainspec at specs/my-feature/mainspec.md..."
)

The skills would be injected into the subagent's context at startup, exactly as they are when defined in subagent frontmatter.

Use Case

Multi-agent orchestration patterns (fan-out/fan-in) where an orchestrator skill spawns multiple subagents that each need domain knowledge from existing skills. For example:

  • An orchestrator spawns 3 parallel validators, each needing the spec-validate skill plus a domain expert skill
  • An orchestrator spawns researchers that need the spec-planning skill conventions
  • A generic multi-agent wrapper that works with any skill by passing the skill name dynamically

Without this, users must create a separate .claude/agents/*.md file for every skill combination, which doesn't scale when skills are composed dynamically.

Current Workarounds

  1. Static subagent files — Create a .claude/agents/my-agent.md with skills: [...] in frontmatter. Works but requires a file per skill combination.
  2. Prompt embedding — Read the skill content and paste it into the prompt parameter. Works but bypasses the skill system entirely.

Additional Context

The Task tool currently accepts: prompt, description, subagent_type, and model. Adding skills would align the Task tool's capabilities with the subagent frontmatter's skills field, making dynamic orchestration patterns first-class.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗