Skip to content

Declare a model for each agent skill stage #109

Description

@V3RON

Why

No skill in .claude/skills/ names a model, and work-issue delegates every stage to a general-purpose subagent without choosing one. So each stage runs on whatever model the session uses. An Opus session spends Opus on implementing and on device tests, which are mostly mechanical. A Sonnet session reviews and triages on Sonnet, where catching problems matters most. On #96 the implement phase started on Opus and had to be stopped by hand and restarted on Sonnet.

Expected outcome

Each stage runs on its declared model however it starts: delegated by work-issue, run as a slash command, or loaded by another agent.

A skill's model: frontmatter on its own is not enough (evidence in the comments). Claude Code applies it only when a person types the slash command. When a skill is loaded through the Skill tool, which is how work-issue and subagents load them, the run stays on the caller's model. A skill with model: plus context: fork runs in its own subagent on the declared model, whichever way it is started.

Skill Frontmatter
design-feature, triage-issue, review-pr, review-memory model: opus, context: fork
implement-issue, e2e-device model: sonnet, context: fork
file-issue, cut-release model: sonnet, no fork
work-issue, architecture, writing-changelog, writing-user-docs none

file-issue interviews a person, and cut-release waits for an explicit yes. Both need the conversation, so they stay inline: their model applies when typed as a slash command, and they run on the caller's model when loaded through the Skill tool. work-issue runs on the model the person starts it with. The three writing and rule skills load inside other stages, so they must not change that stage's model.

work-issue delegates each stage by invoking its skill with the Skill tool and passing the issue, the branch and the task as arguments. It stops starting a general-purpose agent that then loads the skill. A forked skill starts without the conversation, so the arguments must carry everything the stage needs.

The Skills table in AGENTS.md gains a Model column and a Forked column, which are the one list to edit when the mapping changes.

Constraints and non-goals

  • Use the aliases (opus, sonnet), not dated model IDs, so the mapping follows new releases without edits.
  • work-issue never passes a model override. A model given when starting a subagent wins over the skill's model, which would undo this change.
  • If an organisation's availableModels excludes a declared model, Claude Code silently falls back to the session model. That is acceptable and needs no handling.
  • Non-goal: OpenCode. It ignores this frontmatter, and its stages keep running on the session model.
  • Non-goal: changing what any skill does, beyond work-issue's delegation mechanics.

How we know it is done

  1. Every skill's frontmatter matches the table above.
  2. AGENTS.md's Skills table has Model and Forked columns matching the frontmatter.
  3. A check that runs in CI fails when a skill's model: or context: disagrees with AGENTS.md, or when a skill in .claude/skills/ is missing from the table.
  4. work-issue invokes each stage's skill with the Skill tool and arguments, and still receives that skill's report block.
  5. The PR shows headless runs (claude -p … --output-format json, whose modelUsage lists the models used) proving these routes:
    • From a Sonnet session, loading review-pr through the Skill tool runs it on Opus.
    • From an Opus session, loading implement-issue through the Skill tool runs it on Sonnet.
    • A forked skill receives the arguments it was invoked with.

Alternatives considered

  • model: alone in each skill: ignored whenever the skill is loaded through the Skill tool, so it never applies to work-issue's stages.
  • One .claude/agents/<stage>.md per stage with its model: works for delegated runs, but a typed /review-pr also needs an inline model:, so each stage's model would live in two places.
  • work-issue naming the model in each delegation: a skill run on its own would get no model.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:toolingRepo scripts, CI workflows, workspace configstatus:readySpec and fix direction are clear; an agent can pick it uptype:choreMaintenance with no user-visible change

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions