<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Claude Code &#8211; wqh博客</title>
	<atom:link href="https://wangqianhong.com/tag/claude-code/feed/" rel="self" type="application/rss+xml" />
	<link>https://wangqianhong.com</link>
	<description>和而不同</description>
	<lastBuildDate>Fri, 03 Jul 2026 01:02:02 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://wangqianhong.com/wp-content/uploads/2020/09/cropped-1-1-1-32x32.png</url>
	<title>Claude Code &#8211; wqh博客</title>
	<link>https://wangqianhong.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Claude Code &#124; 配置多模型</title>
		<link>https://wangqianhong.com/2025/12/claude-code-%e9%85%8d%e7%bd%ae%e5%a4%9a%e4%b8%aa%e5%bc%80%e6%ba%90%e6%a8%a1%e5%9e%8b/</link>
					<comments>https://wangqianhong.com/2025/12/claude-code-%e9%85%8d%e7%bd%ae%e5%a4%9a%e4%b8%aa%e5%bc%80%e6%ba%90%e6%a8%a1%e5%9e%8b/#respond</comments>
		
		<dc:creator><![CDATA[wqh_work]]></dc:creator>
		<pubDate>Sun, 28 Dec 2025 14:51:00 +0000</pubDate>
				<category><![CDATA[技术文章]]></category>
		<category><![CDATA[Claude Code]]></category>
		<guid isPermaLink="false">https://wangqianhong.com/?p=3937</guid>

					<description><![CDATA[<p>先打开powershell(管理员) ，然后执行下面命令 然后执行 notepad $PROFILE&#8230; <a href="https://wangqianhong.com/2025/12/claude-code-%e9%85%8d%e7%bd%ae%e5%a4%9a%e4%b8%aa%e5%bc%80%e6%ba%90%e6%a8%a1%e5%9e%8b/" class="more-link read-more" rel="bookmark">继续阅读 <span class="screen-reader-text">Claude Code &#124; 配置多模型</span><i class="fa fa-arrow-right"></i></a></p>
<p><a rel="nofollow" href="https://wangqianhong.com/2025/12/claude-code-%e9%85%8d%e7%bd%ae%e5%a4%9a%e4%b8%aa%e5%bc%80%e6%ba%90%e6%a8%a1%e5%9e%8b/">Claude Code | 配置多模型</a>最先出现在<a rel="nofollow" href="https://wangqianhong.com">wqh博客</a>。</p>
]]></description>
										<content:encoded><![CDATA[
<p>先打开powershell(管理员) ，然后执行下面命令</p>



<pre class="wp-block-code"><code>New-Item -ItemType File -Path $PROFILE -Force -Verbose</code></pre>



<p>然后执行 <code>notepad $PROFILE</code>  编辑文件，保存下面内容，填上自己的KEY</p>



<pre class="wp-block-code"><code># --- CC (Claude Code) Multi-Model Configuration ---


# API Keys (Uncomment to use Keys; Comment out to use OAuth/Subscription)
$GLOBAL_GLM_KEY = ""
$GLOBAL_MINIMAX_KEY = ""
$GLOBAL_DEEPSEEK_KEY = "" 

# Environment Reset Function
function Reset-ClaudeEnv {
    # Check if the Global key variable is defined and not null/empty
    if (Get-Variable -Name "GLOBAL_ANTHROPIC_KEY" -ErrorAction SilentlyContinue) { 
        $env:ANTHROPIC_API_KEY = $GLOBAL_ANTHROPIC_KEY 
    } else { 
        $env:ANTHROPIC_API_KEY = $null 
    }

    # Clear all proxy and model-specific variables
    $env:ANTHROPIC_BASE_URL = $null
    $env:ANTHROPIC_AUTH_TOKEN = $null
    $env:CLAUDE_CODE_AUTO_COMPACT_WINDOW = $null
    $env:API_TIMEOUT_MS = $null
    $env:CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC = $null
    
    $env:ANTHROPIC_MODEL = $null
    $env:ANTHROPIC_SMALL_FAST_MODEL = $null
    $env:ANTHROPIC_DEFAULT_SONNET_MODEL = $null
    $env:ANTHROPIC_DEFAULT_OPUS_MODEL = $null
    $env:ANTHROPIC_DEFAULT_HAIKU_MODEL = $null
}

# GLM
function claudeglm {
    Reset-ClaudeEnv
    $env:ANTHROPIC_BASE_URL = "https://open.bigmodel.cn/api/anthropic"
    $env:ANTHROPIC_AUTH_TOKEN = $GLOBAL_GLM_KEY

    $env:ANTHROPIC_DEFAULT_HAIKU_MODEL = "glm-4.7"  
    $env:ANTHROPIC_DEFAULT_SONNET_MODEL = "glm-5.2&#91;1m]"
    $env:ANTHROPIC_DEFAULT_OPUS_MODEL = "glm-5.2&#91;1m]"
	$env:CLAUDE_CODE_AUTO_COMPACT_WINDOW = "1000000"
	$env:API_TIMEOUT_MS = "3000000"
	$env:CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC = "1"
    &amp; claude @args
}

# MiniMax
function claudeminimax {
    Reset-ClaudeEnv
    $env:ANTHROPIC_BASE_URL = "https://api.minimaxi.com/anthropic"
    $env:ANTHROPIC_AUTH_TOKEN = $GLOBAL_MINIMAX_KEY

    $env:ANTHROPIC_DEFAULT_SONNET_MODEL = "MiniMax-M3"
    $env:ANTHROPIC_DEFAULT_OPUS_MODEL = "MiniMax-M3"
    $env:ANTHROPIC_DEFAULT_HAIKU_MODEL = "MiniMax-M2.7"
    $env:CLAUDE_CODE_AUTO_COMPACT_WINDOW = "1000000"
    $env:API_TIMEOUT_MS = "3000000"
    $env:CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC = "1"
    &amp; claude @args
}

# DeepSeek
function claudedeepseek {
    Reset-ClaudeEnv
    $env:ANTHROPIC_BASE_URL = "https://api.deepseek.com/anthropic"
    $env:ANTHROPIC_AUTH_TOKEN = $GLOBAL_DEEPSEEK_KEY
    
    $env:ANTHROPIC_DEFAULT_SONNET_MODEL = "deepseek-v4-pro"
    $env:ANTHROPIC_DEFAULT_OPUS_MODEL = "deepseek-v4-pro"
    $env:ANTHROPIC_DEFAULT_HAIKU_MODEL = "deepseek-v4-flash"
    $env:CLAUDE_CODE_AUTO_COMPACT_WINDOW = "1000000"
    $env:API_TIMEOUT_MS = "3000000"
    $env:CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC = "1"
    &amp; claude @args
}

# Main Dispatcher (alias for `claude &lt;model> ...`)
# 命名原因: 避免与 Claude Code 可执行文件 `claude` 同名（PowerShell 函数遮蔽 exe）
Set-Alias -Name cc -Value claude-dispatch -Scope Global
function claude-dispatch {
    param(&#91;string]$Model, &#91;Parameter(ValueFromRemainingArguments = $true)] $Rest)
    switch ($Model) {
        "glm"      { claudeglm @Rest }
        "minimax"  { claudeminimax @Rest }
        "deepseek" { claudedeepseek @Rest }
        Default {
            Reset-ClaudeEnv
            if ($Model) { &amp; claude $Model @Rest } else { &amp; claude }
        }
    }
}</code></pre>



<p>关闭powershell 之后，重新打开就可以激活命令</p>



<pre class="wp-block-preformatted"><code>cc glm</code>      使用glm模型打开claude code
<code>cc deepseek</code> 使用deepseek模型打开claude code
<code>cc minimax</code>  使用minimax模型打开claude code
</pre>



<p></p>
<p><a rel="nofollow" href="https://wangqianhong.com/2025/12/claude-code-%e9%85%8d%e7%bd%ae%e5%a4%9a%e4%b8%aa%e5%bc%80%e6%ba%90%e6%a8%a1%e5%9e%8b/">Claude Code | 配置多模型</a>最先出现在<a rel="nofollow" href="https://wangqianhong.com">wqh博客</a>。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://wangqianhong.com/2025/12/claude-code-%e9%85%8d%e7%bd%ae%e5%a4%9a%e4%b8%aa%e5%bc%80%e6%ba%90%e6%a8%a1%e5%9e%8b/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
