Switch Claude Code providers in seconds with claude-provider (Plugin + CLI)
Source: Dev.to
Installation
npm i -g claude-provider
This installs both the CLI tool and the Claude Code plugin.
Add the plugin in Claude Code
/plugin marketplace add iqbal-rashed/claude-provider-plugin
/plugin install provider@claude-provider-plugin
Using the Plugin (inside Claude Code)
| Command | Description |
|---|---|
/provider:add | Add a new profile (choose a preset or create a custom one, then enter the API key and optionally a model). |
/provider:list | List all saved profiles. |
/provider:switch | Switch to the specified profile instantly. |
/provider:snapshot | Save the current ~/.claude/settings.json as a reusable profile. |
/provider:delete | Delete a saved profile. |
Using the CLI Tool
The CLI offers an interactive menu as well as quick‑switch commands.
Interactive menu
claude-provider
# or
cpr
Quick commands
# List profiles
claude-provider --list
# or
cpr -l
# Switch to a profile
claude-provider
# or
cpr
Managing Profiles
Profiles are stored as JSON files in ~/.claude/settings..json.
When you switch profiles, the selected file is copied to ~/.claude/settings.json, preserving any enabled Claude Code plugins.
Example workflow
-
Create two profiles
/provider:add work # Anthropic (main) /provider:add fast # DeepSeek (cheap/quick) -
Switch between them
/provider:switch fast # Use the fast/cheap provider /provider:switch work # Switch back to the main provider
Presets
The plugin comes with predefined presets for popular providers:
- Anthropic
- Z.ai (GLM)
- MiniMax
- Kimi
- Qwen
- DeepSeek
- Custom (user‑defined)
You can pick any preset when adding a profile, then supply the corresponding API key and model if needed.