claude-code - 💡(How to fix) Fix [DOCS] Surface plugin-subagent frontmatter limitations (hooks/mcpServers/permissionMode) in main reference, not just a buried Note [1 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#54921Fetched 2026-05-01 05:50:55
View on GitHub
Comments
0
Participants
1
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
labeled ×5closed ×1

Plugin sub-agents silently ignore the hooks, mcpServers, and permissionMode frontmatter fields. This is documented — but only in a single <Note> box near the scope-priority table on the Sub-agents page. The supported-frontmatter reference table later on the same page lists all fields without any caveat, so a user reading that table to author or port a plugin agent gets no warning.

Error Message

The frontmatter reference table (the section users actually consult when copying examples) doesn't mark which fields are plugin-restricted. A plugin author who copies a working agent from ~/.claude/agents/ and drops it into <plugin>/agents/ sees no error — the fields just stop working silently.

Root Cause

Plugin sub-agents silently ignore the hooks, mcpServers, and permissionMode frontmatter fields. This is documented — but only in a single <Note> box near the scope-priority table on the Sub-agents page. The supported-frontmatter reference table later on the same page lists all fields without any caveat, so a user reading that table to author or port a plugin agent gets no warning.

RAW_BUFFERClick to expand / collapse

Summary

Plugin sub-agents silently ignore the hooks, mcpServers, and permissionMode frontmatter fields. This is documented — but only in a single <Note> box near the scope-priority table on the Sub-agents page. The supported-frontmatter reference table later on the same page lists all fields without any caveat, so a user reading that table to author or port a plugin agent gets no warning.

Where the gap is

The frontmatter reference table (the section users actually consult when copying examples) doesn't mark which fields are plugin-restricted. A plugin author who copies a working agent from ~/.claude/agents/ and drops it into <plugin>/agents/ sees no error — the fields just stop working silently.

Why it matters

hooks, mcpServers, and permissionMode are common, non-obvious-to-omit fields. Today's behavior:

  • User-defined agents (~/.claude/agents/, .claude/agents/) — fields honored.
  • Plugin agents (<plugin>/agents/) — fields silently ignored at load time.

The "for security reasons" rationale makes sense, but discoverability is the problem.

Suggested fix

One or more of:

  1. Add a column or per-row footnote to the supported-frontmatter table marking hooks / mcpServers / permissionMode as plugin-restricted.
  2. Move the <Note> to immediately above or inside the frontmatter table where it's harder to skip.
  3. Emit a warning at agent-load time when a plugin agent declares one of these fields, instead of silently dropping them.

(3) is the most user-friendly long-term, but (1) or (2) is a low-cost docs win.

Adjacent prior art (not dupes)

  • #17688 — Skill-scoped hooks in plugin SKILL.md don't fire (skill-side equivalent of this gap).
  • #47898 — Agent tool not available at runtime for plugin-defined agent types despite tools: declaration.
  • #52605 — --agent / agent setting docs omit session permissionMode behavior.

This issue is specifically about the docs surface area (and optionally the silent-drop behavior) for plugin-agent frontmatter.

Repro / how I noticed

Authoring an LOTR-themed orchestration plugin (mordor-forge). Several agent definitions use permissionMode: plan and hooks: for soft-nudge behavior. Worked locally as user agents; ported into the plugin tree, fields silently became no-ops. Found the <Note> only after specifically searching docs for "plugin subagents".

extent analysis

TL;DR

Update the supported-frontmatter table to clearly indicate which fields are plugin-restricted, such as adding a column or footnote to mark hooks, mcpServers, and permissionMode as restricted.

Guidance

  • Review the Sub-agents page and update the frontmatter reference table to include a clear indication of plugin-restricted fields.
  • Consider moving the existing <Note> to a more prominent location, such as above or inside the frontmatter table, to improve discoverability.
  • Evaluate the feasibility of emitting a warning at agent-load time when a plugin agent declares a restricted field, as a long-term solution to improve user experience.

Example

No code snippet is provided as the issue is primarily related to documentation and behavior.

Notes

The suggested fix focuses on improving documentation and discoverability, as the current behavior is documented but not easily found by users. The proposed solutions aim to reduce the likelihood of users encountering silent failures when porting agents to plugins.

Recommendation

Apply workaround: Update the documentation to clearly indicate plugin-restricted fields, as this is a low-cost and effective way to address the issue and improve user experience.

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

claude-code - 💡(How to fix) Fix [DOCS] Surface plugin-subagent frontmatter limitations (hooks/mcpServers/permissionMode) in main reference, not just a buried Note [1 participants]