Accessing GitHub Repos (Containerized Envs)
Read and write GitHub repositories through the REST API and raw URLs when git clone is blocked in sandboxed containers.
Dev & CodingIntermediate★ 137⑂ 7AI score 9/10Last updated: Aug 12, 2026
What it does
- Replaces blocked
git clonein containerized AI environments with GitHub REST API + raw.githubusercontent.com access. - Ships Python helpers that auto-detect a PAT from
GITHUB_PAT,GH_PAT,GITHUB_TOKEN,GH_TOKENor project files like/mnt/project/.env. - Covers fetching single files, listing recursive directory trees, downloading repo tarballs, and creating/updating files (including SHA lookup) in both Python and bash.
- Documents an auth-level capability matrix, rate limits (5,000/hr authenticated vs 60/hr anonymous), and hard "never retry git clone" rules.
Who it's for
- Developers working inside network-restricted containers (Claude.ai Projects, code interpreters) who still need GitHub source.
- Anyone pulling private repo files or committing AI-generated changes straight back to a repo.
- Teams tired of wasted retries with SSH URLs, submodules, or alternate git flags.
Examples
- "List every file in this public repo" → calls
git/trees/main?recursive=1and prints all blob paths. - "Read
src/app.pyfrom my private repo and refactor it" → detects the PAT, calls the contents API, base64-decodes the file. - "Commit the edited file to main" → fetches the current file SHA, then PUTs the contents API to create an update commit.
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/oaustegard/claude-skills/HEAD/accessing-github-repos/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the accessing-github-repos folder from the GitHub repo oaustegard/claude-skills into my ~/.claude/skills/accessing-github-repos/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/oaustegard/claude-skills.git /tmp/claude-skills && mkdir -p ~/.claude/skills && cp -r /tmp/claude-skills/accessing-github-repos ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal and clone the repo:
git clone https://github.com/oaustegard/claude-skills.git - Create the skills folder:
mkdir -p ~/.claude/skills - Copy this skill in:
cp -r claude-skills/accessing-github-repos ~/.claude/skills/ - (For private repos or write access) Go to GitHub → Settings → Developer settings → Fine-grained tokens and create a token with Contents: Read (and Write if pushing).
- Expose the token:
export GITHUB_PAT=github_pat_...or addGITHUB_PAT=...to your project.envfile. - If using Claude.ai Projects, allowlist
api.github.comandraw.githubusercontent.comfor network access. - Restart Claude Code and test with a prompt like "fetch this repo's file list via the GitHub API".
View source on GitHub ↗License: MIT