Skip to content

Add gh-web-fallback Claude Code hook for GitHub API guidance#126

Merged
Jython1415 merged 2 commits intomainfrom
claude/github-web-fallback-hook-ukrWj
Jan 26, 2026
Merged

Add gh-web-fallback Claude Code hook for GitHub API guidance#126
Jython1415 merged 2 commits intomainfrom
claude/github-web-fallback-hook-ukrWj

Conversation

@Jython1415
Copy link
Owner

Summary

  • Adds a PreToolUse Claude Code hook that detects gh CLI commands in environments where gh is unavailable but GITHUB_TOKEN is present
  • Provides proactive guidance to use the GitHub REST API with curl instead
  • Includes a 5-minute cooldown to avoid repetitive suggestions
  • Updated .gitignore to track .claude/ directory so hooks are shared with repo clones

Test plan

  • Test in Claude Code Web environment where gh is unavailable
  • Verify hook triggers when attempting gh commands
  • Verify cooldown mechanism works (no repeated suggestions within 5 minutes)
  • Verify hook doesn't trigger when gh CLI is available

Resolves #125

Adds a PreToolUse hook that detects when `gh` CLI commands are
attempted in environments where `gh` is unavailable but GITHUB_TOKEN
is present. Provides proactive guidance to use the GitHub REST API
with curl instead, avoiding failed command attempts.

Resolves #125
@Jython1415 Jython1415 merged commit 767163c into main Jan 26, 2026
1 check passed
@Jython1415 Jython1415 deleted the claude/github-web-fallback-hook-ukrWj branch January 26, 2026 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move GitHub access pattern using the GitHub token to a SessionStart Claude Code hook

2 participants

Comments