Documentation
¶
Overview ¶
Package models lists native Claude Code models without spawning `claude`.
Claude Code has no models_cache.json and no --list-models. The picker equivalent of Codex's file-backed catalog is the CLI's stable family aliases (opus, sonnet, haiku), plus ~/.claude/settings.json's "model" when it names something else.
Index ¶
Constants ¶
const (
// DefaultSettingsFile is the Claude home settings name.
DefaultSettingsFile = "settings.json"
)
Variables ¶
var NativeAliases = []string{"opus", "sonnet", "haiku"}
NativeAliases is the family list Claude Code's --model flag has always accepted. Versioned ids (claude-opus-4-5, …) are deliberately omitted: they go stale on every CLI release; the alias is resolved by Claude Code.
Functions ¶
func DefaultHome ¶
func DefaultHome() string
DefaultHome returns $CLAUDE_HOME when set, otherwise $HOME/.claude.
Types ¶
type Catalog ¶
type Catalog struct {
// Home is the resolved Claude data directory used for the listing.
Home string `json:"home"`
// Default is the top-level "model" from settings.json (empty when unset).
Default string `json:"default,omitempty"`
// Models is the picker list: NativeAliases, then a settings model the
// aliases do not already cover.
Models []Model `json:"models"`
// FromSettings is true when settings.json was read successfully.
FromSettings bool `json:"from_settings"`
}
Catalog is the native model list for a Claude home.