models

package
v0.0.270 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2026 License: MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const (
	// DefaultSettingsFile is the Claude home settings name.
	DefaultSettingsFile = "settings.json"
)

Variables

View Source
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.

func List

func List(home string) (Catalog, error)

List returns the native catalog for home. Empty home uses DefaultHome(). Missing settings.json is soft: aliases still appear. A present but unreadable/invalid file is an error.

type Model

type Model struct {
	// ID is the value passed to claude --model (an alias or a settings override).
	ID string `json:"id"`
	// Source is "builtin" for NativeAliases, or DefaultSettingsFile.
	Source string `json:"source"`
}

Model is one selectable native Claude model.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL