oikon48

Gh Setup Hooks — Development skill for Claude Code

Development community

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

How to install Gh Setup Hooks

This entry records only its repository, not the path inside it, so there is no exact command to give. Open oikon48/gh-setup-hooks and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Gh Setup Hooks does

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

Alternatives in Development

  • On — PUA 开启默认模式 — 每次新会话自动加载 PUA 核心 skill 19.5k ★
  • Notebooklm Skill — Use this skill to enable Claude Code to communicate directly with your Google NotebookLM notebooks 5.9k ★
  • Doctor — Environment diagnostics with interactive fixes — providers, auth, RTK, hooks, token optimization 2.8k ★

README

gh-setup-hooks

[![npm version](https://badge.fury.io/js/gh-setup-hooks.svg)](https://www.npmjs.com/package/gh-setup-hooks) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

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`:

{
  "hooks": {
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "bun x gh-setup-hooks",
            "timeout": 120
          }
        ]
      }
    ]
  }
}

`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:

**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`.

Cloud Environment Settings

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

Environment Variable Description Default
GH_SETUP_VERSION gh version to install 2.88.1

License

MIT

References