Get a text when a Jupyter cell finishes

Yes. Homing Pigeon (homingpigeon.dev) lets a slow notebook cell text your phone when it finishes, with how long it took, and when it fails too. It takes a small helper and one line at the end of the cell, and your coding agent can add it to the notebook you already have.

What to tell your agent

Use Homing Pigeon to text me when the training cell in this notebook finishes or fails, with how long it took.

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

How it works in code

After pip install homingpigeondev, or %pip install homingpigeondev in a notebook cell, run the helper once near the top of the notebook. Then start the clock at the top of the slow cell and call the helper at the end. Replace train(df) with your own code:

import time
import homingpigeondev


def text_me(what, start):
    secs = int(time.time() - start)
    try:
        homingpigeondev.send(f"{what} after {secs // 60}m {secs % 60}s.", idempotency_key=f"cell-{start}")
    except homingpigeondev.HomingPigeonError as err:
        print("Text alert failed:", err)


start = time.time()
model = train(df)
text_me("Training finished", start)

To hear when the cell fails too, put its work in try and call the helper in finally, which runs either way:

start = time.time()
outcome = "failed"
try:
    model = train(df)
    outcome = "finished"
finally:
    text_me(f"Training {outcome}", start)

Good to know

  • The text reads like "Training finished after 42m 7s." or "Training failed after 3m 12s." Use your own words for each cell, such as "Feature build finished".
  • In the second version, the error still shows in the notebook with its full traceback, and Run All still stops at that cell. The text just tells you to come back and look.
  • Pressing the stop button raises KeyboardInterrupt in the cell, so the second version texts you "failed" then too. If the kernel dies, for example when it runs out of memory, nothing more in the cell runs, so no text goes out.
  • The start time in the idempotency key gives every run of a cell its own key, so each run texts you once and a rerun texts you again.
  • The try inside text_me means a failed text never hides the cell's own error or throws away its result. The reason is printed under the cell instead.
  • The text is sent by the kernel, not your browser. When the notebook runs on a server, you can close the tab and the kernel keeps running the cell and still texts you.
  • To verify your phone, run python -m homingpigeondev verify +15551234567 in a terminal on the machine the kernel runs on, then again with the six-digit code it texts you. The key is saved there, where the helper finds it. You can also set HOMINGPIGEON_API_KEY in the environment the kernel starts in. Keep the key out of the notebook itself, so it never ends up in git.
  • Messages are limited to 480 characters and go only to the US mobile number you verified. Keep them plain, with no links. Delivery is not guaranteed, so treat each text as a heads-up.

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.