Skip to content

Add SessionStart hook to install gh CLI in cloud sessions#194

Merged
jlowin merged 1 commit intomainfrom
cloud-gh-hook
Feb 25, 2026
Merged

Add SessionStart hook to install gh CLI in cloud sessions#194
jlowin merged 1 commit intomainfrom
cloud-gh-hook

Conversation

@jlowin
Copy link
Copy Markdown
Member

@jlowin jlowin commented Feb 25, 2026

Claude Code on the web doesn't have gh pre-installed. This adds a SessionStart hook that installs it automatically when running in a remote session, so gh commands work out of the box.

The hook is a no-op locally (CLAUDE_CODE_REMOTE check), and skips installation if gh is already present. On first cloud session, it fetches the latest release from the official GitHub CLI repo and installs to ~/.local/bin, then persists the PATH update via CLAUDE_ENV_FILE for the rest of the session.

You'll also need to set GH_TOKEN (or GITHUB_TOKEN) in Claude Code Web → Settings → Custom Environment, and ensure network access allows api.github.com and github.com (release assets).

@marvin-context-protocol marvin-context-protocol Bot added the enhancement Improvement to existing functionality or new capabilities. label Feb 25, 2026
@jlowin jlowin merged commit 3641cb4 into main Feb 25, 2026
7 checks passed
@jlowin jlowin deleted the cloud-gh-hook branch February 25, 2026 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improvement to existing functionality or new capabilities.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant