agent field — runtime test
Hands-on runtime battle-test of agent field. Result: PASS.
The agent field in skill definitions routes task execution to named agent types, indirectly selecting model capability and inference cost.
How it works
When a skill includes agent: {type} in its front matter, the Claude Code runtime passes this value to the Task tool, which resolves it to a specific agent implementation. The field accepts Task tool agent type names—Explore, Plan, general-purpose, Bash, claude-code-guide, and others—not model names directly. Invalid values (e.g. haiku, sonnet) are silently ignored, defaulting to the parent model and capability tier of the invoking session.
What the test found
A test on 2026-01-07 created .claude/skills/test-agent-field/SKILL.md with varied agent field values and observed the resulting model assignments:
| Agent Field | Resulting Model | Agent Role |
|---|---|---|
Explore |
Haiku 4.5 | Fast codebase exploration |
Plan |
Opus 4.5 | Software architecture planning |
general-purpose |
Opus 4.5 | Default full-capability agent |
haiku (invalid) |
Opus 4.5 | Ignored, fell back to parent |
The test confirmed that agent type names map to inferred model capability, not the other way around. Explore is documented as a "fast agent" and consistently resolved to Haiku; Plan is documented as a "software architect" and resolved to Opus.
Why it matters
The agent field enables cost-optimized task routing within a single skill suite. A research or exploration skill can declare agent: Explore to run on cheaper inference; architecture or synthesis work can request agent: Plan for deeper reasoning. When combined with context: fork, this allows isolated, single-use agent instances to run at their natural cost tier, rather than forcing all tasks through the parent session's model.
Caveats
Silent failure on invalid agent types means typos pass undetected. The field is only useful if the runtime knows the agent type name; undocumented or deprecated agent types will default silently rather than error. No validation occurs at skill definition time.
Test Results: Agent Field in Skills
Feature: Added support for agent field in skills to specify agent type for execution
Tested: 2026-01-07
Test Setup
Created .claude/skills/test-agent-field/SKILL.md with various agent values:
---
name: test-agent-field
description: Test the agent field to see what agent types are available
agent: [varied]
context: fork
---
# Agent Field Test
Report what model you are...
Test Results
Agent Type → Model Mapping
| Agent Field Value | Resulting Model | Notes |
|---|---|---|
haiku |
Opus 4.5 | Invalid value - ignored, uses default |
Explore |
Haiku 4.5 | Fast exploration agent |
Plan |
Opus 4.5 | Planning/architecture agent |
general-purpose |
Opus 4.5 | Default smart agent |
Key Finding
The agent field takes Task tool agent type names, not model names directly:
- Valid values:
Bash,general-purpose,Explore,Plan,claude-code-guide, etc. - Invalid values (like
haiku,sonnet) are ignored → defaults to parent model
Agent Type → Model Inference
Based on Task tool documentation:
- Explore: "Fast agent specialized for exploring codebases" → Haiku
- Plan: "Software architect agent for designing implementation plans" → Opus
- general-purpose: Full capability agent → Opus
Implications
- Cost optimization IS possible via
agent: Explorefor research/search skills - Model selection is indirect - pick agent type, get corresponding model
- Invalid values fail silently - no error, just uses default
- Combined with fork - get isolated cheap execution
Status: PASS
Feature works as designed. Agent field routes to Task tool agent types.
test_81d4966bd708a69cc227b92bed255199b87705613b1e2fd064d57fa75a6b679d2856ceafad6b1daa8f982493871b6dd808cd43ff39365b4c1eb012bbdce2e651f38affde3bf6e4165ed4b5bb1cfd7d35c55609d7d1ffb49cb14bd29e320b9166e5bc3346b649fc9bbf8cdaa4f0f970fSigned with an ed25519 key held off the repo. Anyone can verify against the published public key; nobody without the secret key can forge it. Click verify: it recomputes the signature in your browser. The signature proves integrity and authorship of this exact content — not a third-party timestamp or that the underlying claim is objectively true. signedAt is when the @f3/attest pipeline ran, not when the work happened; the evidence refs carry the source dates.
- verifies agent field Primitive