Claude Code on your private repos — never your real credential.
A GitHub CLI extension that launches Claude Code with a
temporary, least-privilege token: read-only on source code (no
push), read/write on issues and pull requests, expiring after 7
days, and stored in your OS keychain. Claude only ever sees the
scoped token — not your keychain, not your real
gh login.
gh extension install
bitwise-media-group/gh-claude
gh claude
One command mints (or reuses) the scoped token, wires it into gh and git, and hands over to Claude — [1] the launch · [2] exactly what Claude gets.
A scoped token for Claude — minted in the browser, stored in the keychain, wired in at launch.
A fine-grained PAT scoped to contents: read and
issues + pull requests: read/write, across every repo you
can access. Claude works your backlog; the credential stays
yours.
contents: read means git push is
rejected outright. If the token ever leaks, the blast radius
stops at read.
Tokens live a week, and reuse stops five minutes before expiry. GitHub has no API to mint fine-grained PATs, so the browser step comes round about once a week — pre-filled, one click.
macOS Keychain and Windows Credential Manager via the standard library — no cgo, no third-party keyring. Linux and WSL2 fall back to an AES-256-GCM encrypted file at 0600.
Only the scoped token, via GITHUB_TOKEN. Your
keychain and your real gh login are never read,
never exported, never touched.
GH_TOKEN plus a per-process git credential
helper (GIT_CONFIG_*): clones and fetches work
on private repos, and nothing global is modified.
Everything hangs off gh claude — the launch is the
default.
$ gh claude
# ensure a valid token, then launch Claude here
$ gh claude -- --resume
# pass arguments through to claude after --
$ gh claude login
# force-create a fresh token, no launch
$ gh claude status
# account, expiry, and where the token lives
$ gh claude verify
# verify the binary's build provenance
$ gh claude logout
# remove the stored token
$ gh claude --op --vault
Engineering
# keep the token in 1Password instead
One command. Needs the gh CLI (authenticated), git, and claude on your PATH.
Alternative methodsgh extension install
bitwise-media-group/gh-claude
Your browser opens the token page pre-filled — choose "All repositories", click Generate, paste it back (input hidden).
gh claude login
Claude starts with the scoped token wired into gh and git — and the token is reused until it expires.
gh claude