More screenshots

    Works with the AI Agents you already use

    Claude gh Guard

    by Seunghoon Jung

    1

    Stop Claude Code from committing to your work repo with your personal GitHub account. Free and open source (MIT).

    Free

    Security scanned
    claude-gh-guard

    claude-gh-guard

    Example session with this skill installed

    I need to set up the GitHub guard to make sure I don't use my personal account for work repos. Check if I have the requirements and show me how to init it.

    • Read your context and instructions
    • Compiled the claude-gh-guard

    I checked your environment before installing claude-gh-guard.

    RequirementStatus
    Node.js 18+v20.11.0 ✅
    GitHub CLIlogged in as work-user and personal-user ✅
    Claude Code✅

    What init will change

    init edits your Claude Code settings (~/.claude/settings.json, or $CLAUDE_CONFIG_DIR/settings.json if set):

    1. Backs up your current settings.json
    2. Copies the CLI to ~/.claude-gh-guard/bin/cli.mjs
    3. Sets the status line to the guard. Your existing status line is kept and wrapped.
    4. Adds a PreToolUse hook (matcher Bash) that checks git commit, git push and gh pr create

    Only a definite wrong-account case is blocked. Anything ambiguous or unknown is let through with a warning.

    Shall I run it?

    npx claude-gh-guard init
    

    After you approve

    1. Restart Claude Code so the hook and status line load.
    2. In a repo, run npx claude-gh-guard doctor. It shows the active gh account, your commit email, the push identity and which account this repo expects.
    3. If doctor reports AMBIGUOUS (several of your accounts can push here), pin the accounts in ~/.gh-guard.json:
    {
      "profiles": {
        "work": {
          "ghUser": "work-user",
          "gitEmail": "you@company.com",
          "owners": ["company-org"]
        },
        "personal": {
          "ghUser": "personal-user",
          "gitEmail": "you@example.com",
          "owners": ["personal-user"]
        }
      }
    }
    

    To remove everything later: npx claude-gh-guard uninstall.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Free and open source (MIT). Install with one command:

    npx claude-gh-guard init
    

    ⭐ If it saves you from a wrong-account commit, a star on GitHub would mean a lot: https://github.com/seuthootDev/claude-gh-guard

    What it does

    • Status line shows which GitHub account is active for the current repo, plus your Claude account
    • Blocks git commit, git push and gh pr create when the identity is definitely wrong
    • Only a definite mismatch blocks. Ambiguous, unknown or error states let the command through
    • Zero runtime dependencies, Node >= 18, one command to uninstall

    Compatibility: Claude Code only. It relies on Claude Code hooks and the status line, so it does not work in Cursor, Copilot or other agents.

    Bugs and ideas: https://github.com/seuthootDev/claude-gh-guard/issues

    Only supports github.com. No support for GitHub Enterprise. Commands in subshells or with 'env' prefixes are ignored. Custom SSH commands may limit push identity detection.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 14 days ago

    • Free with an Agensi account

    Accounts
    GitHub
    Software
    GitNode.js 18+GitHub CLIClaude Code

    On Windows, works through Git Bash (installed with Git for Windows); no WSL needed.

    Permissions

    Terminal / Shell
    Write Files
    Read Files
    Environment Variables
    Network Access

    Allowed Hosts

    api.github.com

    File Scopes

    ~/.claude/settings.json
    ~/.claude.json
    ~/.claude-gh-guard/**
    ~/.gh-guard.json

    Edits Claude Code settings.json (after a backup) to add a PreToolUse hook and status line. Reads gh's login config to see your accounts and calls the GitHub API to learn which account can push to a repo. Tokens stay in memory and are never written to disk. Reads the CLAUDE_CONFIG_DIR, GH_GUARD_ASCII and NO_COLOR environment variables. `npx claude-gh-guard uninstall` reverts everything.

    Listed18 days ago
    Updated14 days ago

    What's inside

    Frequently Asked Questions

    The skill acts as a pre-execution gate for Claude Code, automatically checking your local Git config and GitHub CLI auth against your repository's requirements before allowing a commit or push to proceed.

    This skill is specifically built for Claude Code and requires the GitHub CLI (`gh`), Git, and Node.js 18+ to be installed on your local machine.

    Yes, you can use the account mapping feature to bind specific GitHub organizations or repositories to distinct profiles, ensuring your personal and work identities never cross-pollinate.

    If a mismatch is detected, the skill intercepts the command and blocks execution, providing a diagnostic report so you can switch accounts before any data is sent to the remote repository.

    While it provides robust protection for standard git and GitHub CLI commands, it currently only supports github.com and may not track identities inside custom subshells or non-standard SSH configurations.

    New in Security

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Security.

    Free