Install/uninstall gh-tools hooks to ~/.claude/settings.json
Manages gh-tools hooks in Claude settings to replace WebFetch with gh CLI for GitHub URLs.
/plugin marketplace add terrylica/cc-skills/plugin install gh-tools@cc-skills[install|uninstall|status]Manage gh-tools hook installation in ~/.claude/settings.json.
This hook soft-blocks WebFetch requests to github.com URLs and suggests using the gh CLI instead for better data access.
| Action | Description |
|---|---|
status | Check hook installation status and dependencies |
install | Add gh-tools hooks to settings.json |
uninstall | Remove gh-tools hooks from settings.json |
| Aspect | WebFetch | gh CLI |
|---|---|---|
| Authentication | None | gh auth token |
| Data format | HTML scraping | Native JSON API |
| Rate limits | Strict (anonymous) | Higher (authenticated) |
| Pagination | Manual | Automatic |
| Metadata | Limited | Full (labels, etc.) |
Parse $ARGUMENTS and run the management script:
/usr/bin/env bash << 'GH_TOOLS_HOOKS_SCRIPT'
set -euo pipefail
ACTION="${ARGUMENTS:-status}"
# Auto-detect plugin root
detect_plugin_root() {
if [[ -n "${CLAUDE_PLUGIN_ROOT:-}" ]]; then
echo "$CLAUDE_PLUGIN_ROOT"
return
fi
local marketplace="$HOME/.claude/plugins/marketplaces/cc-skills/plugins/gh-tools"
if [[ -d "$marketplace/hooks" ]]; then
echo "$marketplace"
return
fi
local cache_base="$HOME/.claude/plugins/cache/cc-skills/gh-tools"
if [[ -d "$cache_base" ]]; then
local latest
latest=$(ls -1 "$cache_base" 2>/dev/null | grep -E '^[0-9]+\.[0-9]+' | sort -V | tail -1)
if [[ -n "$latest" && -d "$cache_base/$latest/hooks" ]]; then
echo "$cache_base/$latest"
return
fi
fi
echo ""
}
PLUGIN_DIR="$(detect_plugin_root)"
if [[ -z "$PLUGIN_DIR" ]]; then
echo "ERROR: Cannot detect gh-tools plugin installation" >&2
exit 1
fi
bash "$PLUGIN_DIR/scripts/manage-hooks.sh" "$ACTION"
GH_TOOLS_HOOKS_SCRIPT
After install/uninstall operations:
IMPORTANT: Restart Claude Code session for changes to take effect.
The hooks are loaded at session start. Modifications to settings.json require a restart.