Repository navigation
Claude Code: all gateway models in /model, status line on by default - #1
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
In a Claude Code session started by llmenu,
/modelonly offered the three slots (Opus/Sonnet/Haiku). Switching to any other gateway model meant restarting llmenu.All gateway models in
/modelllmenu passes the gateway's models as
modelPickerin the session's--settings, merged with the status line (Claude Code takes only one--settings):catalog.Sort, moved out ofcli)1M · $4.40 in / $22.00 out · intelligence 57.6; unknown context is left out[1m]from 900k context;behavesAsonly where the shortened target is a valid Anthropic ID (claude-opus-5-5, notclaude-3-5-sonnetwithout its date)replaceBuiltInOptions: true; Claude still shows "Default" and the current modelclaude-settings.json), not inline: with a few hundred models the JSON would exceed Windows' command line limit (8191 characters throughclaude.cmd). Rewritten only when it changes, inline as a fallback, removed byllmenu reset--settingsstill winclaude.picker, on by defaultVerified against the real Claude Code 2.1.301 via the fake gateway: all models show up, no startup error, picking with
sswitches the session (/statusshowsazure/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 plainclaudeon the subscription then fails on the first prompt with "There's an issue with the selected model … Run /model", and one/modelfixes 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~/.claudeand still leave gaps. README (usage and troubleshooting) and ADR-0002 document this.Status line on by default
claude.statuslinebecomes optional likeauto_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 withllmenu config set claude.statusline false.Review fixes
optBoolhelper replaces the copiedauto_compact/picker/statuslinekey blocks--settingsnow runs before llmenu's settings are builtModel.Scoreuses for itTests: the fake
claudein the script tests prints--settings(file or inline) as@settingsplus readable lines. New tests areTestClaudeSettingsand the script checks for the settings file,claude.picker falseandclaude.statusline false.Checklist
mise run cipasses locally🤖 Generated with Claude Code