Claude Skill MartBrowse skillsQuick linesLearn by videoTerminal guideWhat is a Skill?
← Back to list

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★ 150⑂ 6AI score 9/10Last updated: Sep 25, 2026

What it does

  • Replaces blocked git clone in 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_TOKEN or 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

  1. "List every file in this public repo" → calls git/trees/main?recursive=1 and prints all blob paths.
  2. "Read src/app.py from my private repo and refactor it" → detects the PAT, calls the contents API, base64-decodes the file.
  3. "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)
  1. Download the ZIP with the button below.
  2. In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
  3. Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
↓ Download 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.

  1. Open a terminal and clone the repo: git clone https://github.com/oaustegard/claude-skills.git
  2. Create the skills folder: mkdir -p ~/.claude/skills
  3. Copy this skill in: cp -r claude-skills/accessing-github-repos ~/.claude/skills/
  4. (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).
  5. Expose the token: export GITHUB_PAT=github_pat_... or add GITHUB_PAT=... to your project .env file.
  6. If using Claude.ai Projects, allowlist api.github.com and raw.githubusercontent.com for network access.
  7. Restart Claude Code and test with a prompt like "fetch this repo's file list via the GitHub API".