Skip to content

Claude Code: all gateway models in /model, status line on by default - #1

Merged
schowave merged 3 commits into
mainfrom
claude-model-picker
Oct 16, 2026
Merged

schowave merged 3 commits into
mainfrom
claude-model-picker

Conversation

@schowave

@schowave schowave commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

What and why

In a Claude Code session started by llmenu, /model only offered the three slots (Opus/Sonnet/Haiku). Switching to any other gateway model meant restarting llmenu.

All gateway models in /model

llmenu passes the gateway's models as modelPicker in the session's --settings, merged with the status line (Claude Code takes only one --settings):

  • no aliases or duplicates, sorted like the menu (catalog.Sort, moved out of cli)
  • description with context, prices (incl. the long-prompt tier) and the configured benchmark, e.g. 1M · $4.40 in / $22.00 out · intelligence 57.6; unknown context is left out
  • [1m] from 900k context; behavesAs only where the shortened target is a valid Anthropic ID (claude-opus-5-5, not claude-3-5-sonnet without its date)
  • replaceBuiltInOptions: true; Claude still shows "Default" and the current model
  • the settings go to a file in the cache directory (claude-settings.json), not inline: with a few hundred models the JSON would exceed Windows' command line limit (8191 characters through claude.cmd). Rewritten only when it changes, inline as a fallback, removed by llmenu reset
  • own --settings still win
  • new key claude.picker, on by default

Verified against the real Claude Code 2.1.301 via the fake gateway: all models show up, no startup error, picking with s switches the session (/status shows azure/gpt-6-sol[1m]).

Known caveat, accepted on purpose: picking with Enter makes Claude Code itself save the gateway model ID in ~/.claude/settings.json (llmenu writes nothing there). A plain claude on the subscription then fails on the first prompt with "There's an issue with the selected model … Run /model", and one /model fixes it. With the built-in slots Claude saves the alias instead, so this is new. A watcher that reverts the file was considered and rejected: it would write to ~/.claude and still leave gaps. README (usage and troubleshooting) and ADR-0002 document this.

Status line on by default

claude.statusline becomes optional like auto_compact: unset means on, only off is stored, and setup preselects yes. Your own status line keeps running, and llmenu adds its line below it.

Note for existing users: the old setting was a plain bool with omitempty, so a "No" from an earlier setup was never written. Those users get the status line now and can turn it off with llmenu config set claude.statusline false.

Review fixes

  • optBool helper replaces the copied auto_compact/picker/statusline key blocks
  • the check for own --settings now runs before llmenu's settings are built
  • an unknown benchmark metric is named "intelligence", the value Model.Score uses for it
  • the launch test checks the argument order again

Tests: the fake claude in the script tests prints --settings (file or inline) as @settings plus readable lines. New tests are TestClaudeSettings and the script checks for the settings file, claude.picker false and claude.statusline false.

Checklist

  • mise run ci passes locally
  • Tests added or updated for changed behavior
  • Docs updated (README, CONTRIBUTING, ADR) if user-facing behavior or a decision changed

🤖 Generated with Claude Code

llmenu passes the gateway's models as modelPicker in the session's
--settings, together with the status line: no aliases or duplicates,
sorted like the menu, with context, prices and benchmark, behavesAs for
Claude models. claude.picker false keeps Claude's own list.

Picking with Enter makes Claude Code save the gateway model in
~/.claude/settings.json; README and ADR-0002 document the error a plain
claude then shows and the fix with /model.
- Pass the session settings as a file in the cache directory instead of
  inline: with a few hundred models the JSON would exceed Windows' command
  line limit (8191 characters through claude.cmd). Rewritten only when it
  changes; inline if it cannot be written. llmenu reset removes it.
- behavesAs only for shortened targets that are valid Anthropic IDs;
  claude-3-5-sonnet without its date is not.
- Leave out unknown context; name an unknown metric like Model.Score does.
- Check for own --settings before building llmenu's.
- optBool helper for claude.auto_compact and claude.picker.
- Launch test checks the argument order again.
claude.statusline becomes optional like auto_compact: unset means on,
only off is stored. Setup asks with yes preselected.
@schowave schowave changed the title Claude Code: all gateway models in /model Claude Code: all gateway models in /model, status line on by default Oct 16, 2026
@schowave
schowave merged commit 81b040b into main Oct 16, 2026
12 checks passed
@schowave
schowave deleted the claude-model-picker branch October 16, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants