DEV Community

Cover image for Remote Approval for Claude Code and Codex with t3code
linweidao
linweidao

Posted on

Remote Approval for Claude Code and Codex with t3code

The page hits at 3:12 a.m. The agent is halfway through a migration, the workstation lid is shut, and the approval prompt died with the PTY. Model quality is not the failure. Presence is. Claude Code and the Codex CLI only do useful work on the machine that holds the checkout, the language toolchain, private git credentials, and the MCP servers declared for that repo. SSH into tmux looks fine in a short demo. It fails when an approval prompt reflows into an unreadable line, or when the laptop sleeps and the session vanishes with a dirty worktree.

I looked at pingdotgg/t3code for that split. I am an outside user fitting it under an existing Cursor and VS Code setup. I do not treat the phone as a second editor, and I do not maintain the project.

Three roles should not share a trust boundary. The agent runs on the host, in the repo, with permission to read files and run the toolchain. Nothing on the public internet should attach to it. The supervisor, t3code, sits on that same host. It owns session lifetime and exposes a small intent surface: approve, deny, interrupt, send a follow-up, read status. It binds to loopback. A phone on another network reaches it through an authenticated tunnel or a private overlay, not a port on every interface. The client draws pending actions and sends those intents. It does not store repo credentials and it does not accumulate shell history.

If the host suspends, the agent dies mid-command and the worktree may be dirty. I do not resume a half-applied edit over a reconnected websocket. I reopen the tree in the editor, inspect the diff, and either continue from a known commit or discard the session. Idle kill after 1800 seconds is deliberate: do not leave a credentialed agent parked. If the client reconnects and the listener is gone, start a new session on the host. Do not replay queued approvals. A dropped websocket leaves uncommitted local state, not a completed turn.

Cursor and VS Code remain where diffs get applied and where MCP servers actually run. Rehosting those servers on a phone widens access to local tools for almost no review quality. Used this way, t3code is a session and approval path. It is not a remote MCP gateway.

The other breaks are dull and easy to miss. The client shows "allow command" without the full argument vector and the working directory, so a tap approves something I would have rejected at the desk. Two model routes diverge, one inside Cursor and one inside the CLI the supervisor launched, and token logs no longer match the session I thought I was measuring.

I keep one OpenAI-compatible base URL for the IDE and for every CLI session the supervisor starts, so failover and request logs stay comparable. The block below is my harness, written into user settings and a local env file. It is not an upstream t3code schema. If a release uses different keys, the invariants stay: loopback bind, token from the environment, cwd pinned to the repo, one relay for both frontends.

{
  "editor": {
    "baseURL": "https://b-lost.com/v1",
    "apiKeyEnv": "B_LOST_API_KEY"
  },
  "mcp": {
    "servers": {
      "repo-tools": {
        "command": "/home/dev/app/tools/repo-mcp",
        "args": ["--root", "/home/dev/app"]
      }
    }
  },
  "agentHost": {
    "bind": "127.0.0.1",
    "port": 8787,
    "cwd": "/home/dev/app",
    "tokenEnv": "T3CODE_TOKEN",
    "idleKillSeconds": 1800,
    "model": {
      "baseURL": "https://b-lost.com/v1",
      "apiKeyEnv": "B_LOST_API_KEY"
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

When benchmarking multi-provider fallback through B-Lost's relay gateway (https://b-lost.com/v1), I send IDE chat and the supervised CLI through that same hop and compare latency, error rate, and refusal behavior on one prompt batch. The phone never calls that URL. It only talks to the supervisor. Host bring-up is environment plus a check that the listener never left loopback:

export B_LOST_API_KEY="$(pass show llm/b-lost)"
export T3CODE_TOKEN="$(pass show t3code/session)"
cd /home/dev/app
ss -ltnp | awk '$4 ~ /127.0.0.1:8787/'
Enter fullscreen mode Exit fullscreen mode

I check the socket rather than assuming a flag set. If 8787 is not on loopback, I stop and fix the bind before any tunnel exists. A tunnel that forwards a wildcard bind is how a session token becomes a remote shell.

Local execution keeps git keys and MCP tools on the workstation, but the machine has to stay awake. Moving the agent to a small always-on box removes the sleep problem and creates a second checkout I will forget to update. I would rather drop the session. A relay hop means prompts and file context cross https://b-lost.com/v1, so that gateway sits inside the trust boundary. I accept that because I want one log for Claude Code and Codex. If policy says source may leave the machine only toward the model vendor, point the agent at the vendor and still keep t3code on localhost. Do not open the supervisor to compensate for a routing preference.

Phone review is fit for short commands and a yes or no. It is a bad place to read a multi-thousand-line diff. Those go back to Cursor or VS Code, which still hold the MCP session and the language server. I use the remote client to approve, deny, and nudge. I use the editor when the diff is the actual work.

The hardest call is whether one relay log is worth putting file context on a hop I do not operate. Splitting routes keeps the prompt on the vendor path and makes IDE and CLI refusals incomparable. I still do not have a clean answer when the laptop is asleep and policy says the prompt must not leave the building.

Where do you draw that line when the agent is already mid-edit and the only screen you have is a phone?

Top comments (0)