You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在GitHub Copilot Chat中设置持久化默认模型?

解决GitHub Copilot Chat默认模型及对话续用问题

一、设置全局默认模型为Claude

目前GitHub Copilot官方UI设置中未提供直接修改默认模型的选项,可通过以下两种方式尝试实现:

  • 浏览器脚本自动切换:使用Tampermonkey等用户脚本工具,编写脚本在页面加载时自动将Copilot Chat的模型切换为Claude。核心逻辑是监听页面元素加载,定位模型选择下拉框并触发Claude选项的选择操作。示例脚本结构如下:
// ==UserScript==
// @name         Set Copilot Default to Claude
// @match        https://github.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    const observer = new MutationObserver((mutations) => {
        const modelSelector = document.querySelector('[data-testid="copilot-chat-model-selector"]');
        if (modelSelector) {
            const claudeOption = Array.from(modelSelector.options).find(opt => opt.text.includes('Claude'));
            if (claudeOption) {
                claudeOption.selected = true;
                modelSelector.dispatchEvent(new Event('change'));
                observer.disconnect();
            }
        }
    });
    observer.observe(document.body, { childList: true, subtree: true });
})();

注意:脚本中的元素选择器需匹配GitHub当前UI结构,若页面更新需同步调整选择器。

  • 预览功能配置:若你已加入GitHub Copilot预览计划,可前往Copilot设置页面的「预览功能」板块,查看是否新增了默认模型配置选项(该功能仅部分预览用户可见)。

二、使用偏好模型续用现有对话

GitHub Copilot的对话与初始选择的模型绑定,无法直接切换现有对话的模型,但可通过以下方式间接实现上下文延续:

  • 复制历史到新对话:打开目标对话,全选并复制所有历史内容,新建一个选择Claude模型的对话,粘贴历史内容后继续提问,即可基于原上下文使用Claude。
  • 尝试导入对话功能:部分场景下,Copilot支持导入对话链接,你可将现有对话的链接导入到新的Claude对话中(需确认该功能对Claude模型开放)。

内容的提问来源于stack exchange,提问作者Krishanu Kabir Sparsha

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.12 16:19:51