running-claude-code-via-litellm-copilot
Route Claude Code through a local LiteLLM proxy to GitHub Copilot, reducing direct Anthropic API spend.
- Advanced workaround (not officially GitHub-endorsed) that intercepts Claude Code's Anthropic-shaped requests and forwards them through LiteLLM to GitHub Copilot
- Requires local
config.yamlsetup for LiteLLM with GitHub Copilot provider routing, plus four environment variables (ANTHROPIC_BASE_URL,ANTHROPIC_MODEL,ANTHROPIC_AUTH_TOKEN,CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC) - Handles GitHub device authorization flow automatically on first request and supports persistent or temporary configuration via shell exports or
~/.claude/settings.jsonmerging - Includes troubleshooting for model mismatches, missing requests, GitHub 401/403 errors, and port conflicts; optional header overrides for edge cases
Overview
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:
- If the user wants explanation only, provide the smallest correct set of files, commands, and checks.
- If the user wants real setup work on the current machine, inspect first and adapt commands to the active shell and OS.
- Pause before persistent edits such as
~/.claude/settings.jsonor 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.
When To Use
Use this skill when the user wants any of the following:
Explore more of GLSRM
