coderClaw

Models CLI

See /concepts/model-failover for auth profile rotation, cooldowns, and how that interacts with fallbacks. Quick provider overview + examples: /concepts/model-providers.

How model selection works

CoderClaw selects models in this order:

  1. Primary model (agents.defaults.model.primary or agents.defaults.model).
  2. Fallbacks in agents.defaults.model.fallbacks (in order).
  3. Provider auth failover happens inside a provider before moving to the next model.

Related:

Quick model picks (anecdotal)

If you don’t want to hand-edit config, run the onboarding wizard:

coderclaw onboard

It can set up model + auth for common providers, including OpenAI Code (Codex) subscription (OAuth) and Anthropic (API key recommended; claude setup-token also supported).

Config keys (overview)

Model refs are normalized to lowercase. Provider aliases like z.ai/* normalize to zai/*.

Provider configuration examples (including OpenCode Zen) live in /gateway/configuration.

“Model is not allowed” (and why replies stop)

If agents.defaults.models is set, it becomes the allowlist for /model and for session overrides. When a user selects a model that isn’t in that allowlist, CoderClaw returns:

Model "provider/model" is not allowed. Use /model to list available models.

This happens before a normal reply is generated, so the message can feel like it “didn’t respond.” The fix is to either:

Example allowlist config:

{
  agent: {
    model: { primary: "anthropic/claude-sonnet-4-5" },
    models: {
      "anthropic/claude-sonnet-4-5": { alias: "Sonnet" },
      "anthropic/claude-opus-4-6": { alias: "Opus" },
    },
  },
}

Switching models in chat (/model)

You can switch models for the current session without restarting:

/model
/model list
/model 3
/model openai/gpt-5.2
/model status

Notes:

Full command behavior/config: Slash commands.

CLI commands

coderclaw models list
coderclaw models status
coderclaw models set <provider/model>
coderclaw models set-image <provider/model>

coderclaw models aliases list
coderclaw models aliases add <alias> <provider/model>
coderclaw models aliases remove <alias>

coderclaw models fallbacks list
coderclaw models fallbacks add <provider/model>
coderclaw models fallbacks remove <provider/model>
coderclaw models fallbacks clear

coderclaw models image-fallbacks list
coderclaw models image-fallbacks add <provider/model>
coderclaw models image-fallbacks remove <provider/model>
coderclaw models image-fallbacks clear

coderclaw models (no subcommand) is a shortcut for models status.

models list

Shows configured models by default. Useful flags:

models status

Shows the resolved primary model, fallbacks, image model, and an auth overview of configured providers. It also surfaces OAuth expiry status for profiles found in the auth store (warns within 24h by default). --plain prints only the resolved primary model. OAuth status is always shown (and included in --json output). If a configured provider has no credentials, models status prints a Missing auth section. JSON includes auth.oauth (warn window + profiles) and auth.providers (effective auth per provider). Use --check for automation (exit 1 when missing/expired, 2 when expiring).

Preferred Anthropic auth is the Claude Code CLI setup-token (run anywhere; paste on the gateway host if needed):

claude setup-token
coderclaw models status

Scanning (OpenRouter free models)

coderclaw models scan inspects OpenRouter’s free model catalog and can optionally probe models for tool and image support.

Key flags:

Probing requires an OpenRouter API key (from auth profiles or OPENROUTER_API_KEY). Without a key, use --no-probe to list candidates only.

Scan results are ranked by:

  1. Image support
  2. Tool latency
  3. Context size
  4. Parameter count

Input

When run in a TTY, you can select fallbacks interactively. In non‑interactive mode, pass --yes to accept defaults.

Models registry (models.json)

Custom providers in models.providers are written into models.json under the agent directory (default ~/.coderclaw/agents/<agentId>/models.json). This file is merged by default unless models.mode is set to replace.