Borrowing it
Nothing to install: this file belongs to animeshkundu/github-router. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/animeshkundu/github-router/master/CLAUDE.mdgit clone --depth 1 https://github.com/animeshkundu/github-routerWrote 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.
[](https://agentmods.dev/instructions/animeshkundu/github-router/claude-md)<a href="https://agentmods.dev/instructions/animeshkundu/github-router/claude-md"><img src="https://agentmods.dev/badge/instructions/animeshkundu/github-router/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.
<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="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.32620 | $0.32620 |
| Opus 5.5 | $0.13048 | $0.13048 |
| Sonnet 5.5 | $0.06524 | $0.06524 |
| Haiku 4.5 | $0.03262 | $0.03262 |
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 7d 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 How it starts
The opening of the file, as written. The whole thing — 318 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.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 insrc/routes/mcp/,src/lib/peer-mcp-personas.ts, orsrc/lib/codex-mcp-config.ts.docs/first-mate-design.md— shipped--agentsfirst-mate design: deterministic controller, dual-token GitHub write auth, durable ledgers/decisions, cloud-agent service layer, the deny-by-defaultGH_ROUTER_FM_SCAFFOLD_REPOSwrite allowlist forscaffold_repo, and human-bound merge gate. Read before touchingsrc/lib/first-mate/,src/lib/agent/, or theagentsMCP 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/messagesprologue 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-6-sol and gemini-3.1-pro-preview through the shim, withFILE_TOOL_GUIDANCEon 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 geminiwc -lpreference, 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 theUPSTREAM_FETCH_TIMEOUT_MS/UPSTREAM_INACTIVITY_TIMEOUT_MStunables.docs/beta-headers.md—anthropic-betaallowlist (3 stealth vs 20 leverage prefixes), theEXPLICITLY_STRIPPED_BETA_PREFIXESdeny-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'scapability_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 changingforwardError/classifyOverflowinsrc/lib/error.ts.docs/claude-env-injection.md— the five experimentalCLAUDE_CODE_*env varsgithub-router claudeauto-enables (presence-based guard), per-feature opt-out, the catalog-derivedCLAUDE_CODE_AUTO_COMPACT_WINDOWinteger (all profiles), and the profile-specificmodelPickersettings injected into the per-launch mirror after Claude Code 2.1.260 made gateway-cache seeding non-authoritative.docs/anthropic-translation-shim.md— the/v1/messagestranslation 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, thestop/parallel_tool_callsfield forwarding, the inherent Copilot model gaps, and the Phase 3modelPickernative-selection mechanism. Read before touchingsrc/lib/anthropic-translate/, the/v1/messagesbranch insrc/routes/messages/handler.ts, orsrc/lib/model-picker-settings.ts.docs/multimodal.md— how images reach a model (producers → MCPtext|imageresult 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, peerimagePathsand 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 touchingsrc/lib/attachments.ts,src/lib/vision-preflight.ts,src/lib/peer-attachments.ts, orsrc/lib/catalog-capability-register.ts.docs/unsupported-features.md— Files API 404, ADVISOR Phase I server-side wiring,mcp_serversfail-fast 400, Bridge/CCR strip, and other Anthropic surfaces with no Copilot equivalent.docs/default-models.md—claude→claude-opus-5.5(Anthropic dashed slug, NOT the Copilot dotted slug —/modelUI registry mismatch),codex→gpt-5.6-sol, fallback chain led bygpt-6-sol, the dual-signal[1m]detector (sibling-slug regex OR base-slugmax_context_window_tokens), and theANTHROPIC_SMALL_FAST_MODELdefault. Fast profile: a Gemini 3.8 Flash-led-m fastlaunch profile distinct from budget mode, Sonnet 5 1M xhigh reviewer, four-row curated picker (Sol/Luna/Gemini 3.8 Flash/Grok 4.6), Grok's conservative context accounting, and a GPT-6 Sol 1M high Advisor that remains primary-lead-only across every fixed/modelselection — see the "Fast launch profile" section of that doc. Cheapest/balanced families:-m cheapest2derives from-m cheapest(Luna/max lead, Luna Explore/GP/reviewer, Oracle-only peers, 200K, three natives) with onlygpt-6.1-solas Advisor/Oracle and the Advisor raised to high;-m balanced2derives from-m balanced(Luna Explore/GP, 200K, advisor-free, reviewer→Explore) withgpt-6.1-solfor lead/reviewer and the Oracle moved togrok-4.7at medium. Both are contract spreads insrc/lib/{cheapest2,balanced2}-profile-contract.tsconsumed throughsrc/lib/profile-family.ts, so acheapest/balancedcheck written with the family helpers covers its-2sibling by construction. Max profile: a Sol-led-m maxprofile with Opus 5 1M high brainstorm, Sonnet 5 1M xhigh repository-aware reviewer, and cold-start cross-family peers (gemini-reviewer, codex-reviewer / sonnet-reviewer fallback, grok-reviewer). Its prompt architecture keeps decision policy in the system digest, one compact native roster in the resident awareness summary, the gate-aware inventory in mirroredCLAUDE.md, routing boundaries in Agent/MCP descriptions, and execution contracts in role prompts. Independent non-overlapping work may batch; dependencies and conflicting side effects stay sequential. The coordinator chooses the smallest sufficient set of distinct peer lenses and never substitutes votes for verification. Context-window safety (all profiles): Claude Code's[1m]budgets against the advertised TOTAL window while Copilot enforces a smallermax_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-integerCLAUDE_CODE_AUTO_COMPACT_WINDOW, minimizingfloor(prompt*0.85)+min(output,20_000)+13_000across every reachable[1m]lead/tier/custom/settings-picker model (deriveAutoCompactWindowTokensinsrc/lib/grok-context.ts)./modelcannot mutate it; Claude Code appliesmin(locallyRecognizedModelWindow, launchValue), and native subagents inherit the same env. It MUST be an integer — that env path isparseInt-based, so"1m"becomes1, floors to 100,000, and compacts a 1M session every ~52K tokens. Pinned-200K profiles (cheap,cheapest/cheapest2,balanced/balanced2) instead seedCLAUDE_CODE_DISABLE_1M_CONTEXT=1— bare ids alone don't hold 200K because everybehavesAstarget is native-1M in the client catalog (verified: baregpt-6-lunareportscontextWindow: 1000000on Claude Code 2.1.288) — carry no decorated picker rows, and therefore omit the bound.docs/auth-isolation.md—STRIPPED_PARENT_ENV_KEYSparent-env sanitize,CLAUDE_CONFIG_DIRsnapshot mirror (ISOLATED / SHARED / MIRRORED policy), syntheticclaudeAiOauthcredential schema, synthetic.claude.jsononboarding-skip injection (hasCompletedOnboarding/bypassPermissionsModeAccepted/ syntheticoauthAccount— 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/azure-mcp.md— the two Azure MCP groups.ado: the public remote server athttps://mcp.dev.azure.com/{organization}(audience2a72489c-aab2-4b65-b93a-a91edccf33b8), read-only by default viaX-MCP-Readonly: true(measured: 20 tools read-only vs 31 without, 26 vs 43 across all toolsets — the header IS the filter), the curatedrepos,wit,pipelines,wikitoolset default, and the dynamic tool listing that forwards upstreamtools/listinstead of freezing entries upstream can rename (name-uniqueness still checked at snapshot time; boot assertion sees the static registry only).kusto: an in-repo client overPOST {cluster}/v1/rest/{query,mgmt}(body field iscsl, notquery), five read-only tools whoseclusteris named per call (--kustoalone registers the group;--kusto-clusteris only a default for calls that omit one, and a call-named cluster is held to a Kusto-shaped https origin with no allowlist, the data boundary being the identity's own RBAC), and read-only enforced by the service (x-ms-readonly: true+properties.Options.request_readonly_hardline: true, neither liftable by asetstatement) rather than by inspecting KQL text. Also the auto-enable rule (an Azure DevOps git remote turns Bluebird +ado+kustoon, the last since the cluster became a per-call argument; discovery turns the group on but never supplies a cluster), its four trust bounds, the sharedaz account get-access-tokenplumbing, and the testing policy. Read this before touchingsrc/lib/ado-client.ts,src/lib/ado-tools.ts,src/lib/kusto-client.ts,src/lib/kusto-tools.ts, orsrc/lib/azure-mcp-flags.ts.docs/web-search.md— Copilot/mcpwire flow withX-MCP-Toolsets: web_search, GitHub PAT auth, model-agnostic out-of-band fulfilment, and theCOPILOT_HOST_ALLOWLISTPAT-exfiltration safeguard.docs/pi-vendor-sync.md— vendor-sync protocol forsrc/vendor/pi/(Pi agent runtime backingworker_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--browseflag'sbrowser_*tool suite (15 tools driving Chrome/Edge via a from-scratch MV3 extension + native-messaging bridge). Covers the install-detection / auto-install /install_requiredflow, 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 onGH_ROUTER_RUN_BROWSER_E2E=1. Read this before touchingsrc/lib/browser-mcp/,src/browser-bridge/, orsrc/browser-ext/.docs/semantic-search.md+docs/research/colbert-sidecar-design.md— ColBERT/PLAID semantic search (the defaultmode: "semantic"of the unifiedcodeMCP tool, via the router-managedcolgrepsidecar; there is no standalonesemantic_searchtool). Covers the opt-in (--search) provision + background-index, the opt-in + availability-basedcolbertSearchEnabled()leaf (whichsemanticSearchEnabled()delegates to), the contract split (therunnerstays no-lexical-fallback; the mergedcodetool's semantic mode DOES fall back to lexical and labelssource), the git freshness verdict + serve-while-stale labels (freshness/stale_fileson small content deltas; engine/suspect stale still refuses), 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 touchingsrc/lib/colbert/orsrc/lib/unified-code-search.ts.docs/process-teardown.md— deterministic child-process teardown for the launched CLI: the canonicalkillChildProcessTreehelper, the extension-conditioned Windows spawn (windowsLaunchNeedsShell— real.exespawned direct, only.cmd/.batkeepcmd.exe), POSIXdetached:true+ SIGINT/SIGTERM forwarding, and the crash-safe net: on Windows the runtime'sKILL_ON_JOB_CLOSEJob Object already reaps the tree (astartProcessGuardno-op there, asserted by a regression canary), on POSIX a detached start-time-verifiednode -ereaper insrc/lib/process-guard/(inherited-pipe-EOF parent-death signal, skip-when-uncertain). Documents which exit paths are deterministic vs best-effort. Read before touchingcleanup()insrc/lib/launch.tsorsrc/lib/process-guard/.docs/serve-control-plane.md— thegithub-router servebrowser 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-sideOriginenforcement CloudCLI lacks, filtered child env strippingGITHUB_TOKEN/ANTHROPIC_AUTH_TOKEN/etc., JWT-on notVITE_IS_PLATFORM), the pinned router-owned install (never global/@latest), and the MIT-vs-AGPL mere-aggregation stance (NOTICE+scripts/check-pack-no-agpl.mjsrelease guard). Read before touchingsrc/serve.tsorsrc/lib/serve/.
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.
- 7d ago Changed · +222 tokens per session ad3eedcddab6
- 11d ago Changed · +1 lines · +506 tokens per session 98c1462ebbcb
- 24d ago Changed · +104 tokens per session bed4dec15e48
- 1mo ago Changed · +48 tokens per session 49810ca1bc78
- 1mo ago Changed · +5 tokens per session 47f7e3264579
- 1mo ago Changed · +15 tokens per session c0dedca14c72
- 1mo ago Changed · +23 lines · +498 tokens per session 955c2fe67f6e
- 1mo ago Changed · +57 tokens per session 68f3f25a0e15
- 1mo ago Changed · +194 tokens per session aabf4185ca95
- 1mo ago First seen · 294 lines · 30,971 tokens per session scan C d3360187949d
github-router CLAUDE.md is an instructions file published in the GitHub repository animeshkundu/github-router (5 stars, last pushed 7d ago), licensed MIT. It adds 32,620 tokens to every session, about $0.1305 per session on Opus 5.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.
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).
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.
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).
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.
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).
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.