Gh Auth Isolation

Safely manage multiple GitHub identities (EMU + personal) in agent workflows

45 stars 11 forksGit & Code Review

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add Azure-Samples/agent-skills-dotnet-demo --skill gh-auth-isolation
Manual install
git clone --depth 1 https://github.com/Azure-Samples/agent-skills-dotnet-demo.git /tmp/agent-skills-dotnet-demo
mkdir -p ~/.claude/skills
cp -r /tmp/agent-skills-dotnet-demo/.squad/templates/skills/gh-auth-isolation ~/.claude/skills/gh-auth-isolation

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

## Context

Many developers use GitHub through an Enterprise Managed User (EMU) account at work while maintaining a personal GitHub account for open-source contributions. AI agents spawned by Squad inherit the shell's default `gh` authentication — which is usually the EMU account. This causes failures when agents try to push to personal repos, create PRs on forks, or interact with resources outside the enterprise org.

This skill teaches agents how to detect the active identity, switch contexts safely, and avoid mixing credentials across operations.

## Patterns

### Detect Current Identity

Before any GitHub operation, check which account is active:

```bash
gh auth status
```

Look for:
- `Logged in to github.com as USERNAME` — the active account
- `Token scopes: ...` — what permissions are available
- Multiple accounts will show separate entries

### Extract a Specific Account's Token

When you need to operate as a specific user (not the default):

```bash
# Get the personal account token (by username)
gh auth token --user personaluser

# Get the EMU account token
gh auth token --user corpalias_enterprise
```

**Use case:** Push to a personal fork while the default `gh` auth is the EMU account.

### Push to Personal Repos from EMU Shell

The most common scenario: your shell defaults to the EMU account, but you need to push to a personal GitHub repo.
Read the full skill on GitHub

Details

Skill name
gh-auth-isolation
Path
.squad/templates/skills/gh-auth-isolation/SKILL.md
License
MIT
Repo updated
10 April 2026

FAQ

What does the Gh Auth Isolation skill do?

Safely manage multiple GitHub identities (EMU + personal) in agent workflows

How do I install the Gh Auth Isolation skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add Azure-Samples/agent-skills-dotnet-demo --skill gh-auth-isolation. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Gh Auth Isolation popular?

It lives in Azure-Samples/agent-skills-dotnet-demo, which has 45 GitHub stars and 11 forks.

Related skills

Browse the most popular Claude skills, all git & code review skills, or write your own with the skills generator.