Use when routing Claude Code through a local LiteLLM proxy to GitHub Copilot, reducing direct Anthropic spend, configuring ANTHROPIC_BASE_URL or…
SaferSkills independently audited running-claude-code-via-litellm-copilot (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Use this skill for the specific workaround where Claude Code keeps its Anthropic-shaped client behavior, but the actual backend traffic is sent to a local LiteLLM proxy and then forwarded to GitHub Copilot.
Treat this as an advanced workaround, not an officially guaranteed GitHub workflow. Help the user succeed technically, but do not promise GitHub support, policy approval, or long-term compatibility.
This skill is guidance-first but execution-aware:
~/.claude/settings.json or shell profile files.Read references/doc-verified-notes.md before answering if you need to justify which parts come from the article and which parts were tightened against current LiteLLM docs.
Use this skill when the user wants any of the following:
config.yaml for LiteLLM's GitHub Copilot providerANTHROPIC_BASE_URL, ANTHROPIC_MODEL, or CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC setupDo not use this skill for:
Explain that this is a workaround based on a local proxy path, not a GitHub-promoted workflow, and the user must evaluate the latest Copilot terms and limits for themselves.
Start with temporary environment variables and a local config.yaml unless the user explicitly wants a persistent setup.
ANTHROPIC_MODEL and LiteLLM model_name identical.Exact string match matters more than clever explanation.
ANTHROPIC_AUTH_TOKEN as a local placeholder.Claude Code expects a non-empty value locally, but it is not the GitHub Copilot credential and should not be presented as a reusable secret.
~/.claude/settings.json wholesale.Merge only the needed env keys and preserve unrelated settings.
Check these first when the user wants real setup work:
claude --help succeedsuv --version or pip --version succeeds4000If the user only wants instructions, state the prerequisites instead of running them.
Use this rule:
For persistent setup, confirm the target file and then merge keys into ~/.claude/settings.json. Do not replace the file contents.
config.yamlStart from the article's flow, but keep the provider naming aligned with LiteLLM docs:
model_list:
- model_name: claude-opus-4.5
litellm_params:
model: github_copilot/claude-opus-4.5
drop_params: trueExplain the fields:
model_name: the logical name Claude Code will requestmodel: the LiteLLM provider route, using github_copilot/<model>drop_params: true: strips unsupported Anthropic-specific fields before forwarding to CopilotIf the user wants a different Copilot-backed model, keep the same pattern:
model_list:
- model_name: <logical-name>
litellm_params:
model: github_copilot/<copilot-model>
drop_params: trueDo not hardcode extra headers into the default path unless the user already hit a rejection that suggests header overrides are needed.
Preferred install:
uv tool install "litellm[proxy]"Fallback:
pip install "litellm[proxy]"Start the proxy from the directory containing config.yaml:
litellm --config config.yaml --port 4000Tell the user to keep that terminal open because the logs are the fastest truth source during verification.
On the first successful request to the GitHub Copilot provider, LiteLLM may open a device authorization flow:
Optional token-location overrides exist:
GITHUB_COPILOT_TOKEN_DIRGITHUB_COPILOT_ACCESS_TOKEN_FILEOnly mention these when the user needs custom token storage, shared environments, or troubleshooting around expired or misplaced credentials.
For a temporary PowerShell session:
$env:ANTHROPIC_AUTH_TOKEN = "sk-any-string"
$env:ANTHROPIC_BASE_URL = "http://localhost:4000"
$env:ANTHROPIC_MODEL = "claude-opus-4.5"
$env:CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC = "1"
claudeFor a temporary Bash or Zsh session:
export ANTHROPIC_AUTH_TOKEN="sk-any-string"
export ANTHROPIC_BASE_URL="http://localhost:4000"
export ANTHROPIC_MODEL="claude-opus-4.5"
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
claudeFor persistent configuration, merge these keys into ~/.claude/settings.json:
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "sk-any-string",
"ANTHROPIC_BASE_URL": "http://localhost:4000",
"ANTHROPIC_MODEL": "claude-opus-4.5",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
}
}Merge-safe behavior:
env entries that are unrelated to this workflowUse two terminals when possible:
claudeAsk for one small prompt such as a short script or code review request, then verify:
github_copilot/<model>The healthy path is:
Claude Code -> LiteLLM -> GitHub Copilot -> LiteLLM -> Claude CodeIf Claude Code reports model-not-found, 404-like failures, or LiteLLM says the model does not exist:
ANTHROPIC_MODEL to model_name exactlyIf LiteLLM never receives a request:
ANTHROPIC_BASE_URL points to <http://localhost:4000>claudeIf LiteLLM reaches GitHub Copilot but gets 401 or 403 responses:
The article uses explicit Copilot-style headers. Current LiteLLM docs expose GitHub Copilot as a provider and also document header override support.
Only reach for explicit extra_headers when:
Example fallback:
model_list:
- model_name: claude-opus-4.5
litellm_params:
model: github_copilot/claude-opus-4.5
drop_params: true
extra_headers:
editor-version: "vscode/1.85.1"
editor-plugin-version: "copilot/1.155.0"
Copilot-Integration-Id: "vscode-chat"
user-agent: "GithubCopilot/1.155.0"Present this as an advanced fallback, not the universal default.
When answering a real user request with this skill, include:
config.yaml or the delta to applyANTHROPIC_AUTH_TOKEN is a real Copilot credential.~/.claude/settings.json wholesale.github_copilot/<model> pattern and note that Copilot-exposed model availability may change.~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.