Custom agent with model: sonnet loses tools declared in frontmatter
Description
Custom agents defined in .claude/agents/ with model: sonnet do not receive all tools declared in their frontmatter tools: field. Specifically, Write is dropped. The same syntax works correctly for agents with model: opus.
Reproduction
Agent 1 (.claude/agents/cael.md) — works correctly:
---
name: cael
model: opus
tools: Read, Edit, Write, Bash, Grep, Glob, WebFetch, WebSearch
---
When spawned via Agent tool with subagent_type: "cael", system reports: (Tools: Read, Edit, Write, Bash, Grep, Glob, WebFetch, WebSearch) — all tools present.
Agent 2 (.claude/agents/nyx.md) — Write dropped:
---
name: nyx
model: sonnet
tools: Read, Grep, Glob, Write
---
When spawned via Agent tool with subagent_type: "nyx", system reports: (Tools: Read, Grep, Glob) — Write is missing.
Expected Behavior
Both agents should receive all tools declared in their frontmatter tools: field, regardless of which model is specified.
Actual Behavior
The Sonnet agent loses Write access. The Opus agent keeps all declared tools.
Environment
- Claude Code (VS Code extension)
- Windows 11 Pro
- Orchestrator model: claude-opus-4-6
- Agent models: opus (cael), sonnet (nyx)
Impact
This blocks file-mediated dispatch workflows where a Sonnet agent needs to save artifacts to disk and return summaries to the orchestrator. Current workaround: spawn a general-purpose agent with the Sonnet agent's instructions embedded, which has access to all tools but loses the custom agent type identity.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗