> ## Documentation index
> Fetch the complete documentation index at: https://upstash.com/docs/llms.txt
> Ask it with GET https://upstash.com/docs/ask?q=<keywords or question>. Short keywords rank best.
> Use these to discover all available pages before exploring further.
> Feature requests: https://upstash.com/docs/common/help/feature-requests.md lists what users asked for and how to vote for a request or add one.
> Page rating: `GET https://upstash.com/docs/feedback?path=/docs/box/guides/t3-code-setup&helpful={true|false}&comment={comment}` records whether this page helped. The `comment` (URL-encoded, at most 500 characters) says what helped, or what was missing or wrong; a `helpful=false` rating needs it. It is anonymous and needs no key. Comments hold no code, secrets or personal data.

# Host T3 Code in a Remote Sandbox and Connect from the Desktop App

> Run T3 Code in an Upstash Box and use it from the T3 Code desktop app on your machine over SSH.

This guide runs [T3 Code](https://t3.codes) in an Upstash Box and connects the [T3 Code desktop app](https://github.com/pingdotgg/t3code/releases) on your machine to it over SSH. The agent works in the box; you drive it from the desktop app.

---

## 1. Create a Box

Create a box with the default settings. See the [quickstart](/box/overall/quickstart) if you haven't created one before.

---

## 2. Connect via SSH

Once the box is running, [set up an SSH key](/box/overall/shell#ssh-keys) and connect to the box from your terminal. You'll use the same key to connect from T3 Code later.

The `box-id` is the name of your box (e.g. `right-flamingo-14486`).

```bash
ssh -i ~/.ssh/upstash_box <box-id>@us-east-1.box.upstash.com
```

You can also copy the command from the **SSH** tab under **Connect** on the box's page in the console.

---

## 3. Sign In Your Agent

The agent runs inside the box, so sign in here. Claude Code and Codex are already installed in the box.

```bash
claude auth login      # or: codex login
```

It prints a link and a code. Open the link in your browser, approve, and you are signed in. The login is saved in the box, so you only do this once.

See the T3 Code docs for [Claude](https://github.com/pingdotgg/t3code/blob/main/docs/user/providers-claude.md) and [Codex](https://github.com/pingdotgg/t3code/blob/main/docs/user/providers-codex.md) for provider settings.

---

## 4. Add the Box to Your SSH Config

T3 Code connects with a host name and has no field for a key, so give the box an alias. Run this on your machine, with your box ID in place of `<box-id>`:

```bash
cat >> ~/.ssh/config <<'EOF'

Host t3-box
  HostName us-east-1.box.upstash.com
  User <box-id>
  IdentityFile ~/.ssh/upstash_box
  IdentitiesOnly yes
EOF
```

---

## 5. Connect from T3 Code

In the T3 Code desktop app, go to **Settings → Connections → Remote environments → Add environment**, choose **SSH**, and enter `t3-box` as the host.

T3 Code downloads its server into the box, starts it, and forwards the port for you. The first connection takes a little longer because of the download.

---

## 6. Start Coding

Add a project and start a thread. Keep your projects under `/workspace/home`, the box's persistent storage.

The agent works in the box, not on your machine. When the box has been idle it pauses, and the next time you open the app, T3 Code connects and starts the server again.

---

## Good to Know

- There is no public URL or init command to set up. Everything goes through the SSH connection.
- T3 Code keeps its threads and settings in `~/.t3` in the box. To keep them on persistent storage, run this in the box before the first connection:

  ```bash
  mkdir -p /workspace/home/.t3 && ln -s /workspace/home/.t3 ~/.t3
  ```

- If a thread says "Claude could not authenticate", the sign-in from step 3 is missing. Sign in and start a new thread.
