copilot-claude-proxy

skill
Security Audit
Warn
Health Warn
  • License — License: GPL-3.0
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Low visibility — Only 5 GitHub stars
Code Pass
  • Code scan — Scanned 2 files during light audit, no dangerous patterns found
Permissions Pass
  • Permissions — No dangerous permissions requested

No AI report is available for this listing yet.

SUMMARY

A small Go proxy that exposes GitHub Copilot as an Anthropic-compatible API.

README.md

copilot-claude-proxy

A small Go proxy that exposes GitHub Copilot as an Anthropic-compatible API.

If you already pay for GitHub Copilot, you can use it as the backend for
Claude Code instead of an
Anthropic API key. Run the proxy, point Claude Code at it, and everything
works as usual. Copilot understands the same API that Claude Code speaks, so
the proxy doesn't need to translate anything: it just logs you into GitHub
and passes your requests along.

Quick start

Run it with go run (Go 1.25 or newer).

Authenticate with GitHub (device flow; opens your browser automatically):

$ go run github.com/fabrizio/copilot-claude-proxy/cmd/copilot-claude-proxy@latest auth

Generate the Claude Code configuration (interactive model selection):

$ go run github.com/fabrizio/copilot-claude-proxy/cmd/copilot-claude-proxy@latest setup

Run the proxy:

$ go run github.com/fabrizio/copilot-claude-proxy/cmd/copilot-claude-proxy@latest start

Then, in another terminal:

$ claude

Commands

Command Description
auth GitHub device-flow login; opens the browser and stores the token in the OS keyring
logout Remove the stored token from the OS keyring
start Run the proxy server (default 127.0.0.1:4141)
setup Generate Claude Code configuration pointing at this proxy
models List the models available on your Copilot account

start options

Flag Default Description
--port, -p 4141 Listen port
--host, -H 127.0.0.1 Bind host
--account-type, -a auto Copilot tier: auto, individual, business, enterprise (auto probes your plan)
--github-token, -g Token override (also GH_TOKEN / GITHUB_TOKEN env)
--model-map Extra aliases, repeatable: --model-map haiku=claude-haiku-4.5
--verbose, -v Debug logging

setup options

--model/-m and --small-model/-s skip the interactive selection (both or
neither). --with-extras/-e also writes opinionated tuning vars (telemetry off,
auto-compact window, and CLAUDE_CODE_ATTRIBUTION_HEADER=0, which fixes prompt
caching through Copilot). --yes/-y skips the overwrite confirmation.

Known issues

claude-fable-5 occasionally switches to Chinese

claude-fable-5 has a known bug where it can start responding (and thinking)
in Chinese mid-session. The fix is to pin the language in ~/.claude/CLAUDE.md
so Claude Code injects it into every session:

# User preferences

- Always respond and display your thinking in English, regardless of the
  language used in project files, documentation, or code comments.

setup prints a reminder about this whenever a fable-5 model is selected.

Building from source

$ git clone https://github.com/fabrizio/copilot-claude-proxy
$ cd copilot-claude-proxy
$ make build

Endpoints

Route Behavior
POST /v1/messages Enriched passthrough to Copilot's native Anthropic Messages API (streaming and non-streaming)
POST /v1/messages/count_tokens Local estimation (~4 chars/token, thinking blocks excluded)
GET /v1/models Anthropic-format list of usable models
POST /api/event_logging Swallows Anthropic SDK telemetry
GET /health Token/catalog health

Token storage

The GitHub OAuth token obtained by auth is stored in the operating system
keyring, and logout removes it. On headless systems without a keyring, pass
the token with --github-token or the GH_TOKEN/GITHUB_TOKEN environment
variables instead.

License

GPL-3.0

Reviews (0)

No results found