running-claude-code-via-litellm-copilot▌
xixu-me/skills · updated Apr 8, 2026
MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.
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.
Running Claude Code via LiteLLM and GitHub Copilot
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:
- Claude Code to run against GitHub Copilot through LiteLLM
- lower direct Anthropic API spending while keeping the Claude Code workflow
- a local
config.yamlfor LiteLLM's GitHub Copilot provider ANTHROPIC_BASE_URL,ANTHROPIC_MODEL, orCLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFICsetup- help understanding GitHub device authorization during LiteLLM startup
- help with model mismatch, 404-like errors, no requests reaching LiteLLM, or GitHub 401/403 failures
Do not use this skill for:
- deciding whether the workaround is allowed by GitHub terms
- general LiteLLM architecture unrelated to Claude Code plus Copilot
- direct Anthropic API setup with no Copilot or LiteLLM component
Core Rules
- Lead with a short compliance caveat. 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.
- Prefer the minimum viable path first.
Start with temporary environment variables and a local
config.yamlunless the user explicitly wants a persistent setup. - Keep
ANTHROPIC_MODELand LiteLLMmodel_nameidentical. Exact string match matters more than clever explanation. - Treat
ANTHROPIC_AUTH_TOKENas 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. - Never overwrite
~/.claude/settings.jsonwholesale. Merge only the neededenvkeys and preserve unrelated settings.
Workflow
1. Preflight
Check these first when the user wants real setup work:
claude --helpsucceedsuv --versionorpip --versionsucceeds- the user has GitHub Copilot access
- the intended LiteLLM port is available, usually
4000
If the user only wants instructions, state the prerequisites instead of running them.
2. Choose Temporary vs Persistent Setup
Use this rule:
- Temporary setup: preferred default for first-time setup, debugging, and low-risk trials
- Persistent setup: only when the user explicitly wants the proxy path to apply every time Claude Code starts
For persistent setup, confirm the target file and then merge keys into ~/.claude/settings.json. Do not replace the file contents.
3. Create LiteLLM config.yaml
Start 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: true
Explain the fields:
model_name: the logical name Claude Code will requestmodel: the LiteLLM provider route, usinggithub_copilot/<model>drop_params: true: strips unsupported Anthropic-specific fields before forwarding to Copilot
If 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: true
Do not hardcode extra headers into the default path unless the user already hit a rejection that suggests header overrides are needed.
4. Install and Start LiteLLM
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 4000
Tell the user to keep that terminal open because the logs are the fastest truth source during verification.
5. Explain GitHub Device Authorization
On the first successful request to the GitHub Copilot provider, LiteLLM may open a device authorization flow:
- LiteLLM prints a verification URL and device code
- the user opens the URL and approves the request
- LiteLLM stores the resulting credential locally for future use
Optional token-location overrides exist:
GITHUB_COPILOT_TOKEN_DIRGITHUB_COPILOT_ACCESS_TOKEN_FILE
Only mention these when the user needs custom token storage, shared environments, or troubleshooting around expired or misplaced credentials.
6. Configure Claude Code
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"
claude
For 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
claude
For 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:
- if the file does not exist, create it
- if it exists, preserve all unrelated top-level keys
- preserve existing
enventries that are unrelated to this workflow - update only the four keys above
- if the JSON is malformed, stop and report the parse problem instead of overwriting the file
7. Verify The Request Chain
Use two terminals when possible:
- Terminal A runs LiteLLM
- Terminal B runs
claude
Ask for one small prompt such as a short script or code review request, then verify:
- Claude Code starts normally
- LiteLLM logs show an inbound request
- LiteLLM logs indicate the GitHub Copilot model route, typically
github_copilot/<model>
The healthy path is:
Claude Code -> LiteLLM -> GitHub Copilot -> LiteLLM -> Claude Code
8. Troubleshooting
If Claude Code reports model-not-found, 404-like failures, or LiteLLM says the model does not exist:
- compare
ANTHROPIC_MODELtomodel_nameexactly - check case, punctuation, and hyphens
If LiteLLM never receives a request:
- confirm
ANTHROPIC_BASE_URLpoints to http://localhost:4000 - confirm LiteLLM is still running on that port
- confirm the environment variables were set in the same shell session that launched
claude - check local firewall or port conflicts if the URL is correct but still silent
If LiteLLM reaches GitHub Copilot but gets 401 or 403 responses:
- repeat the device authorization flow by restarting LiteLLM and retrying
- confirm the GitHub account still has Copilot access
- if custom token-directory variables are set, verify they point to the intended files
Advanced Fallback: Header Overrides
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:
- the basic provider flow reaches Copilot but still needs client-shape overrides
- the user already has evidence that a specific environment behaves better with editor-style headers
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.
Output Checklist
When answering a real user request with this skill, include:
- the brief compliance caveat
- the exact
config.yamlor the delta to apply - shell-appropriate commands
- whether the setup is temporary or persistent
- the verification path
- the smallest relevant troubleshooting section if something failed
Safety Reminders
- Do not state that GitHub officially supports this workaround.
- Do not imply that a dummy
ANTHROPIC_AUTH_TOKENis a real Copilot credential. - Do not recommend replacing
~/.claude/settings.jsonwholesale. - Do not present stale model names as guaranteed current availability; if the user asks for a specific model, keep the
github_copilot/<model>pattern and note that Copilot-exposed model availability may change.
How to use running-claude-code-via-litellm-copilot on Cursor
AI-first code editor with Composer
Prerequisites
Before installing skills in Cursor, ensure your development environment meets these requirements:
- ›Cursor installed and configured on your development machine
- ›Node.js version 16.0+ with npm package manager (verify with
node --version) - ›Active project directory or workspace where you want to add running-claude-code-via-litellm-copilot
Execute installation command
Execute the skills CLI command in your project's root directory to begin installation:
The skills CLI fetches running-claude-code-via-litellm-copilot from GitHub repository xixu-me/skills and configures it for Cursor.
Select Cursor when prompted
The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:
Verify installation
Confirm successful installation by checking the skill directory location:
Reload or restart Cursor to activate running-claude-code-via-litellm-copilot. Access the skill through slash commands (e.g., /running-claude-code-via-litellm-copilot) or your agent's skill management interface.
Security & Verification Notice
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.
List & Monetize Your Skill
Submit your Claude Code skill and start earning
Use Cases▌
Task Automation & Efficiency
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Knowledge Enhancement
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Quality Improvement
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
Implementation Guide▌
Prerequisites
- ›Claude Desktop or compatible AI client with skill support
- ›Clear understanding of task or problem to solve
- ›Willingness to iterate and refine outputs
Time Estimate
15-45 minutes depending on use case complexity
Installation Steps
- 1.Install skill using provided installation command
- 2.Test with simple use case relevant to your work
- 3.Evaluate output quality and relevance
- 4.Iterate on prompts to improve results
- 5.Integrate into regular workflow if valuable
Common Pitfalls
- ⚠Expecting perfect results without iteration
- ⚠Not providing enough context in prompts
- ⚠Using skill for tasks outside its intended scope
- ⚠Accepting outputs without review and validation
Best Practices▌
✓ Do
- +Start with clear, specific prompts
- +Provide relevant context and constraints
- +Review and refine all outputs before using
- +Iterate to improve output quality
- +Document successful prompt patterns
✗ Don't
- −Don't use without understanding skill limitations
- −Don't skip validation of outputs
- −Don't share sensitive information in prompts
- −Don't expect skill to replace human judgment
💡 Pro Tips
- ★Be specific about desired format and style
- ★Ask for multiple options to choose from
- ★Request explanations to understand reasoning
- ★Combine AI efficiency with human expertise
When to Use This▌
✓ Use When
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid When
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
Learning Path▌
- 1Familiarize yourself with skill capabilities and limitations
- 2Start with low-risk, non-critical tasks
- 3Progress to more complex and valuable use cases
- 4Build expertise through regular use and experimentation
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.6★★★★★70 reviews- ★★★★★Lucas Kapoor· Dec 24, 2024
running-claude-code-via-litellm-copilot reduced setup friction for our internal harness; good balance of opinion and flexibility.
- ★★★★★Layla Thomas· Dec 20, 2024
running-claude-code-via-litellm-copilot reduced setup friction for our internal harness; good balance of opinion and flexibility.
- ★★★★★Isabella Okafor· Dec 16, 2024
I recommend running-claude-code-via-litellm-copilot for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- ★★★★★Zaid Thompson· Dec 12, 2024
We added running-claude-code-via-litellm-copilot from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Sofia Iyer· Dec 8, 2024
Registry listing for running-claude-code-via-litellm-copilot matched our evaluation — installs cleanly and behaves as described in the markdown.
- ★★★★★Aarav Okafor· Dec 8, 2024
running-claude-code-via-litellm-copilot is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- ★★★★★Layla Jackson· Dec 4, 2024
Keeps context tight: running-claude-code-via-litellm-copilot is the kind of skill you can hand to a new teammate without a long onboarding doc.
- ★★★★★Zaid Johnson· Nov 27, 2024
running-claude-code-via-litellm-copilot fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Lucas Khanna· Nov 27, 2024
Registry listing for running-claude-code-via-litellm-copilot matched our evaluation — installs cleanly and behaves as described in the markdown.
- ★★★★★Yuki Park· Nov 23, 2024
We added running-claude-code-via-litellm-copilot from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
showing 1-10 of 70