Agent skill

Accessing GitHub Repos

by oaustegard in oaustegard/claude-skills

GitHub repository access in containerized environments using REST API and credential detection.

MITAuto-check: notesBackend & APIs

Install Accessing GitHub Repos

skills CLI
$ npx skills add oaustegard/claude-skills --skill accessing-github-repos -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install oaustegard/claude-skills accessing-github-repos --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/oaustegard/claude-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/accessing-github-repos .claude/skills/accessing-github-repos && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
accessing-github-repos
GitHub stars
150
Token cost
~2.2k tokens
SKILL.md length
329 words
Files
2
Skills in repo
93
Repo updated
First seen
Licence
MIT

At a glance

GitHub repository access in containerized environments using REST API and credential detection.

  • Works in 3 steps: GitHub → Settings → Developer settings →… → Create token scoped to needed repositories → Set permissions
  • Git clone fails
  • SKILL.md covers Quick Start, Setup, Capabilities by Auth Level and Python Helper Functions, plus 5 more sections
  • Calls curl, python3 and git; reaches api.github.com and raw.githubusercontent.com; needs GITHUB_TOKEN and GH_TOKEN

What it does

Accessing GitHub Repos is an agent skill from oaustegard/claude-skills. GitHub repository access in containerized environments using REST API and credential detection. Use when git clone fails, or when accessing private repos/writing files via API.

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `CHANGELOG.md`).

It sits in Backend & APIs, covering REST APIs and Git workflow. It works with GitHub and Git. The repository describes itself as: My collection of Claude skills. The licence is MIT.

When your agent uses it

  • Git clone fails
  • Accessing private repos/writing files via API

Example prompts

  • “/accessing-github-repos”

Requirements

  • Python 3
  • A credential in GITHUB_TOKEN

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. GitHub → Settings → Developer settings → Fine-grained tokens
  2. Create token scoped to needed repositories
  3. Set permissions

What it can do on your machine

Read from SKILL.md and the folder at commit 559a6cd. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • curl
    • python3
    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • api.github.com
    • raw.githubusercontent.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • GITHUB_TOKEN
    • GH_TOKEN

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Accessing GitHub Repos loads about 2.2k tokens when it runs. Until then it costs about 50 tokens; SKILL.md has 329 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~50
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:39
    - `/mnt/project/.env`
  • NoteMentions a .env fileSKILL.md:89
    # Check project .env files
  • NoteMentions a .env fileSKILL.md:90
    env_paths = ['/mnt/project/.env', '/mnt/project/github.env']

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from oaustegard/claude-skills at commit 559a6cd, republished under its MIT licence (© oaustegard). 329 words, ~2,206 tokens.

Download SKILL.mdSave it as .claude/skills/accessing-github-repos/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
accessing-github-repos
description
GitHub repository access in containerized environments using REST API and credential detection. Use when git clone fails, or when accessing private repos/writing files via API.
metadata.version
2.0.0

Accessing GitHub Repositories

Git clone is blocked in containerized AI environments (egress proxy rejects CONNECT tunnel), but full repository access is available via GitHub REST API and raw file URLs.

Quick Start

Public Repos (no setup needed)
bash
# Individual file via raw URL
curl -sL "https://raw.githubusercontent.com/OWNER/REPO/BRANCH/path/file"

# Directory tree via API
curl -sL "https://api.github.com/repos/OWNER/REPO/git/trees/BRANCH?recursive=1"
Private Repos or Write Access

Requires GitHub Personal Access Token (PAT). See Setup section below.

Setup

Credential Configuration

The skill automatically detects PATs from environment variables or project files:

Environment Variables (checked in order):

  • GITHUB_PAT
  • GH_PAT
  • GITHUB_TOKEN
  • GH_TOKEN

Project Files (Claude.ai):

  • /mnt/project/.env
  • /mnt/project/github.env

Format:

bash
GITHUB_PAT=github_pat_11AAAAAA...
Creating a GitHub PAT
  1. GitHub → Settings → Developer settings → Fine-grained tokens
  2. Create token scoped to needed repositories
  3. Set permissions:
    • Contents: Read - for private repo access
    • Contents: Write - for pushing files
    • Issues: Write - for issue management
    • Pull requests: Write - for creating PRs
Network Access (Claude.ai Projects)

Add to network allowlist:

  • api.github.com
  • raw.githubusercontent.com

Capabilities by Auth Level

CapabilityNo PAT (public only)PAT (read)PAT (write)
Fetch public files✅✅✅
Fetch private files❌✅✅
Download tarball✅ public✅✅
Create/update files❌❌✅
Create branches❌❌✅
Manage issues❌❌✅
Create PRs❌❌✅

Python Helper Functions

Credential Detection
python
import os

def get_github_auth():
    """Returns (token, source) or (None, None)"""
    # Check environment variables
    for var in ['GITHUB_PAT', 'GH_PAT', 'GITHUB_TOKEN', 'GH_TOKEN']:
        if token := os.environ.get(var):
            return token, var

    # Check project .env files
    env_paths = ['/mnt/project/.env', '/mnt/project/github.env']
    for path in env_paths:
        try:
            with open(path) as f:
                for line in f:
                    if '=' in line and not line.startswith('#'):
                        key, val = line.strip().split('=', 1)
                        if key in ['GITHUB_PAT', 'GH_PAT', 'GITHUB_TOKEN']:
                            return val.strip(), f'{path}:{key}'
        except FileNotFoundError:
            continue

    return None, None
Fetch Single File
python
import base64
import urllib.request
import json

def fetch_file(owner: str, repo: str, path: str, ref: str = 'main', token: str = None) -> str:
    """Fetch single file. Uses API if token provided, raw URL otherwise."""
    if token:
        # Use API (works for private repos)
        url = f'https://api.github.com/repos/{owner}/{repo}/contents/{path}?ref={ref}'
        req = urllib.request.Request(url, headers={
            'Authorization': f'Bearer {token}',
            'Accept': 'application/vnd.github+json'
        })
        with urllib.request.urlopen(req) as resp:
            data = json.load(resp)
            return base64.b64decode(data['content']).decode()
    else:
        # Use raw URL (public repos only)
        url = f'https://raw.githubusercontent.com/{owner}/{repo}/{ref}/{path}'
        with urllib.request.urlopen(url) as resp:
            return resp.read().decode()
Fetch Repository Tarball
python
def fetch_repo_tarball(owner: str, repo: str, ref: str = 'main', token: str = None) -> bytes:
    """Download full repo as tarball. Requires token for private repos."""
    url = f'https://api.github.com/repos/{owner}/{repo}/tarball/{ref}'
    headers = {'Accept': 'application/vnd.github+json'}
    if token:
        headers['Authorization'] = f'Bearer {token}'

    req = urllib.request.Request(url, headers=headers)
    with urllib.request.urlopen(req) as resp:
        return resp.read()

# Usage:
tarball = fetch_repo_tarball('owner', 'repo', 'main', token)
with open('/tmp/repo.tar.gz', 'wb') as f:
    f.write(tarball)
# Extract: tar -xzf /tmp/repo.tar.gz
Create or Update File
python
def push_file(owner: str, repo: str, path: str, content: str,
              message: str, token: str, sha: str = None) -> dict:
    """Create/update file via API. Returns commit info.

    Args:
        sha: Required when updating existing file (get via contents API)
    """
    url = f'https://api.github.com/repos/{owner}/{repo}/contents/{path}'

    payload = {
        'message': message,
        'content': base64.b64encode(content.encode()).decode()
    }
    if sha:  # Update existing file
        payload['sha'] = sha

    req = urllib.request.Request(url,
        data=json.dumps(payload).encode(),
        headers={
            'Authorization': f'Bearer {token}',
            'Accept': 'application/vnd.github+json',
            'Content-Type': 'application/json'
        },
        method='PUT')

    with urllib.request.urlopen(req) as resp:
        return json.load(resp)
Get File SHA (for updates)
python
def get_file_sha(owner: str, repo: str, path: str, token: str, ref: str = 'main') -> str:
    """Get file SHA needed for updates."""
    url = f'https://api.github.com/repos/{owner}/{repo}/contents/{path}?ref={ref}'
    req = urllib.request.Request(url, headers={
        'Authorization': f'Bearer {token}',
        'Accept': 'application/vnd.github+json'
    })
    with urllib.request.urlopen(req) as resp:
        data = json.load(resp)
        return data['sha']

Bash Examples

Fetch Public File
bash
curl -sL "https://raw.githubusercontent.com/owner/repo/main/path/file.py"
Fetch Private File (with PAT)
bash
curl -H "Authorization: Bearer $GITHUB_PAT" \
     -H "Accept: application/vnd.github+json" \
     "https://api.github.com/repos/owner/repo/contents/path/file.py" | \
     python3 -c "import sys,json,base64; print(base64.b64decode(json.load(sys.stdin)['content']).decode())"
Download Repo Tarball
bash
# Public repo
curl -sL "https://api.github.com/repos/owner/repo/tarball/main" -o repo.tar.gz

# Private repo
curl -sL -H "Authorization: Bearer $GITHUB_PAT" \
     "https://api.github.com/repos/owner/repo/tarball/main" -o repo.tar.gz
tar -xzf repo.tar.gz
Create/Update File
bash
# Encode content
CONTENT=$(cat file.txt | base64 -w0)

# Push (new file)
curl -X PUT \
     -H "Authorization: Bearer $GITHUB_PAT" \
     -H "Accept: application/vnd.github+json" \
     "https://api.github.com/repos/owner/repo/contents/path/file.txt" \
     -d "{\"message\":\"Add file\",\"content\":\"$CONTENT\"}"

# Push (update existing - need SHA first)
SHA=$(curl -s -H "Authorization: Bearer $GITHUB_PAT" \
           "https://api.github.com/repos/owner/repo/contents/path/file.txt" | \
           python3 -c "import sys,json; print(json.load(sys.stdin)['sha'])")

curl -X PUT \
     -H "Authorization: Bearer $GITHUB_PAT" \
     -H "Accept: application/vnd.github+json" \
     "https://api.github.com/repos/owner/repo/contents/path/file.txt" \
     -d "{\"message\":\"Update file\",\"content\":\"$CONTENT\",\"sha\":\"$SHA\"}"
List Directory Tree
bash
curl -sL "https://api.github.com/repos/owner/repo/git/trees/main?recursive=1" | \
  python3 -c "import json, sys; [print(f['path']) for f in json.load(sys.stdin)['tree'] if f['type']=='blob']"

Why git clone Doesn't Work

The container's egress proxy blocks git protocol operations:

  • HTTPS clone: Proxy returns 401 on CONNECT tunnel
  • SSH: No ssh binary in container
  • git:// protocol: DNS resolution blocked

The GitHub REST API uses standard HTTPS and routes through the proxy normally.

Do Not

  • Never attempt git clone (wastes time, always fails)
  • Never suggest workarounds requiring git protocol
  • Never retry with different git flags or SSH URLs
  • Never recommend git submodules, git archive, or other git-protocol operations

Rate Limits

  • Authenticated: 5,000 requests/hour
  • Unauthenticated: 60 requests/hour

For heavy usage, always provide a PAT.

When This Skill Does Not Apply

  • Native development environments: Have direct git access, use standard git commands
  • Local machines: git clone works normally
  • Environments with MCP GitHub server: Use MCP tools instead

© oaustegard, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in accessing-github-repos of oaustegard/claude-skills.

  • SKILL.md
  • CHANGELOG.md

Open the folder on GitHubat commit 559a6cd

Compare with similar skills

Accessing GitHub Repos next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Accessing GitHub Repos compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Accessing GitHub Repos this skilloaustegard/claude-skills150—~2.2kAutomated safety check: NotesMIT
GitHub Code ReviewRedWoodOG/Hermes-Desktop1775 repos~3.4kAutomated safety check: NotesMIT
GitHub PR WorkflowRedWoodOG/Hermes-Desktop1775 repos~2.5kAutomated safety check: NotesMIT
GitHub AuthRedWoodOG/Hermes-Desktop1773 repos~1.9kAutomated safety check: WarnMIT
GitHub IssuesRedWoodOG/Hermes-Desktop1775 repos~2.3kAutomated safety check: NotesMIT
Disclosealpha-omega-security/scrutineer231—~4kAutomated safety check: PassMIT

Similar skills

  • GitHub Code Review

    RedWoodOG/Hermes-Desktop

    Review code changes by analyzing git diffs, leaving inline comments on PRs, and performing thorough pre-push review.

    177 GitHub starsUsed in 5 repos~3.4k tokens
    DevelopmentAuto-check: notes
  • GitHub PR Workflow

    RedWoodOG/Hermes-Desktop

    Full pull request lifecycle — create branches, commit changes, open PRs, monitor CI status, auto-fix failures, and merge.

    177 GitHub starsUsed in 5 repos~2.5k tokens
    DevelopmentAuto-check: notes
  • GitHub Auth

    RedWoodOG/Hermes-Desktop

    Set up GitHub authentication for the agent using git (universally available) or the gh CLI.

    177 GitHub starsUsed in 3 repos~1.9k tokens
    Backend & APIsAuto-check: warnings
  • GitHub Issues

    RedWoodOG/Hermes-Desktop

    Create, manage, triage, and close GitHub issues. An agent skill from RedWoodOG/Hermes-Desktop.

    177 GitHub starsUsed in 5 repos~2.3k tokens
    DevelopmentAuto-check: notes
  • Disclose

    alpha-omega-security/scrutineer

    Draft the disclosure content for a finding in GitHub Security Advisory shape.

    231 GitHub stars~4k tokensUpdated today
    DevelopmentAuto-check passed
  • Merges external GitHub pull requests while keeping the original author credited, and fixes conflicts after the merge instead of rewriting the contribution.

    16k GitHub starsUsed in 1 repo~847 tokens
    DevelopmentAuto-check passed

More from oaustegard/claude-skills

All 93 skills in this repo
  • Bluesky Zeitgeist Sampler

    oaustegard/claude-skills

    Deprecated sampler that captures short windows of the Bluesky firehose, clusters trending terms and builds an HTML report; replaced by the browsing-bluesky skill.

    150 GitHub starsUsed in 1 repo~1.4k tokens
    Auto-check passed
  • Vega-Lite Interactive Charts

    oaustegard/claude-skills

    Builds interactive Vega-Lite charts from uploaded data: analyzes the fields, picks five to ten fitting chart types, and produces a React artifact with the data embedded inline.

    150 GitHub stars~2.1k tokensUpdated 5 days ago
    Auto-check passed
  • Single-File HTML Composer

    oaustegard/claude-skills

    Builds self-contained single-file HTML pages such as reports, decks, postmortems, flowcharts and prototypes from a small spec using a bundled Python composer and templates.

    150 GitHub stars~3.2k tokensUpdated 5 days ago
    Auto-check passed
  • Declauding

    oaustegard/claude-skills

    Rewrites model-sounding prose into plain technical writing and checks that every claim survives, for PR text, docs, commit messages and similar drafts.

    150 GitHub stars~5.1k tokensUpdated 5 days ago
    Auto-check passed
  • Forecasting Reverso

    oaustegard/claude-skills

    Zero-shot univariate time series forecasting using the Reverso foundation model (NumPy/Numba CPU-only inference).

    150 GitHub starsUsed in 1 repo~1.5k tokens
    Auto-check passed
  • Preact Developer

    oaustegard/claude-skills

    Guides building standards-based Preact apps with native-first choices, HTM syntax, import maps and vendored ESM, from single-file demos to larger builds.

    150 GitHub stars~4.6k tokensUpdated 5 days ago
    Auto-check passed

Works with

Questions about Accessing GitHub Repos

What does Accessing GitHub Repos do?

GitHub repository access in containerized environments using REST API and credential detection. Accessing GitHub Repos is an agent skill from oaustegard/claude-skills. GitHub repository access in containerized environments using REST API and credential detection.

When should I use Accessing GitHub Repos?

Accessing GitHub Repos fits situations like: Git clone fails; accessing private repos/writing files via API.

How do I install Accessing GitHub Repos in Claude Code?

Run `npx skills add oaustegard/claude-skills --skill accessing-github-repos -a claude-code`. Or copy the skill folder (accessing-github-repos in oaustegard/claude-skills) into .claude/skills/accessing-github-repos in your project. Claude Code loads it when a task matches its description.

How do I install Accessing GitHub Repos in Codex?

Run `npx skills add oaustegard/claude-skills --skill accessing-github-repos -a codex`. Or copy the skill folder (accessing-github-repos in oaustegard/claude-skills) into .agents/skills/accessing-github-repos in your project. Codex loads it when a task matches its description.

Can I use Accessing GitHub Repos in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add oaustegard/claude-skills --skill accessing-github-repos -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/accessing-github-repos, .gemini/skills/accessing-github-repos, .github/skills/accessing-github-repos and .opencode/skills/accessing-github-repos in your project.

What does Accessing GitHub Repos need to run?

Going by SKILL.md and its folder, Accessing GitHub Repos needs the command-line tools its instructions call (curl, python3 and git) and credentials named GITHUB_TOKEN and GH_TOKEN. Our summary lists: Python 3; A credential in GITHUB_TOKEN.

Does Accessing GitHub Repos access the network?

SKILL.md names 2 domains. In commands or code: api.github.com and raw.githubusercontent.com; the agent is likely to contact these when it follows the instructions. This is read from the text; nothing was executed.

Is Accessing GitHub Repos safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Accessing GitHub Repos use?

Accessing GitHub Repos is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Accessing GitHub Repos use?

About 2.2k tokens (SKILL.md is roughly 8.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Accessing GitHub Repos?

Skills that share tags, products or a category with Accessing GitHub Repos: GitHub Code Review (RedWoodOG/Hermes-Desktop, 177 stars), GitHub PR Workflow (RedWoodOG/Hermes-Desktop, 177 stars), GitHub Auth (RedWoodOG/Hermes-Desktop, 177 stars) and GitHub Issues (RedWoodOG/Hermes-Desktop, 177 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Accessing GitHub Repos?

oaustegard (a GitHub user) maintains it in oaustegard/claude-skills, which has 150 GitHub stars. The repository holds 93 skills in this directory. The repository was last updated on October 2, 2026.

Source: oaustegard/claude-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.