gh-mcp: Instructions file for Claude Code

CLAUDE.md

gh-mcp CLAUDE.md is an instructions file for Claude Code from shuymn/gh-mcp. It costs 1,163 tokens per session, scanned A, original, MIT.

Project instructions for gh-mcp, a GitHub CLI extension that uses the user's existing GitHub login to start a GitHub MCP server, a service that gives an AI agent GitHub tools.

In plain words
What is it for?
Building and validating the extension, installing it with GitHub CLI, and running the authenticated server.
Why use it?
They document how to build, install, test, and authenticate the extension without implementing login handling from scratch.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code.

This is shuymn/gh-mcp's own configuration. It tells Claude Code how to work on gh-mcp 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 gh-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to shuymn/gh-mcp. 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/shuymn/gh-mcp/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/shuymn/gh-mcp

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 gh-mcp CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/shuymn/gh-mcp/claude-md/github.svg)](https://agentmods.dev/instructions/shuymn/gh-mcp/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/shuymn/gh-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/shuymn/gh-mcp/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 gh-mcp CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/shuymn/gh-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/shuymn/gh-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,163 This file is loaded in full into every session.
When invoked 1,163 The same file — it is already loaded in full.
Security scan A 0 findings. 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.01163 $0.01163
Opus 5.5 $0.00465 $0.00465
Sonnet 5.5 $0.00233 $0.00233
Haiku 4.5 $0.00116 $0.00116

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

Security

Grade A, and why

gh-mcp CLAUDE.md scanned grade A with 0 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 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 116 lines

How it starts

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

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

This is a GitHub CLI extension that runs the github-mcp-server as a bundled binary using the user's existing gh authentication. It automates the process of retrieving GitHub credentials and launching the MCP server process with proper authentication.

Common Development Commands

Build

# Stage the locked server archive for this platform and build
task build
# Equivalent to:
go run ./tools/lock stage && go build -o gh-mcp .

# Build every locked platform into dist/ (what releases run)
go run ./tools/lock dist -out dist

Development

# Format code
go fmt ./...

# Vet code for issues
go vet ./...

# Tidy dependencies
go mod tidy

# Install locally as Go binary
go install

# Install as GitHub CLI extension (from project root)
gh extension install .

# Test the extension directly
./gh-mcp

Testing

go test ./...
go test -race -shuffle=on -count=10 ./...   # task test

Server lock

go run ./tools/lock sync -version vX.Y.Z   # pin an upstream release (verifies attestations)
go run ./tools/lock verify                 # check server.lock.json against upstream
go run ./tools/release next -base-ref origin/main -write   # VERSION for a lock change

Architecture

gh-mcp is a launcher that injects gh credentials into the upstream github-mcp-server. It knows only the stdio subcommand and the GITHUB_PERSONAL_ACCESS_TOKEN/GITHUB_HOST variables; user arguments and GITHUB_* variables pass through untouched.

  1. internal/identity: gh's default host and token via github.com/cli/go-gh/v2.
  2. internal/artifact: parses server.lock.json, extracts archives, and keeps verified executables in a content-addressed cache (<user cache>/gh-mcp/servers/<sha256>/). Installs go through a temp file and a hard link that never replaces a valid executable (Windows cannot replace open files). Cache hits touch a .last-used marker; a fresh install prunes other digests unused for 7 days (StaleAfter), best effort. main.go repeats Ensure + exec once when the executable vanished (fs.ErrNotExist), and nothing else.
  3. internal/launch: builds args (stdio + user args) and env (base allowlist + GITHUB_*, credentials withheld/overridden), then syscall.Exec on Unix or spawn-and-wait on Windows.
  4. main.go: embeds server.lock.json and payload/ (release builds stage payload/server.archive per platform) and wires the three packages through the launcher struct, whose function fields are the test seams.
  5. Release automation:
    • server.lock.json is the single source for the upstream version, supported platforms, and digests. Renovate bumps its version; .github/workflows/sync-server-lock.yml runs trusted base tools to record attested digests and VERSION, then creates one app-signed commit through the API (the main ruleset requires signed commits)
    • Every upstream release gets one gh-mcp release: Renovate proposes each version on its own branch, and tools/release validate rejects a lock update that skips a published release
    • Renovate auto-merges minor/patch updates after required CI; majors need review
    • CI (ci.yml) runs tools/release validate and tools/lock verify, then calls release.yml on main, which uses tools/release plan, tags, builds with cli/gh-extension-precompile@v2 + scripts/build-dist.sh, attests, and publishes
    • plan skips published versions; a version released after a newer one is published with --latest=false

Read the full file on GitHub · 116 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 · -2 lines · +238 tokens per session 10716db479e0
  2. 2mo ago First seen · 118 lines · 925 tokens per session scan A d82bda58d760

Subscribe to this mod's changes

gh-mcp CLAUDE.md is an instructions file published in the GitHub repository shuymn/gh-mcp (54 stars, last pushed 2d ago), licensed MIT. It adds 1,163 tokens to every session, about $0.0047 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

gh-mcp CLAUDE.md compared with instructions from other repositories

gh-mcp CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
gh-mcp CLAUDE.mdshuymn/gh-mcpInstructions file542d agoMITA1,163Claude Code
arm_1a2b_3c4d_cleanCode_meaningfulNamescolchuck-ai/ai-resource-managerInstructions file247mo agoGPL-3.0A253GitHub Copilot
arm_1a2b_5e6f_cleanCode_smallFunctionscolchuck-ai/ai-resource-managerInstructions file247mo agoGPL-3.0A244GitHub Copilot
arm_1a2b_9i0j_cleanCode_singleResponsibilitycolchuck-ai/ai-resource-managerInstructions file247mo agoGPL-3.0A238GitHub Copilot
arm_1a2b_k1l2_cleanCode_avoidDuplicationcolchuck-ai/ai-resource-managerInstructions file247mo agoGPL-3.0A248GitHub Copilot
arm_1a2b_7g8h_cleanCode_avoidCommentscolchuck-ai/ai-resource-managerInstructions file247mo agoGPL-3.0A231GitHub Copilot
ai-resource-manager arm_index.instructions.mdcolchuck-ai/ai-resource-managerInstructions file247mo agoGPL-3.0A238GitHub Copilot