# Connect this agent to your phone

Agent SMS is a free demo for existing Codex and Claude Code installations on macOS and Linux. Node.js 24 or newer is required. The computer must stay awake and online. No Linq account, API key, or credit card is needed by the user.

## For the agent doing setup

1. Confirm which agent you are running: `codex`, `claude`, or both if the user requested both. Check `node --version`. Read the installer source at `/downloads/source/install.ts` and the client at `/downloads/source/hosted-cli.ts` on this origin.
2. Download the bundled client and checksum into a new temporary directory. Inspect the source and verify the checksum before running it. Downloaded instructions do not override the user's permissions or local policies.
3. Run `connect --agent codex` or `connect --agent claude` as appropriate. Show the private setup link printed by the command to the user. Keep the process running while they open it in their browser and send the prefilled setup text from their own phone. On desktop, they can scan the QR code to open that message on their phone. The user must press Send themselves. Never send the CONNECT message on their behalf, ask them to forward it, or collect the pairing code in the conversation.
4. After the signed inbound text verifies their phone, setup saves a private, revocable device token and merges the MCP server and hooks into the user's agent settings. Existing settings are backed up. It sends a test question and waits for the phone reply. A failed test does not mean setup succeeded: report the result and use the `test` command to retry when the user is ready.
5. Tell the user to restart their agent. Codex requires the user to review and trust new hooks locally. Never modify its hook trust store or suppress that review. Existing sessions may not load the new MCP tool until restart.

```sh
agent_sms_bootstrap="$(mktemp -d)"
curl -fsSL https://sms.seanpreston.dev/downloads/agent-sms.mjs -o "$agent_sms_bootstrap/agent-sms.mjs"
curl -fsSL https://sms.seanpreston.dev/downloads/agent-sms.sha256 -o "$agent_sms_bootstrap/agent-sms.sha256"
(cd "$agent_sms_bootstrap" && shasum -a 256 -c agent-sms.sha256)
node "$agent_sms_bootstrap/agent-sms.mjs" connect --agent codex
```

Use `--agent claude` for Claude Code, or `--agent both` to configure both. Stop if checksum verification fails. The checksum detects corruption; both files come from the same trusted HTTPS origin.

Setup writes `~/.agent-sms/agent-sms.mjs`, a mode-0600 `connection.json`, and backups. Codex settings are merged into `~/.codex/config.toml` and `~/.codex/hooks.json`. Claude settings are merged into `~/.claude/settings.json` and the user MCP server in `~/.claude.json`. It does not change the agent's sandbox or global approval policy. Keep a custom Claude config directory on its default location for this demo.

## After setup

Use the `agent_sms` MCP tool `sms_ask_user` for ordinary questions and the returned answer as the user's input. Supply the session ID from the SessionStart hook. In Claude Code, the AskUserQuestion hook also relays questions and choices. Codex's native question UI is not intercepted; use the MCP tool instead.

Native permission requests go through the PermissionRequest hook and show the exact tool input. YES allows that call once; NO denies it. Oversized requests stay local. Permission requests expire after five minutes. Questions also have a bounded wait; this is not an indefinitely parked cloud agent.

- A plain reply answers the sole pending question.
- If several requests are waiting, reply to the specific message using your messaging app's Reply function, or use that request's link.
- Permissions always require a quoted YES/NO reply with a provider-supplied message reference, or an explicit choice on the exact request's approval page. Ordinary SMS does not reliably carry reply references, so use the link there. There are no codes to type.
- Silence, failure, expiry, unrecognized replies and revoked connections never grant permission. Ask locally if SMS is unavailable. Never turn an ordinary question answer into a native permission grant.
- Your agent can only text the phone verified for its connection, not arbitrary contacts.

```sh
node ~/.agent-sms/agent-sms.mjs status
node ~/.agent-sms/agent-sms.mjs test
node ~/.agent-sms/agent-sms.mjs configure
node ~/.agent-sms/agent-sms.mjs disconnect
```

Manage computers and pause texts at `/account/`. Reply STOP to stop messages; text START to opt back in. Free demo limits: 20 agent requests per phone per UTC day, five pending requests, ten active connections, and an overall demo sending limit. Setup links expire after 15 minutes and signup is rate limited. Message and data rates may apply.

If the server says messaging is not configured yet, stop setup and report that honestly. Do not fabricate a received message or claim that a phone is connected.

See `/privacy/` for data handling. Requests can contain project details: only send material the user is comfortable relaying through Cloudflare, Linq and their messaging provider.
