skills: frontmatter field in custom agents does not inject skill content into subagent context
Status Fixed / completed
Maintainer reply ✓ Yes — claude[bot]
Workaround ✓ Mentioned in thread ↓
Activity 6 comments · opened Apr 10, 2026 · closed May 12, 2026
💡 Likely answer: A maintainer (claude[bot], contributor)
responded on this thread — see the highlighted reply below.
Description
The skills: frontmatter field in custom agent .md files does not inject skill content into the subagent's system prompt/context, despite documentation stating it should.
Steps to reproduce
- Create a skill at
~/.claude/skills/ui-ux-pro-max/SKILL.mdwith valid frontmatter:
---
name: ui-ux-pro-max
description: "UI/UX design intelligence..."
---
# UI/UX Pro Max - Design Intelligence
Comprehensive design guide for web and mobile applications...
- Create a custom agent at
~/.claude/agents/frontend.md:
---
name: frontend
description: "Frontend agent..."
tools: Read, Edit, Write, Bash, Grep, Glob
model: sonnet
maxTurns: 30
skills:
- ui-ux-pro-max
---
# Frontend Agent
You are a frontend agent with UI/UX skills.
- Spawn the agent via Agent tool with
subagent_type: "frontend"
- Ask the agent: "Do you see the content of skill ui-ux-pro-max in your context? Search for 'Comprehensive design guide'"
Expected behavior
Per documentation:
"The full content of each skill is injected into the subagent's context"
The subagent should have the full SKILL.md content in its system prompt.
Actual behavior
The subagent reports:
- No skill content found in context
- Only sees references to skill file paths from the agent's body text
Skilltool is not available to the subagent- Specific strings from SKILL.md ("Comprehensive design guide", "161 color palettes", "bento grid") are not present
Environment
- Claude Code: latest (as of 2026-04-10)
- OS: Ubuntu 24.04
- Model: opus (parent) → sonnet (subagent)
- Skill location:
~/.claude/skills/ui-ux-pro-max/SKILL.md - Agent location:
~/.claude/agents/frontend.md
6 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
This is not a duplicate of the suggested issues. Here's why:
~/.claude/skills/) + user-level agent (~/.claude/agents/) = no injection.context: forkand plugin-loaded skills being silently ignored. Our issue doesn't involve plugins orcontext: forkat all.Skilltool not being available to subagents. Related but different — we're reporting that theskills:frontmatter field doesn't inject content, not that a tool is missing.Our specific case
| Component | Location | Level |
|---|---|---|
| Agent |
~/.claude/agents/frontend.md| User || Skill |
~/.claude/skills/ui-ux-pro-max/SKILL.md| User || Working dir |
/home/denis| — |Verification method
skills: [ui-ux-pro-max]in frontmatterUNIQUE_TEST_STRING_PINEAPPLE_ROCKET_777— also not injectedKey difference from #25834
Issue #25834 author explicitly confirmed that project-level agent + project-level skill works. Our case uses user-level (
~/.claude/) for both agent and skill — and it does not work. This suggests the bug scope is wider than just plugins.Confirming this is still reproducible and adding context.
Our findings from parallel Agent dispatch workflows:
The root cause you identified (skill content not injected into subagent context) describes exactly what we observed. Additional observations:
skills:frontmatter to load a skill, the subagent that agent spawns does not receive that skill's content.skills:frontmatter is declarative injection, which should propagate to subagents automatically.This is critical for agent teams workflows where multiple specialized agents need shared skill context.
Affected path:
src/tools/AgentTool/runAgent.ts→ skill loading → subagent context injectionUpdate — cannot reproduce on Claude Code 2.1.139, please close as fixed
Re-ran the repro on a clean test today (2026-05-12) on
claude --version→ 2.1.139. Theskills:frontmatter injection now works as the sub-agents documentation describes.Test setup (sentinel-based, no original skill involved)
To rule out any false negative from
ui-ux-pro-maxbeing a large file, I built a minimal sentinel skill whose body contains strings that exist nowhere else on disk:~/.claude/skills/repro46311/SKILL.md:~/.claude/agents/repro46311.md:Result
Dispatching the subagent and asking it (without giving it disk access first) whether it sees the three sentinels in its system prompt:
SENTINEL_BODY_ALPHA_PAPAYA_8421→ YESSENTINEL_BODY_BETA_TURBINE_9907→ YESSENTINEL_BODY_GAMMA_OBSIDIAN_3315→ YES# Repro 46311 — Sentinel Skill→ YESCross-check against the original repro: a second subagent (
frontend) withskills: [ui-ux-pro-max]was also asked to find the string "Comprehensive design guide" fromui-ux-pro-max/SKILL.md— it is present in its context. So the original failure mode (body strings absent) does not reproduce either.Matches documented behavior
The sub-agents docs state:
That is exactly what we now observe. This is the inverse of how main-agent skills work (description-only in context, body loaded on
Skilltool invocation).Caveats worth documenting (not blocking close)
SKILL.mdis injected, not the rest of the skill folder.data/,references/,assets/are not preloaded — the subagent has toReadthem on demand. This may surprise users porting skills that rely on supporting files.description-only list main agents get) appears different from the main agent's. Not tested rigorously, just noting.Likely fix lineage
The changelog entry for v2.1.133 (2026-05-07) — "Fixed subagents not discovering project, user, or plugin skills via the Skill tool" — is about Skill-tool discovery, but it's the closest user-facing entry to this area and the behavior shift seems to have landed around the same window.
Ask
Since the reproduction no longer triggers on 2.1.139 and behavior now matches the docs, I'd suggest closing this as fixed. Happy to retest on whichever earlier version maintainers want pinned as the fix point if that's useful for the changelog.
Also marking the previously linked duplicates as worth a quick re-check:
This issue was fixed as of version v2.1.139.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.