feat(claudecode): add first-class subagent frontmatter fields - #1899
Merged
dyoshikawa merged 1 commit intoJun 16, 2026
Merged
Conversation
Closes #1878 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
dyoshikawa
deleted the
resolve-scrap-issue-1878-claudecode-subagent-fields
branch
June 16, 2026 11:22
Owner
Author
|
@dyoshikawa Thank you! |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow up Claude Code upstream updates by promoting the full set of subagent frontmatter fields documented at https://code.claude.com/docs/en/sub-agents to first-class, validated fields on
ClaudecodeSubagentFrontmatterSchema.Previously the schema only modeled
name,description,model,tools,permissionMode, andskills. The remaining fields still round-tripped viaz.looseObjectpassthrough, so this is a schema-completeness/validation improvement (type checking + documentation), not a data-loss fix.Changes
src/features/subagents/claudecode-subagent.ts: extendedClaudecodeSubagentFrontmatterSchema(keptz.looseObject) with optional first-class fields:disallowedTools(string or array, mirroringtools)maxTurns(number)color,memory,effort,isolation(plain strings for forward-compat)background(boolean)initialPrompt(string)mcpServersandhooksaccepted loosely asz.unknown()— nested schemas are deferred to a follow-up.src/features/subagents/claudecode-subagent.test.ts: added tests asserting the new fields validate, round-trip through theclaudecode:section (generate + import), and reject invalid types (maxTurns: "x",background: "yes").docs/reference/file-formats.md(+ auto-syncedskills/rulesync/file-formats.md): enumerated the new fields in theclaudecode:subagent example with inline comments.cspell.json: addedxhigh(a documentedeffortenum value).No
rules-processor.tsadditionalConvention change is needed (Claude Code subagents are native, not simulated). The new fields apply identically to project and global scope, so no scope-specific work. The README support matrix already shows Claude Code subagents as supported — no matrix change.Note on deferred fields
mcpServersandhooksare accepted loosely (z.unknown()) for now so they round-trip without data loss; dedicated nested schemas are intentionally deferred to a follow-up.Verification
pnpm cicheckis fully green (format, oxlint, typecheck, 6426 tests, sync-skill-docs, cspell, secretlint).Closes #1878
🤖 Generated with Claude Code