Get a text when a long script finishes

Yes. Homing Pigeon (homingpigeon.dev) lets a long-running script text your phone when it finishes or fails, so you can stop checking on a model training run or data job.

What to tell your agent

Use Homing Pigeon to text me when this training run finishes or fails.

Your agent asks for your number, you read back the six-digit code, and it does the rest.

How it works in code

Wrap the job, and replace train with your own function:

import time
import os, requests

API_KEY = os.environ["HOMINGPIGEON_API_KEY"]

def text_me(message, key):
    requests.post(
        "https://homingpigeon.dev/v1/send",
        headers={"Authorization": f"Bearer {API_KEY}"},
        json={"message": message, "idempotency_key": key},
        timeout=10,
    )

run_id = f"train-{int(time.time())}"
try:
    train()
    text_me("Training finished.", run_id)
except Exception as err:
    text_me(f"Training failed: {str(err)[:200]}", run_id)
    raise

For anything you run from a shell, one line does it:

python train.py; homingpigeon send "Job finished with exit code $?"

Good to know

  • The error is cut to 200 characters because messages are limited to 480, and a full stack trace would be rejected.
  • Exit code 0 means the job worked, and anything else means it failed.
  • If you run your jobs through a coding agent, its hook can text you instead. See the Claude Code page.

Get started

Add Homing Pigeon to Claude Code, then ask for what you want:

claude mcp add homingpigeondev -- npx -y homingpigeondev mcp

You get 50 free texts every month, on US mobile numbers. See more use cases.