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

# Machine sharing

> Open a machine to your whole organization with one command, with your agent logins removed from it every time.

Sharing makes one of your machines reachable by every member of your organization. It takes one command, only the owner can do it, and it is reversible.

```bash
boxd machine share staging         # every member of the org can now connect
boxd machine unshare staging       # back to private, yours alone again
```

Once shared, any member runs `boxd connect staging` and lands on the same machine. Unsharing only changes **who can reach it**, never who's billed.

<video autoPlay muted loop playsInline src="/videos/boxd-m-share.mp4" />

One command, and the whole org can reach the machine.

> [!NOTE]
>
> **Sharing controls organization access, and the web URL is a separate thing.** The machine's `https://<machine>.boxd.sh` URL is already public to the internet. Sharing decides which **org members** can get a shell on the machine.

## The agent login handoff

A machine you've been working on holds your own agent logins on disk. Claude Code, Codex, and OpenCode keep their tokens in your home directory, and the moment a machine becomes reachable by the rest of your org, those tokens should not be sitting there for anyone with a shell to read.

boxd enforces this for you. **Sharing a machine wipes the agent logins on it the moment it goes shared**:

```text
~/.claude/.credentials.json          # Claude Code
~/.codex/auth.json                   # Codex
~/.local/share/opencode/auth.json    # OpenCode
```

While the machine stays shared, boxd serves no personal login to it and keeps these files out of login sync, so a login made on a shared machine stays on that machine and reaches none of your private machines. `git` and `gh` on the machine also switch from your personal [Git](/guides/integrations/connections.md#git) sign-in to the **organization's GitHub App**, so repo access on a shared machine belongs to the org rather than to you.

The guarantee is that **no member's personal login is ever left readable on a machine the rest of the org can reach**.

### Unsharing brings your logins back

Run `boxd machine unshare` and the machine is private to you again. Your agent logins come back too:

* **Claude Code and Codex.** They re-authenticate automatically. boxd serves your Claude Code and Codex logins for that org the next time you start a session on the machine.
* **OpenCode.** It needs an `opencode` login on the machine, since OpenCode has one login per machine. After that it persists, because a private machine is never wiped.

> [!WARNING]
>
> **Don't share a machine while an agent is working inside it.** Sharing wipes agent logins live, so a Claude Code, Codex, or OpenCode session running in that machine is logged out mid-task. If you need to share a machine an agent is using, make sharing the last step of the run, and expect to log in again afterward.

## Fork a shared machine for private work

Forking a shared machine gives you a **private fork by default**. The org keeps paying, the copy is yours alone, and your agent logins work in it right away:

```bash
boxd machine fork staging            # private fork: org-billed, yours alone, agent logins served
boxd machine fork staging --shared   # keep the fork shared with the whole org instead
```

A private fork is reachable only by you, so nothing gets wiped. Claude Code and Codex re-authenticate automatically, because boxd serves your own logins for that org to the fork. OpenCode needs a login on the fork, and that login persists. This is the way to take a shared machine and do authenticated work on a copy without touching the shared source machine. Pass `--shared` when you want the fork to stay open to the org. Forking a private machine works the same way, and the fork stays private.

## At a glance

| You run | Reachable by | Billed to | Agent logins on the machine |
| - | - | - | - |
| `boxd machine share <machine>` | Whole org | Org | Wiped on share, `git` and `gh` switch to the org's GitHub App |
| `boxd machine unshare <machine>` | You only | Org | Claude Code and Codex served again, OpenCode needs a login |
| `boxd machine fork <machine>` on a shared machine | You only | Org | Claude Code and Codex served, OpenCode needs a login |
| `boxd machine fork <machine> --shared` | Whole org | Org | Wiped (stays shared) |

See the [CLI reference](/cli/commands.md#organizations) for every flag, and [Authentication](/cli/authentication.md#org-context) for how billing and org context work.
