Session log: Claude Code model selection Q&A + complexity-based sub-agent routing system

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-18 08:53:49 -07:00
parent 975adda092
commit 6a135ac111
3 changed files with 119 additions and 0 deletions

View File

@@ -176,3 +176,34 @@ No custom "Archived" status — used `Closed` for archival.
4. **All items in WORKITEMS.md**
5. **Cascades file search** — TickTick task for today
6. **Review Dataforth engineering docs and send** — TickTick task for today
---
## Update: ~14:00
### Topic: Claude Code model selection + complexity routing system
#### What was discussed
1. **Model selection in Claude Code** — confirmed it is always manual (no automatic complexity-based switching). Options: `/model`, `--model` flag, `ANTHROPIC_MODEL` env var, `settings.json`. The `opusplan` alias is the closest to automatic — uses Opus for planning phase, then switches to Sonnet for execution.
2. **Sub-agent complexity detection** — confirmed we had NO complexity-based model routing for spawned agents. Existing behavior: rule-based routing by operation type, `>500 token` delegation threshold, a few hardcoded Haiku hints in `AGENT_QUICK_REFERENCE.md` for documentation-squire.
#### What was built
**New file: `.claude/COMPLEXITY_ROUTING.md`**
Full 3-tier scoring rubric for sub-agent model selection:
- Tier 1 (Haiku): lookup, format, summarize, doc — no code changes
- Tier 2 (inherit/Sonnet): standard code, DB, tests, git — most work
- Tier 3 (Opus): architecture, security, ambiguous failures, production risk
Bump rule: if request contains `security`, `auth`, `token`, `credential`, `migration`, `production`, `race condition`, `data loss`, `breach`, `encrypt` → bump one tier up regardless.
**Updated: `.claude/CLAUDE.md`**
Inserted "Model Routing (Complexity-Based)" section in the coordinator block, just before Coordination Flow. Compact routing table + bump rule inline. References COMPLEXITY_ROUTING.md for full detail.
#### Files modified
- `.claude/COMPLEXITY_ROUTING.md` — new file, full rubric
- `.claude/CLAUDE.md` — coordinator section updated with routing table