[Feature Request] Add 'claude model list' CLI command for non-interactive model queries
Problem
Currently, there is no way to programmatically query available Claude models from the CLI without starting an interactive session and using /model.
Current Workarounds
- Interactive only: Start
claudesession → type/model→ consumes tokens for LLM processing - No CLI command:
claude model listdoesn't exist - API directly: Must use
curlwith API keys manually
Requested Feature
Add a claude model subcommand for non-interactive model queries:
# List all available models
claude model list
# Output:
# ID NAME TYPE CONTEXT
# claude-sonnet-4-5-20250929 Sonnet 4.5 Latest 200K
# claude-3-5-sonnet-20241022 Sonnet 3.5 Standard 200K
# claude-3-opus-20240229 Opus 3 Premium 200K
# claude-3-5-haiku-20241022 Haiku 3.5 Fast 200K
# Show current model for session
claude model current
# Show model info
claude model info claude-sonnet-4-5-20250929
Use Cases
- Scripting/Automation - Check available models before running tasks
- Cost Optimization - Programmatically select cheapest model for task
- CI/CD Pipelines - Validate model availability before running agents
- Documentation - Generate up-to-date model lists
- Debugging - Verify which models are accessible with current API key
Comparison with Similar Tools
GitHub CLI:
gh api /repos/:owner/:repo # Direct API access
gh repo view # Formatted output
Docker CLI:
docker images # List available images
docker inspect <image> # Show image details
Claude Code (requested):
claude model list # List available models (no LLM inference)
claude model current # Show current session model
Benefits
- ✅ Zero token cost (no LLM inference needed)
- ✅ Scriptable (parseable output for automation)
- ✅ Fast (no interactive session startup)
- ✅ Consistent with modern CLI patterns
- ✅ Better DX for power users
Implementation Notes
- Should work without starting interactive session
- Output should be parseable (consider
--jsonflag) - Cache model list locally (refresh periodically)
- Respect API provider (Anthropic, Bedrock, Vertex)
Related Issues
- #10169 - Custom Bedrock models not discoverable in
/modelcommand list - #10717 -
/modelreturns old version of models
Environment:
- Platform: Linux (WSL2)
- Version: Claude Code v2.0.x
- Use case: Automation scripts, CI/CD integration
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
bump
+1, this would be nice to have. We have custom models setup on Bedrock and choosing models when switching between a claude subscription and Bedrock use is a pain.
I'd definitely also like this feature
That woud be usefull please give it some attention.
I think this feature will make Claude Code more user-friendly.
bump
+1 anything that has versions should be listable
+10000000000 This would be super useful to be able to configure some inhouse tools to use the correct models programatically
Please add this in - there's exactly no possible way to find this out right now - not even what claude.ai tells us to do even...
$ curl https://api.anthropic.com/v1/models \
-H "Authorization: Bearer $CLAUDE_CODE_OAUTH_TOKEN"
-H "anthropic-version: 2023-06-01" {"type":"error","error":{"type":"authentication_error","message":"OAuth authentication is currently not supported."},"request_id":"req_011Cad8bMLnLV5K51nXzeLJ8"}
you can see the existing models via running
claude, then /model
ke@Kyles-MacBook-Pro-2 ws % claude
Claude Code v2.1.114
▗ ▗ ▖ ▖ Sonnet 4.6 with high effort · Claude Max
~/ws
▘▘ ▝▝ Welcome to Opus 4.7 xhigh! · /effort to tune speed vs. intelligence
❯ /model
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Select model
Switch between Claude models. Applies to this session and future Claude Code sessions. For other/previous model names, specify with --model.
1. Default (recommended) Opus 4.7 with 1M context · Most capable for complex work
❯ 2. Sonnet ✔ Sonnet 4.6 · Best for everyday tasks
3. Sonnet (1M context) Sonnet 4.6 with 1M context · Billed as extra usage · $3/$15 per Mtok
4. Haiku Haiku 4.5 · Fastest for quick answers
● High effort ← → to adjust
Use /fast to turn on Fast mode (Opus 4.6 only).
Enter to confirm · Esc to exit
you can see the existing models via running
claude, then/modelke@Kyles-MacBook-Pro-2 ws % claude Claude Code v2.1.114 ▗ ▗ ▖ ▖ Sonnet 4.6 with high effort · Claude Max ~/ws ▘▘ ▝▝ Welcome to Opus 4.7 xhigh! · /effort to tune speed vs. intelligence ❯ /model ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── Select model Switch between Claude models. Applies to this session and future Claude Code sessions. For other/previous model names, specify with --model. 1. Default (recommended) Opus 4.7 with 1M context · Most capable for complex work ❯ 2. Sonnet ✔ Sonnet 4.6 · Best for everyday tasks 3. Sonnet (1M context) Sonnet 4.6 with 1M context · Billed as extra usage · $3/$15 per Mtok 4. Haiku Haiku 4.5 · Fastest for quick answers ● High effort ← → to adjust Use /fast to turn on Fast mode (Opus 4.6 only). Enter to confirm · Esc to exit
The idea of the ticket is to not use then interactive one and have a programmatic way of doing it.