Skip to content

feat: add model routing strategy to Code Cannon task execution #181

Description

@sebastientaggart

Summary

Implement a tiered model routing layer in Code Cannon that assigns the appropriate Claude model to each task type based on complexity, rather than defaulting all execution to Opus.

Background

Current Code Cannon sessions run virtually all task execution on claude-opus-4-7, resulting in high token cost per session. Analysis of usage data shows significant opportunity to route lower-complexity tasks to Sonnet or Haiku without sacrificing output quality.

Goals

  • Reduce effective token spend per Code Cannon session by 30–50%
  • Maintain Opus for tasks requiring deep reasoning or architectural judgment
  • Make routing rules transparent and overridable per-ticket

Proposed Approach

Model Tiers

Tier Model Use Cases
Heavy claude-opus-4-7 Architecture decisions, complex debugging, design-heavy passes, ambiguous specs
Standard claude-sonnet-4-6 Refactoring, test writing, most feature implementation
Light claude-haiku-4-5 Scaffolding, boilerplate generation, config file stubs, repetitive file creation

Routing Mechanism

  • Add a model field to the ticket schema (optional, defaults to standard)
  • Define a routing config in AGENTS.md or a dedicated model-routing.yml that maps task tags or phase types to tiers
  • Allow per-ticket override via explicit model: heavy|standard|light declaration
  • Log model used per ticket in session summary for tuning feedback

Acceptance Criteria

  • Ticket schema supports optional model field
  • Default routing applies Sonnet when no model is specified
  • Opus is explicitly required for designated task types
  • Routing config is documented and editable without code changes
  • Session output includes model-per-ticket summary for cost visibility

Notes

  • Preserve cache efficiency: stable system prompts and CLAUDE.md content should remain at context top regardless of model tier
  • Revisit tier assignments after first 3–5 sessions with real data

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions