# Tell me when it's done: get your agent to text you

**What it does:** gives your agent one command it can run at the end of a long job, so your phone
buzzes when the work is finished instead of you sitting there watching it think. Works with any
agent that can run a shell command: Claude Code, the Claude desktop app with a local server,
Cowork, the Codex CLI, Cursor, a cron job, anything.

**What it saved:** the whole category of "babysitting the session." Long jobs get started and
walked away from. Nothing silently finishes at 11pm and waits until morning to be noticed.

**Shown at:** AI Open House, by Colton Mulligan.

## What you need

| Tool | Cost |
|------|------|
| A Mac that stays awake (any Mac, ideally an always-on one) | hardware you have |
| Messages.app signed in to your own Apple account | $0 |
| The script in this folder (`notify.sh`) | $0 |
| Any agent that can run a shell command | your existing plan |

No API, no third-party service, no webhook to configure. The text comes from your own number,
because it is literally your own Messages app sending it.

## How to set it up, in four steps

1. **Drop the script somewhere stable** and make it runnable:
   `chmod +x ~/bin/notify.sh`
2. **Put your own phone number in the allowlist** at the top of the script, under a short key
   like `me`. Test it: `~/bin/notify.sh text me "hello from the robot"` . The first run makes
   macOS ask for permission to control Messages. Say yes once.
3. **Tell your agent it exists.** This is the step people skip, and it is the one that matters.
   Add these two lines to your standing instructions (`CLAUDE.md`, `AGENTS.md`, a Claude Project's
   instructions, your Cursor rules, whatever your tool reads at the start of every session):

   ```text
   TELL ME IT IS DONE: when a task takes more than a few minutes, or when I may have walked
   away, send me the result with: ~/bin/notify.sh text me "<one line of what happened>"
   Send it when the work is finished, without asking me first.
   ```

4. **Stop watching the screen.** That is the whole point.

## The two rules that keep this safe

- **A hard allowlist, never a raw number.** An outbound text from your Mac comes from your own
  number and is indistinguishable from you typing it. An agent that can text any number is an
  agent that can text a client. The script takes a key (`me`, `spouse`) and refuses anything
  else, so adding a recipient is a deliberate act, not an accident.
- **Every message says a machine wrote it.** The script stamps a marker on the front of every
  message. Anyone who gets a text from your number knows it was not you typing. That rule saves
  one awkward conversation per month.

The script also appends every send to a plain-text log, so you can always answer "what did it
send, and when."

## Make it talk back, not just announce

Once your agent can send, the natural next step is a reply you can answer from the couch:

- End the message with the actual decision, not a status: not "build finished", but
  "build finished, 2 tests failing, want me to fix them or stop here?"
- Keep the thread one-way for anything irreversible. A text is a notification channel, not an
  approval channel. Money, sends and deletes still wait for you at a keyboard.
- If you want the agent to react to your reply, have it read the chat on its next run rather than
  listening live. Simple beats clever, and nothing is sitting there burning tokens waiting.

## The prompt

```text
I want my agent to text me when a long job is done.

Write me one shell script at ~/bin/notify.sh for macOS that:
- takes a short recipient KEY (never a raw phone number) plus a message
- looks that key up in a hardcoded allowlist at the top of the file, and exits with an error
  on any key that is not listed
- sends the message as an iMessage through Messages.app with AppleScript
- puts a short marker at the front of every message so the person who gets it knows a machine
  sent it, not me
- appends one line per send to a log file: timestamp, key, result, message
- supports a --dry flag that prints exactly what would be sent and sends nothing

Then show me the two lines I should add to my standing instructions so you use it on your own
whenever a task runs long or I walk away.
```

## Stack card

```text
WHAT IT DOES:     Your agent texts you the result when a long job finishes
AI / MODEL:       Any agent that can run a shell command
STACK:            One bash script, Messages.app, AppleScript, a plain-text log
WHERE IT LIVES:   this recipe plus notify.sh in this folder
COST TO RUN:      $0
TIME SAVED:       Every minute ever spent watching an agent think
TIER SHARED:      working script plus the standing-instruction snippet
```

Built by Colton: https://builtbycolton.com

From the AI Open House free library: https://aiopenhouse.co/guests/#library
