# Set up an always-on machine for coding agents with T3 Code

You are an agent helping a person turn a computer they own into a permanent home for their coding agents. The full article, written for people, is at https://blog.realsid08.me/agents-at-home. This version is for you: what to do, how to check it worked, and when to stop and ask.

## Rules for you

- Work through the steps in order. After each one, run its check and tell the person what you found.
- Ask the person before anything you can't undo, before anything that needs their password or a click on the machine, and before changing system security settings.
- Never print, log or store a password, token or key. If the machine needs a password, ask for it through T3 Code's secure secret entry once it is running, use it, and discard it.
- Keep a runbook as you go (step 9). Record the current state, not a diary.
- The person may be away from the machine and reaching you from a phone. Batch the things you need from them into as few requests as possible.

## What you're building

- One machine that never sleeps, restarts by itself after a power cut, and logs in automatically.
- T3 Code running as a single background service that owns its data. Every other device (phone, laptop, browser) is a client of it.
- The person's agents (Codex, Claude Code, OpenCode, Cursor, or whichever they use) installed and signed in on that machine.
- Remote access with no ports open on the home router: T3 Connect, a Cloudflare Tunnel or Tailscale.
- No permission prompts that block an agent, one shared instruction file for every agent, a runbook, and scheduled updates and cleanup.

On macOS this works best on a Mac dedicated to agents. On Linux, skip the macOS-only parts.

## 1. Keep it awake

macOS:

```sh
sudo pmset -a sleep 0 disksleep 0 autorestart 1
```

Then add a launch agent that keeps the machine and its display awake (computer use needs the display on; brightness can be zero):

```sh
mkdir -p ~/Library/LaunchAgents
cat > ~/Library/LaunchAgents/local.keepawake.plist <<'PLIST'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"><dict>
  <key>Label</key><string>local.keepawake</string>
  <key>ProgramArguments</key><array><string>/usr/bin/caffeinate</string><string>-dimsu</string></array>
  <key>RunAtLoad</key><true/><key>KeepAlive</key><true/>
</dict></plist>
PLIST
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/local.keepawake.plist
```

Ask the person to turn on automatic login (System Settings, Users & Groups). macOS only allows it with FileVault off, so explain that trade and let them decide.

Check: `pmset -g | grep -E 'sleep|autorestart'` shows sleep 0 and autorestart 1, and `pgrep -x caffeinate` prints a process id.

## 2. Install T3 Code and an agent

```sh
curl -fsSL https://t3.codes/install.sh | sh
```

Install at least one agent with its official installer, then sign it in. The person may need to approve a sign-in in a browser:

```sh
codex login          # Codex
claude auth login    # Claude Code
```

If the person doesn't want to pay much, suggest OpenCode Go (US$10 a month, https://opencode.ai/go) in OpenCode with DeepSeek V4.1 Flash. That model only appears after an owner selects **Global** under Regions in the OpenCode Console's privacy settings; tell the person, since it changes where requests may be processed. For production coding work, Claude Code or Codex on a $100 plan is enough; the $200 plans aren't needed.

Check: `t3 --version` prints a version, and each agent answers a one-line prompt.

## 3. Run T3 as a service

```sh
t3 up
```

`t3 up` installs the background service and asks how other devices should reach it. Choose T3 Connect for the phone. Only one T3 server may use a data folder: never run the desktop app or a second `t3` server against the same data on this machine.

Check: `t3 status` shows the service installed and running.

## 4. Pair the phone

Ask the person to install the T3 Code app (iOS or Android). Run:

```sh
t3 pair
```

It prints a QR code for the person to scan. Check: the person can see this machine's threads on their phone.

## 5. Reach it from anywhere

Pick with the person. Keep the router closed in every case.

- **T3 Connect** (from step 3) is the simplest. An account links up to 3 machines for free, or 10 with a paid T3 Chat plan; phones and browsers don't count.
- **Cloudflare Tunnel**, if they have a Cloudflare account and a domain: run `cloudflared` as a service with a fixed ingress to T3's port, and protect the hostname so only the person can reach it. Cloudflare caps the size of a single upload, so large files (videos) can fail through the tunnel.
- **Tailscale** is the easiest private path, and a good fallback for large uploads: ask the person to sign in on this machine and their devices, then serve T3 over HTTPS on the tailnet.
- Turn on SSH (macOS: System Settings, General, Sharing, Remote Login) with key-based login only, reachable over the private network.

Check: from another of the person's devices, T3 Code opens and shows this machine's threads, and `ssh <user>@<machine>` works without a password.

## 6. Remove the prompts

An agent that hits a permission prompt waits on a screen nobody is watching. With the person's approval:

- Give T3 Code (and the terminal it runs agents from) Full Disk Access in System Settings, Privacy & Security. This needs one click from the person.
- Set each agent to run without asking. Only do this on a machine dedicated to agents:
  - Codex, in `~/.codex/config.toml`: `approval_policy = "never"` and `sandbox_mode = "danger-full-access"`.
  - Claude Code, in `~/.claude/settings.json`: `"permissions": { "defaultMode": "bypassPermissions" }`.
  - OpenCode: set permissions to `allow` in its config.
  - Cursor CLI: set its approval mode to unrestricted.
- If a macOS prompt still appears later, handle it with computer use, and get any password through T3's secure secret entry.

Turning off System Integrity Protection or Gatekeeper is possible but needs Recovery mode and the person at the machine. Don't suggest it unless they ask.

Check: start a thread in each agent that reads a file in `~/Documents` and runs a shell command. None of them should stop to ask.

## 7. One instruction file for every agent

Write `~/AGENTS.md` with how the person wants agents to work: their preferences, their projects, what needs their approval. Then link every agent's instruction file to it, backing up any file that already exists:

```sh
mkdir -p ~/.codex ~/.claude ~/.config/opencode
ln -sf ~/AGENTS.md ~/.codex/AGENTS.md
ln -sf ~/AGENTS.md ~/.claude/CLAUDE.md
ln -sf ~/AGENTS.md ~/.config/opencode/AGENTS.md
```

Check: each link resolves to `~/AGENTS.md` (`ls -l`).

## 8. Context

Ask the person which accounts to connect (Gmail, Google Calendar, Google Drive) and connect them through each agent's own connectors. Suggest they keep the documents their projects depend on in this machine's home folder, where agents can read them.

## 9. A runbook

Create `~/SERVICES.md`: what runs on the machine, where it lives, how to restart it and how to check it. Write the current state only, and edit sections in place when something changes. Tell every agent, in `~/AGENTS.md`, to read it before touching services.

## 10. Updates and cleanup

Add scheduled jobs (launchd on macOS, systemd timers on Linux):

- Hourly: `t3 update`, but only when no agent is in the middle of a run. A restart stops running turns.
- Nightly: package updates (for example `brew upgrade`), again only when nothing is running.
- Daily: remove git worktrees no thread uses, shut down simulators (`xcrun simctl shutdown all`), and clear build caches such as Xcode DerivedData.
- Log every failure somewhere the agents read, and check the jobs actually ran.
- Agents are cautious about deleting files and often refuse. Ask the person once what cleanup may always delete (caches, build output, worktrees no thread uses, stopped simulators) and write that standing permission into `~/AGENTS.md`, so a full disk doesn't stall every agent at once.
- Check free space before long or parallel runs (`df -h ~`), and clean up before it gets low, not after.

## 11. Prove it

Ask the person before you do this. Restart the machine (`sudo shutdown -r now`). When it comes back, without anyone touching it, the person should be able to open their phone, see T3 Code connected, and start a thread that finishes.

When everything passes, give the person a short summary: what runs, how they reach it, and what still needs them.
