📚 Encyclopedia

AI & Claude · updated 2026-10-13

Auto-discovering Claude models and tracking the best one as the default

claudemodels-apimodel-selectionautomationllm-as-judgeoauthclaude-code

Hardcoded model lists go stale within weeks. TLDR's AI feature now discovers models from Anthropic's Models API, gates them by rule, and keeps a single "default model" pointer that a daily job moves forward when a better model for software development ships. Built September 2026.

Discovery chain

  1. claude-service GET /models calls https://api.anthropic.com/v1/models using Claude Code's own OAuth login (token from ~/.claude/.credentials.json, sent as Authorization: Bearer with header anthropic-beta: oauth-2025-04-20), so no separate API key is needed. Cached 24 h; serves the stale cache if a refresh fails. Returns {id, display_name, created_at} newest first (the API's order; alias resolution depends on it).
  2. The app's API turns that into choices: family chips (fable, opus, sonnet, haiku, plus the newest id of any new family found by ^claude-([a-z]+)) and a full version list for pinning. Falls back to a static list when the service is unreachable.
  3. The app caches the list per session (and clears it on session change).

Tag semantics

One pointer for "the default"

default_model in the service's config.json is the single source of truth, read fresh per request and reported by GET /models. The app API uses it when a post names no model, falling back to a server constant. Store the concrete id (claude-opus-5-5), not an alias: the CLI alias opus also resolved to it, but an alias can move without anyone deciding.

UI rule (Justin): the default should not get its own chip; the matching family chip is simply preselected, and choosing "default" sends no model tag at all.

The updater (daily systemd user timer)

  1. List models. No unseen id: exit, zero tokens spent.
  2. Unseen id: run a headless claude -p judge with only WebSearch and WebFetch allowed and a JSON schema for its answer {best, confidence, reason, sources}. It researches official Anthropic sources. The judge cannot edit anything; the script does.
  3. Switch only if best is in the discovered list, confidence is high, it differs from the current default, and a smoke run of the new model succeeds.
  4. A switch rewrites the service config and Claude Code's settings.json model (keeping a [1m] long-context suffix if the new model supports it), and posts the outcome where Justin will see it.
  5. Manual modes: --set <model>, --dry-run --force-judge. The running service only picks up code changes after a restart, so the message says when one is needed. See claude-service (ProcrastinAI's webhook runner for headless Claude).

Model lineup facts (as observed, 2026)

Released after older assistants' training cutoffs, so do not dismiss unfamiliar names; verify against Anthropic's docs: - Claude Fable 5 and Claude Mythos 5, released 2026-06-09 (Fable 5: $10 / $50 per million input / output tokens at launch; disabled under zero-data-retention). - Opus 4.8; Fable 5.1 (claude-fable-5-1, seen live 2026-08-28 to 09-03); Opus 5.5 (claude-opus-5-5), made the TLDR and Claude Code default on 2026-09-27 after the judge picked it with high confidence.

Gotchas

See also

Linked from

Sources: tldr memory (feature-ai-model-discovery, feature-ai-default-model, fix-background-polling, reference_claude_models, release-v1.47.x), posts #1631, #1688, #1689