← Back to Skills Marketplace
moonbird0423

claude-code-model

by MoonBird0423 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
58
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install claude-code-model
Description
Configure Claude Code to use custom models (DeepSeek, GLM, Qwen, etc.). Use when user wants to change Claude Code's model, switch API provider, or set up cus...
README (SKILL.md)

Claude Code Model Configuration

Switch Claude Code to use custom model providers (DeepSeek, GLM, Qwen, OpenAI-compatible endpoints).

Configuration Locations

Claude Code reads config from multiple sources (in priority order):

  1. Environment variables (highest priority)
  2. ~/.claude/config.json
  3. ~/.claude/settings.json

Required Parameters

User must provide:

  • base_url: API endpoint (e.g., https://api.deepseek.com/anthropic)
  • model: Model name (e.g., deepseek-v4-flash, glm-5)
  • api_key: API key

Workflow

Step 1: Update Environment Variables

Set user-level environment variables (persist across restarts):

[Environment]::SetEnvironmentVariable("ANTHROPIC_API_KEY", "\x3Capi_key>", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "\x3Cbase_url>", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_MODEL", "\x3Cmodel>", "User")

Clear conflicting variables:

[Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "", "User")

Step 2: Update config.json

Edit ~/.claude/config.json:

{
  "env": {
    "ANTHROPIC_API_KEY": "\x3Capi_key>",
    "ANTHROPIC_BASE_URL": "\x3Cbase_url>",
    "ANTHROPIC_MODEL": "\x3Cmodel>"
  }
}

Step 3: Update settings.json

Edit ~/.claude/settings.json, add/update:

{
  "model": "\x3Cmodel>",
  "env": {
    "ANTHROPIC_BASE_URL": "\x3Cbase_url>",
    "ANTHROPIC_API_KEY": "\x3Capi_key>"
  }
}

Step 4: Verify

Test the configuration:

claude --print "hi, what model are you?"

Common Issues

  • Auth conflict: Both ANTHROPIC_AUTH_TOKEN and ANTHROPIC_API_KEY set → Clear ANTHROPIC_AUTH_TOKEN
  • Old model still shows: Check config.json for stale ANTHROPIC_MODEL value
  • Changes not生效: New terminal window required for env var changes

Popular Provider Examples

Provider base_url Models
DeepSeek https://api.deepseek.com/anthropic deepseek-v4-flash, deepseek-v4-pro
GLM (阿里云) https://coding.dashscope.aliyuncs.com/apps/anthropic glm-5
Qwen Same as GLM qwen-*

Script

Use the bundled script for automated configuration:

python scripts/configure_model.py --base-url \x3Curl> --model \x3Cname> --api-key \x3Ckey>
Usage Guidance
This skill appears to be what it claims: it will add or replace entries in ~/.claude/config.json and ~/.claude/settings.json and (on Windows) set user-level environment variables, or print shell lines for you to add on Unix. Before running: 1) review the script to confirm you trust it (it runs PowerShell on Windows and calls the local 'claude' binary); 2) back up ~/.claude/config.json and settings.json so you can restore original settings; 3) be aware your API key will be stored in environment variables and JSON files in plaintext — only use keys you trust to share with the configured provider; 4) prefer running the script locally rather than pasting commands from unknown sources, and verify the base_url points to the intended provider.
Capability Analysis
Type: OpenClaw Skill Name: claude-code-model Version: 1.0.0 The skill bundle contains a shell injection vulnerability in `scripts/configure_model.py`. The script uses f-strings to construct PowerShell commands for setting environment variables on Windows without sanitizing user-provided inputs (`--api-key`, `--base-url`, `--model`), which could lead to arbitrary command execution if the agent is provided with malicious values. While the tool's logic is consistent with its stated purpose of configuring Claude Code, the insecure use of `subprocess.run` with unsanitized strings is a high-risk vulnerability.
Capability Tags
requires-sensitive-credentials
Capability Assessment
Purpose & Capability
Name/description align with the included script and instructions: the SKILL.md and scripts/configure_model.py only change ~/.claude/config.json, ~/.claude/settings.json, and user-level environment variables to point Claude Code at a different API endpoint and model. The requested inputs (base_url, model, api_key) are appropriate for this purpose.
Instruction Scope
Instructions are scoped to configuring Claude Code: they show how to set environment variables, edit the two config files, and run a local 'claude' command to verify. They do not attempt to read unrelated system files or send data to third-party endpoints beyond invoking the local 'claude' tool.
Install Mechanism
No install spec or external downloads; the skill is instruction + a small included Python script. Nothing is fetched from remote URLs or installed to system-wide locations.
Credentials
The skill asks for an API key and writes it into user environment variables and config files (plaintext). That is proportionate to changing the model provider, but is a sensitive action: storing credentials in shell profiles and JSON files is expected here but has privacy/security implications the user should consider.
Persistence & Privilege
The skill does not request always: true and does not modify other skills or system-wide agent settings. It writes to the user's ~/.claude config and (on Windows) sets per-user environment variables — expected for this functionality.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install claude-code-model
  3. After installation, invoke the skill by name or use /claude-code-model
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Configure Claude Code to use custom models (DeepSeek, GLM, Qwen, etc.). Switch API provider, set custom endpoints, update environment variables and config files automatically.
Metadata
Slug claude-code-model
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is claude-code-model?

Configure Claude Code to use custom models (DeepSeek, GLM, Qwen, etc.). Use when user wants to change Claude Code's model, switch API provider, or set up cus... It is an AI Agent Skill for Claude Code / OpenClaw, with 58 downloads so far.

How do I install claude-code-model?

Run "/install claude-code-model" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is claude-code-model free?

Yes, claude-code-model is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does claude-code-model support?

claude-code-model is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created claude-code-model?

It is built and maintained by MoonBird0423 (@moonbird0423); the current version is v1.0.0.

💬 Comments