Claude Model Switch
中文文档
A VSCode extension for managing Claude Code model settings per project.
If you use Claude Code for VS Code in multiple projects at the same time and need different model settings for different projects, one project might use Claude while another uses GLM, Kimi, Qwen, or MiniMax through a compatible API.
This extension can save those settings and switch between models. It updates the project's .claude/settings.local.json, so each project can keep its own model, base URL, and token configuration.
Preview

Features
- Model Profile Management: Add, edit, and delete model profiles with all Claude environment variables
- Per-Project Switching: Each project can use a different model — switch instantly without affecting others
- Status Bar: Shows the current active model in the bottom status bar
- Tree View Sidebar: Lists all profiles with inline action buttons (switch, edit, delete)
- Export/Import: Export profiles to JSON for backup or sharing; import with conflict resolution
- Auto-fill: Profile name defaults to model value; empty fields are omitted from settings
Usage
Switch Model
- Click the model name in the status bar (bottom left)
- Or use the ⚡ (zap) inline button on any profile in the sidebar tree view
- Or run
Claude: Switch to Model Profile from the command palette
Add Profile
- Click the ➕ button at the top of the sidebar tree view
- Or run
Claude: Add Model Profile from the command palette
- Fill in the fields in the webview panel (all optional)
Edit / Delete Profile
- Use the inline ✏️ / 🗑️ buttons on each profile row in the sidebar
- Or right-click a profile row for context menu options
Export / Import
- Use the sidebar header buttons or command palette:
Claude: Export Model Profiles — saves all profiles to a JSON file
Claude: Import Model Profiles — loads profiles from a JSON file, prompts for conflict resolution
Development
Prerequisites
- Node.js 20+
- pnpm
- VSCode 1.85+
Setup
git clone <repo-url>
cd claude-model-switch
pnpm install
Build
pnpm run build
Watch (for development)
pnpm run watch
Debug in VSCode
- Open this project in VSCode
- Press
F5 or use the Run Extension launch configuration
- This opens a new VSCode Extension Development Host window with the extension loaded
- Make changes in
src/, the watch task auto-rebuilds
- Reload the Extension Development Host window (
Ctrl+R / Cmd+R) to see changes
Type Check
pnpm run lint
Available Scripts
pnpm run build — build the extension once into out/extension.js
pnpm run build:prod — build the production bundle used for packaging and publishing
pnpm run watch — rebuild automatically while developing
pnpm run lint — run TypeScript type checking
pnpm run package:vsix — package the extension as dist/claude-model-switch.vsix for local installation or manual distribution
pnpm run release:patch — bump patch version and publish to VSCode Marketplace
pnpm run release:minor — bump minor version and publish to VSCode Marketplace
pnpm run release:major — bump major version and publish to VSCode Marketplace
Publishing
Required secrets:
VSCE_PAT — required for publishing to VSCode Marketplace
OVSX_PAT — optional, used for publishing to Open VSX
Local packaging only
Use this when you only want a .vsix file for testing or for sending to someone else directly.
pnpm run package:vsix
This produces dist/claude-model-switch.vsix, which can be installed manually:
code --install-extension dist/claude-model-switch.vsix
Local Marketplace publishing
Use this when you want to publish from your own machine and let vsce automatically bump the version in package.json.
pnpm run release:patch
You can replace patch with minor or major.
GitHub Actions: tag-based publish
Use this when the version is already decided and committed locally.
git tag v0.0.1
git push origin v0.0.1
This workflow will:
- install dependencies with pnpm
- build the extension
- package
dist/claude-model-switch.vsix
- publish that exact package to VSCode Marketplace
- optionally publish the same package to Open VSX
GitHub Actions: manual release with automatic version bump
Use the Manual Marketplace Release workflow in GitHub Actions when you want GitHub to perform the version bump and publish for you.
Workflow input:
patch — bugfix release, e.g. 0.0.1 -> 0.0.2
minor — backward-compatible feature release, e.g. 0.0.1 -> 0.1.0
major — breaking release, e.g. 0.0.1 -> 1.0.0
This workflow will:
- run
vsce publish patch|minor|major
- update
package.json
- create the version tag
- push the commit and tags back to GitHub
How It Works
- Profiles are stored in VSCode's
globalState (persists across sessions, machine-specific)
- Active profile ID is recorded in
<workspace>/.claude/.claude-model-switch-active.json
- Switching merges only the
model and env fields into <workspace>/.claude/settings.local.json, preserving other settings
- If the active profile ID is not found, it falls back to full-field matching against the current
settings.local.json
- Status bar and tree view auto-refresh when switching editors or when
settings.local.json changes