github-router CLAUDE.md

github-router CLAUDE.md is an instructions file for coding agents from animeshkundu/github-router. It costs 30,706 tokens per session, scanned C, original, MIT.

A set of project instructions for github-router, a reverse proxy that lets GitHub Copilot work through APIs used by OpenAI and Anthropic tools.

In plain words
What is it for?
Use it when developing or testing github-router, especially when checking Windows compatibility, choosing supported models, or running the correct test command.
Why use it?
It tells contributors which operating system, license, models, commands, and test rules the project treats as authoritative.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/animeshkundu/github-router/claude-md
Clone the repo
git clone --depth 1 https://github.com/animeshkundu/github-router

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 github-router CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/animeshkundu/github-router/claude-md.svg)](https://agentmods.dev/instructions/animeshkundu/github-router/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/animeshkundu/github-router/claude-md"><img src="https://agentmods.dev/badge/instructions/animeshkundu/github-router/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 30,706 This file is loaded in full into every session.
When invoked 30,706 The same file — it is already loaded in full.
Security scan C 2 findings. Scan, not verified.
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 $0.30706 $0.30706
Opus 5 $0.15353 $0.15353
Sonnet 5 $0.06141 $0.06141
Haiku 4.5 $0.03071 $0.03071

Measured 4d ago against content hash 0dc411a817e7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

github-router CLAUDE.md scanned grade C with 2 findings 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 4d 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.

Reaches for credential fileshighPrivilege escalation

SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.

`/mcp` also exposes three **worker tools** (group `workers`: `explore` read-only, `review` read + `bash`, `implement` read+write — `explore`/`implement` were `worker_explore`/`worker_implement`) that delegate scoped work

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

bad assertion: the `node:child_process` spawn mock in
CLAUDE.md · 292 lines

How it starts

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

github-router

A reverse proxy that exposes GitHub Copilot as OpenAI and Anthropic compatible API endpoints.

Primary deployment target

The primary deployment target for this project is Windows 11. macOS and Linux are supported and tested, but Windows is the canonical user environment — every PR must pass the windows-latest CI job before merge. A Windows CI failure is treated as a merge blocker, not as flake. If Windows behavior diverges from POSIX, the Windows path is the authoritative one to fix; do not POSIX-skip a Windows failure to land a change.

The canonical end-user setup is Windows 11 + Claude Code (the CLI client) + a GitHub Copilot Enterprise license. The enterprise license is load-bearing for feature decisions: it unlocks catalog models gated restricted_to: ["enterprise"] and the 1M-context Opus variants — claude-opus-5 (the spawned-Claude-Code default, stand_in's Opus row, and opus_critic's model; the single base slug already advertises max_context_window_tokens: 1_000_000 — no -1m sibling needed). When choosing models or windows, assume the enterprise catalog is present (prefer the 1M variants), but always gate on the live catalog with a non-enterprise fallback so the proxy still works on lesser tiers.

Design docs

  • docs/peer-mcp-design.md — current architecture and phased migration plan for the peer-model MCP integration (codex_critic gpt-5.6-sol, codex_reviewer gpt-5.3-codex, gemini_critic gemini-3.1-pro), plus the deployed-state section covering auto-invocation triggers, allowedEfforts, the latency-by-effort matrix, and the predictedTooLong cap. Read this before changing anything in src/routes/mcp/, src/lib/peer-mcp-personas.ts, or src/lib/codex-mcp-config.ts.
  • docs/first-mate-design.md — shipped --agents first-mate design: deterministic controller, dual-token GitHub write auth, durable ledgers/decisions, cloud-agent service layer, the deny-by-default GH_ROUTER_FM_SCAFFOLD_REPOS write allowlist for scaffold_repo, and human-bound merge gate. Read before touching src/lib/first-mate/, src/lib/agent/, or the agents MCP gate.
  • docs/research/peer-mcp-investigation.md — multi-stage adversarial-review log behind the design: GitHub-issue refs (#50289 etc.), peer-critic verdicts at each iteration, the 7-batch sweep that proved decomposition works, and the concurrency-cap investigation. Read this when you want to know why a particular Phase ordering or specific value (cap=8, retention=30min, partial-buffer cap=1MB) was chosen.
  • docs/research/stage-c-perf-spikes.md — measured request-prologue and startup-path spikes. Read before proposing a /v1/messages prologue optimization or moving startup work off the pre-listen path: the current verdict is defer/reclassify pending shutdown body-size percentiles and a readiness-safe split.
  • docs/research/shim-prompt-fidelity.md — measured A/B of Claude Code's verbatim system prompt against gpt-5.6-sol and gemini-3.1-pro-preview through the shim, with FILE_TOOL_GUIDANCE on vs off. Records which task shapes discriminate (appending to a file; the read/grep cases do not), that the steering block is what stops both models writing files through the shell, the residual gemini wc -l preference, and the gpt identity-capture artifact. Read before adding per-model prompt steering — the evidence says don't.
  • docs/publishing.md — npm/Docker release flow (OIDC trusted publishing), upgrade procedure for a running proxy, and the UPSTREAM_FETCH_TIMEOUT_MS / UPSTREAM_INACTIVITY_TIMEOUT_MS tunables.
  • docs/beta-headers.mdanthropic-beta allowlist (3 stealth vs 20 leverage prefixes), the EXPLICITLY_STRIPPED_BETA_PREFIXES deny-list, body-field strips (budget, output_config.schema, betas, eager_input_streaming), and the stealth-vs-leverage policy rationale.
  • docs/gateway-error-contract.md — Claude Code's capability_rejected: <class> gateway contract: how the proxy tells the client WHY an upstream 400/413 happened so the client runs its own recovery instead of stranding. Covers the two classes emitted today (prompt_too_long, max_tokens_context_overflow), the verified dual matcher (IZ(e) = wording || token), why Copilot's "exceeds the context window" wording on a 400 used to classify as nothing and brick a long session, and the classes we still hand-roll. Read before changing forwardError / classifyOverflow in src/lib/error.ts.
  • docs/claude-env-injection.md — the five experimental CLAUDE_CODE_* env vars github-router claude auto-enables (presence-based guard), per-feature opt-out, the catalog-derived CLAUDE_CODE_AUTO_COMPACT_WINDOW integer (all profiles), and how CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY is now CONDITIONALLY enabled (cache-seeded) while its network-fetch path stays closed.
  • docs/anthropic-translation-shim.md — the /v1/messages translation shim that runs Claude Code's main loop on non-Claude Copilot models (gpt-5.5, gpt-5.3-codex via /responses; gemini-3.5-flash, gemini-3.1-pro-preview via /chat/completions): the classifier routing table + fail-closed Claude guard, the shared provider-neutral IR, the Responses vs Chat egress, the C1 buffer-tools-emit-atomically streaming model (and the parallel-tool-args-lost bug it fixes), the stream-ordering contract dependency + Phase 5 E2E backstop, the stop/parallel_tool_calls field forwarding, the inherent Copilot model gaps, and the Phase 3 gateway-cache-seed native-selection mechanism. Read before touching src/lib/anthropic-translate/, the /v1/messages branch in src/routes/messages/handler.ts, or the Phase 3 helpers in src/lib/server-setup.ts.
  • docs/multimodal.md — how images reach a model (producers → MCP text|image result union → the tool-result follow-up message → the single outbound vision preflight), the measured token cost of getting it wrong (base64 is ~1.46 chars/token, so a 200 KB screenshot is ~187k tokens versus ~1.5k as a native image block), the image-level replacement policy for malformed or unsupported inputs, upstream-ceiling prune-and-learn retry behaviour, peer imagePaths and why it takes paths rather than base64, the per-result image byte budget, and the capability register + scheduled drift alert that catch the next advertised-but-unplumbed capability. Read this before touching src/lib/attachments.ts, src/lib/vision-preflight.ts, src/lib/peer-attachments.ts, or src/lib/catalog-capability-register.ts.
  • docs/unsupported-features.md — Files API 404, ADVISOR Phase I server-side wiring, mcp_servers fail-fast 400, Bridge/CCR strip, and other Anthropic surfaces with no Copilot equivalent.
  • docs/default-models.mdclaudeclaude-opus-5 (Anthropic dashed slug, NOT the Copilot dotted slug — /model UI registry mismatch), codexgpt-5.6-sol, fallback chain led by gpt-5.5, the dual-signal [1m] detector (sibling-slug regex OR base-slug max_context_window_tokens), and the ANTHROPIC_SMALL_FAST_MODEL default. Fast profile (shipped in this change): a Luna-led -m fast launch profile distinct from budget mode, three Luna effort aliases, a replaced 4-row gateway picker (Sol/Luna/Gemini 3.7 Flash/Grok 4.6), Grok's conservative context accounting, and a Gemini 3.7 Flash Advisor that remains primary-lead-only across every fixed /model selection — see the "Fast launch profile" section of that doc. Context-window safety (all profiles): Claude Code's [1m] budgets against the advertised TOTAL window while Copilot enforces a smaller max_prompt_tokens (Luna 922K, Opus 5 936K), putting the client's own compaction threshold ABOVE the ceiling; every launch now injects a catalog-derived decimal-integer CLAUDE_CODE_AUTO_COMPACT_WINDOW, minimizing floor(prompt*0.85)+min(output,20_000)+13_000 across every reachable [1m] lead/tier/custom/gateway model (deriveAutoCompactWindowTokens in src/lib/grok-context.ts). /model cannot mutate it; Claude Code applies min(locallyRecognizedModelWindow, launchValue), and native subagents inherit the same env. It MUST be an integer — that env path is parseInt-based, so "1m" becomes 1, floors to 100,000, and compacts a 1M session every ~52K tokens.
  • docs/auth-isolation.mdSTRIPPED_PARENT_ENV_KEYS parent-env sanitize, CLAUDE_CONFIG_DIR snapshot mirror (ISOLATED / SHARED / MIRRORED policy), synthetic claudeAiOauth credential schema, synthetic .claude.json onboarding-skip injection (hasCompletedOnboarding / bypassPermissionsModeAccepted / synthetic oauthAccount — required so fresh-machine launches don't trigger Claude Code's first-launch OAuth wizard), keychain isolation, no-401 invariant, agent-teams fix, and trade-offs.
  • docs/web-search.md — Copilot /mcp wire flow with X-MCP-Toolsets: web_search, GitHub PAT auth, model-agnostic out-of-band fulfilment, and the COPILOT_HOST_ALLOWLIST PAT-exfiltration safeguard.
  • docs/pi-vendor-sync.md — vendor-sync protocol for src/vendor/pi/ (Pi agent runtime backing worker_explore / worker_implement): how to refresh from upstream, which files MUST stay in sync, which slices were deliberately omitted, and the MIT-attribution invariant.
  • docs/browser-mcp-design.md — architecture for the --browse flag's browser_* tool suite (15 tools driving Chrome/Edge via a from-scratch MV3 extension + native-messaging bridge). Covers the install-detection / auto-install / install_required flow, the dual-layer navigation block, the stable extension ID derivation, per-OS NMH paths (registry on Windows, file on POSIX), Bun-vs-Node bridge-runtime gotcha, and the Playwright E2E harness gated on GH_ROUTER_RUN_BROWSER_E2E=1. Read this before touching src/lib/browser-mcp/, src/browser-bridge/, or src/browser-ext/.
  • docs/semantic-search.md + docs/research/colbert-sidecar-design.md — ColBERT/PLAID semantic search (the default mode: "semantic" of the unified code MCP tool, via the router-managed colgrep sidecar; there is no standalone semantic_search tool). Covers the on-by-default provision + background-index, the availability-based colbertSearchEnabled() leaf (which semanticSearchEnabled() delegates to), the contract split (the runner stays no-lexical-fallback; the merged code tool's semantic mode DOES fall back to lexical and labels source), the git freshness verdict (the staleness correctness guard), the CLI-per-invocation lifecycle (PID ledger + tree-kill + boot sweep), and the SHA-pinned supply chain that closes colgrep's unverified ORT/model downloads. Read before touching src/lib/colbert/ or src/lib/unified-code-search.ts.
  • docs/process-teardown.md — deterministic child-process teardown for the launched CLI: the canonical killChildProcessTree helper, the extension-conditioned Windows spawn (windowsLaunchNeedsShell — real .exe spawned direct, only .cmd/.bat keep cmd.exe), POSIX detached:true + SIGINT/SIGTERM forwarding, and the crash-safe net: on Windows the runtime's KILL_ON_JOB_CLOSE Job Object already reaps the tree (a startProcessGuard no-op there, asserted by a regression canary), on POSIX a detached start-time-verified node -e reaper in src/lib/process-guard/ (inherited-pipe-EOF parent-death signal, skip-when-uncertain). Documents which exit paths are deterministic vs best-effort. Read before touching cleanup() in src/lib/launch.ts or src/lib/process-guard/.
  • docs/serve-control-plane.md — the github-router serve browser control plane: launches CloudCLI (@cloudcli-ai/cloudcli, AGPL) as a separate arm's-length process and reverse-proxies it under github-router's own origin with zero-login (localStorage['auth-token'] HTML injection). Covers the Option-B reverse-proxy architecture (src/lib/serve/), the security model (loopback bind, proxy-side Origin enforcement CloudCLI lacks, filtered child env stripping GITHUB_TOKEN/ANTHROPIC_AUTH_TOKEN/etc., JWT-on not VITE_IS_PLATFORM), the pinned router-owned install (never global/@latest), and the MIT-vs-AGPL mere-aggregation stance (NOTICE + scripts/check-pack-no-agpl.mjs release guard). Read before touching src/serve.ts or src/lib/serve/.

Read the full file on GitHub · 292 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. 4d ago First seen · 292 lines · 30,706 tokens per session scan C 0dc411a817e7

Subscribe to this mod's changes

github-router CLAUDE.md is an instructions file published in the GitHub repository animeshkundu/github-router (5 stars, last pushed 4d ago), licensed MIT. It adds 30,706 tokens to every session, about $0.1535 per session on Opus 5. A static security scan graded it C with 2 findings (reaches for credential files, runs shell commands). 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

wyoming_openai AGENTS.md

Instructions for roryeckel/wyoming_openai, covering agents.md, project overview, development commands, testing and install development dependencies.

roryeckel/wyoming_openai · 799 tokens

wyoming_openai CLAUDE.md

Instructions for roryeckel/wyoming_openai, a project described as: OpenAI-Compatible Proxy Middleware for the Wyoming Protocol.

roryeckel/wyoming_openai · 3 tokens

mockserver-monorepo AGENTS.md

AGENTS.md instructions for mock-server/mockserver-monorepo, covering mockserver — agent instructions, instruction priority, project overview, local development environment and project documentation.

mock-server/mockserver-monorepo · 7,398 tokens

GreenTunnel CLAUDE.md

Claude Code instructions for SadeghHayeri/GreenTunnel, covering greentunnel v3, commands, running the cli, ⚠️ npm run dev changes your real system proxy and layout.

SadeghHayeri/GreenTunnel · 11,732 tokens

spec-kitty AGENTS.md

AGENTS.md instructions for Priivacy-ai/spec-kitty, covering spec kitty development guidelines, ⚠️ critical: load the project charter first, ⚠️ critical: template source location, ⚠️ critical: use canonical sources, never improvise and ⚠️ critical: git workflow — no direct pushes to origin/main.

Priivacy-ai/spec-kitty · 9,910 tokens

AstrBot copilot-instructions.md

Copilot instructions for AstrBotDevs/AstrBot, covering astrbot development instructions, working effectively, bootstrap and install dependencies, running the application and dashboard build (vue.js/node.js).

AstrBotDevs/AstrBot · 736 tokens