Claude Code session

Gh Setup Hooks

Enable `gh` command in Claude Code on the Web environment, just adding SessionStartHooks

48 stars 3 forksSessions & history Source

Install

From source
git clone https://github.com/oikon48/gh-setup-hooks.git

From the README

gh-setup-hooks

Auto-install GitHub CLI on Claude Code on the Web. Just add one line to settings.json.

Setup

1. Add hook to settings.json

Add to .claude/settings.json:

npx -y gh-setup-hooks is also ok.

2. Set up Claude Code on the Web

To use gh commands (e.g., gh pr create), you need to set GH_TOKEN or GITHUB_TOKEN:

1. Go to Claude Code on the Web
2. Open Settings → Custom Environment
3. Add environment variable:
   - Name: GH_TOKEN or GITHUB_TOKEN
   - Value: Your GitHub Personal Access Token
Note: The token needs repo scope for most operations.

Claude Code on the Web network should be Full or Custom. If using Custom, you need to allow release-assets.githubusercontent.com.

How It Works

1. Start a session on Claude Code on the Web
2. SessionStart hook runs npx gh-setup-hooks
3. Installs gh only in remote environment (CLAUDE_CODE_REMOTE=true)
4. Installs to ~/.local/bin and persists PATH
5. Auto-detects GH_REPO from git remote for gh CLI compatibility
6. Does nothing in local environment

Configuration

License

MIT

References

- npm package
- GitHub CLI
- Claude Code Hooks
- GitHub Personal Access Tokens
Read the full README on GitHub

Details

Language
JavaScript
License
MIT
Last updated
14 March 2026
Topics
claudeclaude-codeclaude-code-hooks

FAQ

What is Gh Setup Hooks?

Enable `gh` command in Claude Code on the Web environment, just adding SessionStartHooks It is a session for Claude Code, from oikon48/gh-setup-hooks on GitHub.

How do I install Gh Setup Hooks?

Clone oikon48/gh-setup-hooks from GitHub and follow the setup steps in its README.

Is Gh Setup Hooks popular?

oikon48/gh-setup-hooks has 48 GitHub stars and 3 forks. It was last updated on 14 March 2026.

More sessions & history

Browse the most popular Claude Code mods, all sessions & history, or the skills and MCP server directories.