agent field
Routes to Task agents; agent: Explore resolves to Haiku, ~15x cheaper.
One node in a single signed graph. Here is how this primitive connects across the other layers.
The agent field in skill frontmatter routes execution to a named Task tool agent type, which determines the model tier and capability set without hard-coding a specific model.
Mechanics and Routing
The agent field accepts Task tool agent type names (valid: Explore, Plan, general-purpose, Bash, claude-code-guide; invalid: model names like haiku or sonnet). Invalid values are silently ignored, falling back to the parent context's model. When combined with context: fork, the agent field routes the forked skill to isolated execution on the derived model.
Tested agent types map as follows:
| Agent Type | Model | Design Purpose |
|---|---|---|
Explore |
Haiku 4.5 | Fast exploration agent, optimized for file search and codebase navigation |
Plan |
Opus 4.5 | Software architect agent for design decisions |
general-purpose |
Opus 4.5 | Full-capability agent |
This indirection exists because agent types encode intent and capability constraints, not model IDs. The runtime then maps agent type to appropriate model tier.
Test Results
Runtime testing on 2026-01-07 confirmed the routing mechanism. Skills with agent: Explore received Haiku execution; Plan and general-purpose received Opus. Invalid values (agent: haiku) were ignored without error, with execution reverting to the parent model. The feature works as designed when valid Task tool agent types are specified.
Cost Optimization Pattern
Haiku is approximately 15 times cheaper than Opus per token. For skills performing search, filtering, or quick validation—patterns that do not require complex reasoning—declaring agent: Explore redirects execution to Haiku. A pipeline using multiple research skills at Haiku tier instead of Opus saves roughly 95% of compute cost for those operations. Combined with context: fork, this unlocks cheap, isolated, parallel exploration without affecting reasoning-heavy stages.
Why It Matters
Prior to the agent field, skills inherited the invoking model. Cost-aware system designers had no option for algorithmic cheapness at the skill boundary. Agent field decouples task-appropriate capability (research vs. architecture) from budget concerns, letting workflows explicitly route low-reasoning work to lower tiers while reserving expensive models for stages that require them.
Caveats
Invalid agent type values fail silently, so typos and model-name guessing (e.g., agent: haiku) produce no warning. Capabilities vary by agent type; Explore is search-focused and should not be used for complex multi-step reasoning. The full set of built-in agent types and their tool restrictions remains partially undocumented.
Agent Field: 10 Questions Answered
1. Mechanics
How does it work?
agentfield in frontmatter specifies Task tool agent type- Valid values:
Explore,Plan,general-purpose,Bash,claude-code-guide - Invalid values (like
haiku,sonnet) are silently ignored
What triggers it?
- Skill invocation with
agentfield routes to specified agent type - Combined with
context: forkfor isolated execution
Implementation model (guess):
- Skill system maps agent field to Task tool subagent dispatch
- Agent type determines model tier (Explore→Haiku, Plan→Opus)
2. Model/Agent
What model runs?
| Agent Type | Model |
|---|---|
| Explore | Haiku |
| Plan | Opus |
| general-purpose | Opus |
Can you specify model directly?
- No -
agent: haikuis ignored - Must use agent type, model follows
Default behavior:
- No agent field → runs in current context (same model as parent)
- Invalid agent field → same as no field
3. Context
Fresh or inherited?
- With
context: fork→ fresh context - Without fork → unclear, likely inherited
What carries over:
- With fork: system context only (project info, date)
- Without fork: likely full conversation
4. Tool Access
Default tools:
- Determined by agent type
- Explore: Glob, Grep, Read (search-focused)
- Plan: All planning tools
- Can override with
allowed-tools
Restrictions:
- Agent types may have built-in restrictions
allowed-toolscan further restrict
5. Failure Modes
Invalid agent type:
- Silently ignored
- Falls back to default behavior
- No error surfaced
Agent type mismatch:
- Using Explore for complex reasoning = poor results
- Using Plan for simple search = wasted tokens
6. Performance
Latency:
- Depends on agent type model
- Haiku (Explore) faster than Opus (Plan)
Token cost:
- Haiku ~15x cheaper than Opus
- Significant savings for frequent skills
Parallelism:
- Multiple skills with
agent: Explorecould run parallel - Need to test actual parallel invocation
7. Feature Interactions
With context: fork:
- Recommended combination
- Fork isolates, agent routes to model
- Together = cheap isolated execution
With hot-reload:
- Works - can modify agent field and re-invoke
- Changes picked up immediately
With allowed-tools:
- Can combine to restrict tool access
- Agent type sets base, allowed-tools restricts further
8. Edge Cases Tested
| Scenario | Result |
|---|---|
agent: Explore |
Haiku model |
agent: Plan |
Opus model |
agent: general-purpose |
Opus model |
agent: haiku (invalid) |
Ignored, Opus |
agent: sonnet (invalid) |
Not tested, likely ignored |
| No agent field | Parent model |
| Agent + fork | Works together |
9. Security
Trust boundary:
- Agent type may limit capabilities
- Bash agent likely sandboxed differently
- Explore agent read-focused
Model trust:
- Cheaper models (Haiku) may be less careful
- Security-critical tasks should use capable models
10. Debugging
How to verify agent routing:
- Skill can self-report model from system prompt
- Check for model ID in output
Common issues:
- Invalid agent type silently ignored
- Expecting model names to work (they don't)
Key Finding
Agent field enables cost-optimized skill routing:
- Use
agent: Explorefor research/search → Haiku prices - Use
agent: Planfor architecture → Opus quality - Invalid values fail silently - always test
Combined with context: fork, this unlocks cheap parallel execution pattern.
Use Cases: Agent Field in Skills
Feature: agent field in skill frontmatter specifies agent type for execution
Core Value Proposition
Different tasks need different capabilities:
- Research → fast, cheap, good enough
- Architecture → slow, expensive, best quality
- Bash operations → specialized, sandboxed
The agent field lets you match task to capability tier without hard-coding models.
Use Cases
1. Cost-Optimized Research Skills
Scenario: You need to search/grep/read across a codebase frequently.
---
name: find-usages
agent: Explore
context: fork
allowed-tools: Grep,Glob,Read
---
Impact: Each invocation runs Haiku instead of Opus. For frequent research tasks, this adds up.
Math: If Opus is ~15x more expensive than Haiku, and you run 20 research skills per session, you save ~95% on those operations.
2. Tiered Skill Pipelines
Scenario: Complex workflow where some stages need smarts, others just need speed.
Stage 1: Gather data (agent: Explore) → Haiku
Stage 2: Analyze patterns (agent: general-purpose) → Opus
Stage 3: Format output (agent: Explore) → Haiku
Impact: Only pay for expensive reasoning where it matters.
3. Parallel Cheap Exploration
Scenario: Need to search multiple areas of a codebase simultaneously.
# skill-a
agent: Explore
context: fork
# searches area A
# skill-b
agent: Explore
context: fork
# searches area B
Impact: Both run on Haiku in parallel (if supported), orchestrator synthesizes.
4. Fail-Fast Validation
Scenario: Quick check before expensive operation.
---
name: pre-check
agent: Explore
context: fork
---
# Quick validation - is this file even relevant?
# If not, don't waste Opus tokens on full analysis
Impact: Cheap triage saves expensive mistakes.
5. Agent-Type Specialization
Scenario: Use agent types for their designed purpose.
| Task | Agent | Why |
|---|---|---|
| Find files | Explore | Optimized for search |
| Design system | Plan | Optimized for architecture |
| Run commands | Bash | Sandboxed execution |
| General work | general-purpose | Full capability |
Impact: Right tool for the job, not just cost optimization.
6. Safe Experimentation
Scenario: Testing new skill designs without burning tokens.
---
name: experiment-v1
agent: Explore
context: fork
---
While iterating on skill design, use cheap model. Switch to Plan or general-purpose when finalized.
7. Budget-Constrained Environments
Scenario: CI/CD or automated systems with token budgets.
# All CI skills use Explore unless they need planning
agent: Explore
Impact: Predictable costs, automated systems don't need Opus-level reasoning for most checks.
Anti-Patterns
1. Over-Optimizing
Don't use agent: Explore for tasks that need real reasoning. Haiku will give worse results on complex analysis.
2. Ignoring Agent Capabilities
Each agent type has specific tools/behaviors. Bash agent is different from Explore. Match task to agent type, not just cost.
3. Invalid Agent Values
agent: haiku doesn't work - it's ignored. Use valid Task tool agent types.
Agent Type Reference
| Agent Type | Model | Best For |
|---|---|---|
Explore |
Haiku | File search, grep, quick reads |
Plan |
Opus | Architecture, design decisions |
general-purpose |
Opus | Complex multi-step tasks |
Bash |
? | Shell command execution |
claude-code-guide |
? | Documentation lookups |
(Some agent types not tested yet)
Key Insight
Agent field is about capability routing, not just cost:
- Pick agent type based on task requirements
- Cost savings follow naturally
- Invalid values fail silently (use valid types!)
- commit7caffe4 ↗
primitive_47d4d85e7efd6d91efada47ced255199b87705613b1e2fd064d57fa75a6b679d2856ceafad6b1daa8f982493871b6ddb1f477b33aa62dd08646869e5bdd69d7a38b7463d56132c2619389f04cd6b484c525d2fc74dc50f0949eea1e52c8326d18499e71c9d7ee510c04bc8afc599a07Signed 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.
- instance-of Capability Tiering Class
- introduces (in) Claude Code 2.1.0 (Night Zero) Release
- verifies (in) agent field — runtime test Test
- emerges-from (in) The cost frontier: pay for intelligence only where it bends the outcome Finding