cc-gateway  by motiful

AI API identity gateway for privacy-preserving telemetry

Created 1 week ago

New!

2,595 stars

Top 17.6% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

This project addresses privacy concerns with Claude Code's extensive telemetry and device fingerprinting, which can lead to account bans. CC Gateway acts as a reverse proxy, normalizing device identity, environment fingerprints, and telemetry to a single canonical profile. It empowers users to control their data, prevent cross-reference detection between telemetry and prompts, and mitigate risks associated with Anthropic's AI API usage.

How It Works

CC Gateway is a reverse proxy situated between Claude Code clients and the Anthropic API. It normalizes over 40 environment dimensions, device IDs, session metadata, and process metrics (e.g., RAM usage) to a canonical profile. It also sanitizes system prompts by rewriting environment blocks to match this profile, preventing correlation. A three-layer defense architecture combines client-side environment variables, network-level blocking via Clash rules, and the gateway's identity rewriting capabilities for comprehensive telemetry control.

Quick Start & Requirements

Install via git clone and npm install. Key setup steps include generating a canonical identity (npm run generate-identity) and a client token (npm run generate-token). Configuration requires editing config.yaml with generated tokens and an OAuth refresh token extracted via scripts/extract-token.sh from a logged-in Claude Code instance. The gateway can be run via npm run dev (development), npm run build && npm start (production), or docker-compose up -d. Client machines require specific environment variables (e.g., ANTHROPIC_BASE_URL) or the scripts/client-setup.sh script for automatic routing and authentication.

Highlighted Details

  • Full identity rewrite for device ID, email, and session metadata.
  • Replacement of 40+ environment dimensions (platform, Node.js version, etc.).
  • System prompt sanitization to prevent telemetry-prompt correlation.
  • Normalization of process metrics (physical RAM, heap size).
  • Centralized OAuth token management and auto-refresh.
  • Stripping of baseUrl and gateway fields from analytics events.

Maintenance & Community

The project is explicitly marked as "Alpha" and "under active development." Community engagement appears limited, with a link to follow the primary developer on Twitter (@whiletrue0x). No official community channels like Discord or Slack are listed.

Licensing & Compatibility

The project is released under the MIT license. However, it carries significant restrictions: it is strictly for "educational and research purposes only" and explicitly prohibits commercial use, account sharing, or any violation of Anthropic's Terms of Service.

Limitations & Caveats

Hardcoded MCP server endpoints (mcp-proxy.anthropic.com) bypass the gateway; users must employ Clash rules to block these if MCP is not required. Future updates to Claude Code may introduce new telemetry fields or endpoints, necessitating monitoring of network rejection logs for unexpected connection attempts. OAuth refresh tokens can expire, requiring periodic re-extraction and configuration.

Health Check
Last Commit

1 week ago

Responsiveness

Inactive

Pull Requests (30d)
4
Issues (30d)
18
Star History
2,612 stars in the last 11 days

Explore Similar Projects

Feedback? Help us improve.