cc-proxy-plugin: Instructions file for Claude Code

CLAUDE.md

cc-proxy-plugin CLAUDE.md is an instructions file for Claude Code from betmoar/cc-proxy-plugin. It costs 3,741 tokens per session, scanned B, original, MIT.

Project instructions for maintaining cc-proxy, a local HTTP proxy that routes Claude Code requests to different AI model providers.

In plain words
What is it for?
Use them when modifying cc-proxy, especially its request forwarding, providers, tests, or operational documentation.
Why use it?
They document the proxy’s architecture, operating rules, tests, provider-specific checks, and related files so changes do not break its routing behaviour.

Instructions file for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: reads .claude/ paths; mentions .claude-plugin; mentions Claude Code.

This is betmoar/cc-proxy-plugin's own configuration. It tells Claude Code how to work on cc-proxy-plugin itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything cc-proxy-plugin configures →

Reuse

Borrowing it

Nothing to install: this file belongs to betmoar/cc-proxy-plugin. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/betmoar/cc-proxy-plugin/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/betmoar/cc-proxy-plugin

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cc-proxy-plugin CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/betmoar/cc-proxy-plugin/claude-md/github.svg)](https://agentmods.dev/instructions/betmoar/cc-proxy-plugin/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/betmoar/cc-proxy-plugin/claude-md"><img src="https://agentmods.dev/badge/instructions/betmoar/cc-proxy-plugin/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cc-proxy-plugin CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/betmoar/cc-proxy-plugin/claude-md"><img src="https://agentmods.dev/badge/instructions/betmoar/cc-proxy-plugin/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,741 This file is loaded in full into every session.
When invoked 3,741 The same file — it is already loaded in full.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.03741 $0.03741
Opus 5.5 $0.01496 $0.01496
Sonnet 5.5 $0.00748 $0.00748
Haiku 4.5 $0.00374 $0.00374

Measured 1mo ago against content hash 267ff5478ebc, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

cc-proxy-plugin CLAUDE.md scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

| 7 | `scripts/render-model-picker.js` `writeSettings()` | corrupts or forks the user's `~/.claude/settings.json` |
CLAUDE.md · 204 lines

How it starts

The opening of the file, as written. The whole thing — 204 lines — stays where its author put it; the contents beside it link to each section on GitHub.

cc-proxy — maintainer handoff

A local HTTP proxy that lets Claude Code use GLM (Z.ai), OpenRouter, DeepSeek, Qwen, LM Studio (self-hosted, lmstudio: selector only) and Claude in one session. Claude Code points ANTHROPIC_BASE_URL at it; the proxy routes each request by model name and forwards. That is the whole product. Resist making it more than that.

This file carries the rules. The evidence behind each rule (measurements, histories, refuted alternatives) is in docs/MAINTAINING.md; read the matching section there before reversing anything here.

Read next: docs/ARCHITECTURE.md (design and why), docs/ROUTING.md / docs/DISCOVERY.md / docs/CONFIGURATION.md (the user-facing contracts), docs/OPERATIONS.md (runtime), docs/RELEASING.md, docs/BACKLOG.md (open work and why past decisions went the way they did), CONTRIBUTING.md (add-a-provider procedure).

Gates

  • pnpm check (= pnpm lint && pnpm test) before any commit; CI runs the same. The suite spins real local HTTP backends: if you change forwarding and no test fails, you have not tested it. Add one.
  • pnpm probe:vendors is the MANUAL gate for claims about someone else's server. Never in pnpm check (real keys, real quota). It exits 1 when a vendor stops behaving the way a source comment says. Run it when you touch routing or forwarding, or when a probe date in a comment looks old.
  • Node 22 or newer. .npmrc is engine-strict because process.loadEnvFile is how ~/.env is read.

Invariants (breaking one is a design decision, not a refactor)

Each is locked by tests; the test names tell you what you broke.

  1. Transparent pipe. Auth and headers only. The full inbound path including the query string reaches upstream; bodies forwarded byte for byte. Four body exceptions and two header exceptions (hop-by-hop dropped; the upstream's own x-request-id dropped, because writeHead replaces what setHeader put there). The first three body strips share one shape — a spelling the CLIENT uses that no BACKEND knows: thinking-strip, <provider>: selector strip, [1m] suffix strip. The fourth is the INVERSE shape — history a BACKEND produced that the destination backend rejects wholesale (GLM's own server_tool_use calls) — and is DIRECTIONAL for that reason: claude route only, since the same history is legal input to the backend that made it. It removes MESSAGES too, not just blocks, because content: [] is its own 400. → server.test.js "query string is preserved…", "provider selector strip…", "routing log annotates the normalized id…", "keeps the proxy's x-request-id when the upstream sets its own…", "no message reaches upstream with an EMPTY content array"
  2. Stateless. No breakers, no on-disk state, no in-proxy waiting. Rate limits inject Retry-After and let the client back off. → "…1302 … gets a Retry-After", "1313 … no Retry-After"
  3. Credential isolation. Inbound Authorization/x-api-key never reach a third party; the Claude route passes them through (OAuth). Never set ANTHROPIC_API_KEY in a settings template; it shadows OAuth. → providers.test.js "…drops an inbound x-api-key…"
  4. claude-haiku-* pins to Claude. The pin tests the STRIPPED tail; pinning the raw id lets glm:claude-haiku-… skip it. → router.test.js
  5. Anthropic Messages only. No OpenAI-to-Anthropic translation, ever. The media tunnel forwards a DashScope body byte for byte and is not an exception. → models.test.js "media generation tunnel (issue #40)"
  6. Client abort propagates upstream, or a cancelled turn bills into a dead socket. → "client abort mid-stream aborts the upstream request"
  7. Loopback bind by default. PROXY_HOST is the explicit opt-out; PROXY_AUTH_TOKEN makes it safe. → config.test.js
  8. One bad request never ends the process. No uncaughtException handler exists; every dispatch point contains its own throws (a JSON null body used to exit the process for every session). → server.test.js "dispatcher containment (a bad request never ends the process)"

Read the full file on GitHub · 204 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · -111 lines · -3,170 tokens per session 267ff5478ebc
  2. 1mo ago Changed · +11 lines · +525 tokens per session 9584844e8dd1
  3. 1mo ago Changed · +16 lines · +1,090 tokens per session 7e6d73295622
  4. 1mo ago First seen · 288 lines · 5,296 tokens per session scan B 7459a651c238

Subscribe to this mod's changes

cc-proxy-plugin CLAUDE.md is an instructions file published in the GitHub repository betmoar/cc-proxy-plugin (12 stars, last pushed 1mo ago), licensed MIT. It adds 3,741 tokens to every session, about $0.0150 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 9,715 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,461 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,750 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 4,261 tokens