---
title: "GitHub access"
description: "What the GitHub token reaches, how to narrow it, and how to change or remove it."
---

> Documentation Index
> Fetch the complete documentation index at: https://skyworker.system3inference.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# GitHub access

Private repositories, `git push` and `gh` need a GitHub token. `init` sets it up once. `skyworker git-token` sets it later.

## How the token works

The token is the Worker secret `GITHUB_TOKEN`. It never enters a workspace. A request from a workspace to `github.com` carries a placeholder. The Worker adds the real token on the way out. The disk, the environment and every snapshot hold only the placeholder.

`git clone`, `pull`, `push` and `gh` work in every workspace. Every GitHub request from a workspace carries the token.

Without a token, public repositories still clone. Private ones do not clone, and push fails. `connect` says so before the clone. `skyworker doctor` says if the Worker has a token.

## Choose what the token reaches

| Token | Reach |
| --- | --- |
| The `gh` login of this machine (the choice of `init`) | Every repository you can reach, from every workspace |
| A fine-grained token | Only the repositories the token names |

An agent runs with no permission prompts in Claude Code and Codex. Text that an agent reads, such as an issue or a web page, can tell it to do something you did not ask for. With the `gh` login, that reaches all your repositories.

To hold an agent to a few repositories:

1. On GitHub, make a fine-grained token. Give it Contents read and write on the repositories you choose. Add Pull requests read and write for `gh pr`.
2. Run `skyworker git-token` and paste the token.

GitHub holds the limit. One token serves the whole install. To work in one more repository, add it to the token on GitHub.

`init` and `git-token` print what the token you gave reaches.

## Set, change or remove the token

Pipe the token in. It is never an argument.

```sh
gh auth token | skyworker git-token
```

Run `skyworker git-token` alone to type the token. It asks without an echo.

```sh
skyworker git-token --remove
```

`--remove` deletes the secret from the Worker. A running workspace picks up a change at its next `connect`.

`skyworker init --no-github` skips GitHub when you install. `--token-file <path>` names a Cloudflare API token file for the command.

## What the agent pushes

An agent pushes only to `origin` of its checkout. A closing instruction tells it never to make or pick another repository.

Review what an agent pushes.

Source: https://skyworker.system3inference.dev/docs/guides/github-access/index.mdx
