Using the launch script
The recommended way to start Claude Code is with thelaunch.sh script:
- Checks for authentication credentials
- Starts the proxy (via Docker if available, otherwise as a background process)
- Launches Claude Code with the correct environment variables
- Handles proxy health checks and startup timeouts
What the launch script does
Check authentication
The script verifies that
~/.claude-copilot-auth.json exists. If not, it prompts you to run authentication first:Check for running proxy
It checks if a proxy is already running on the configured port by hitting the
/health endpoint:Start proxy if needed
If no proxy is running, it attempts to start one using Docker first (with
restart: always for persistence), falling back to a direct Node.js process if Docker is unavailable.Manual launch methods
You can also launch Claude Code manually using different approaches depending on your setup.- Docker (recommended)
- Direct Node.js
- With arguments
Start the proxy as a persistent Docker container:Then launch Claude Code:
Environment variables
The following environment variables configure the launch process:The port on which the proxy server runs. Must match between proxy and Claude Code.
Path to the saved GitHub Copilot authentication token.
Must be set to the proxy URL (e.g.,
http://localhost:18080) for Claude Code to connect to the proxy.Must be set to
copilot-proxy (or any non-empty value). The actual authentication uses the GitHub Copilot token.Launch scenarios
First-time setup
First-time setup
Daily use
Daily use
Custom port
Custom port
Multiple instances
Multiple instances
You can run multiple Claude Code instances by using different proxy ports:
Health checks
The proxy provides a/health endpoint that returns the server status:
Troubleshooting
Authentication error
Authentication error
If you see authentication errors:Your GitHub Copilot token may have expired. Re-run the auth script:
Port already in use
Port already in use
If the proxy port is already occupied:
Proxy fails to start
Proxy fails to start
If the proxy fails to start in Docker, the launch script automatically falls back to Node.js:Check Docker status:
Connection refused
Connection refused
If Claude Code can’t connect to the proxy:
-
Verify the proxy is running:
-
Check environment variables are set:
-
Ensure the port matches:
Next steps
Web search
Configure web search functionality
Model selection
Switch between available Claude models