Get a text when your disk is almost full

Yes. Homing Pigeon (homingpigeon.dev) lets a short shell script text your phone when a disk passes the percentage you choose, so you can clear space before logs, uploads or a database fill it. Your coding agent can set it up on the server you already have.

What to tell your agent

Use Homing Pigeon to text me when any disk on this server is more than 90% full.

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

How it works in code

Install the command with npm install -g homingpigeondev and verify your phone. Then save this as disk-check.sh, with your own limit and mount points:

#!/bin/sh
limit=90
day=$(date +%Y%m%d)

for mount in / /home; do
  used=$(df -P "$mount" | awk 'NR == 2 { sub("%", "", $5); print $5 }')
  if [ "$used" -ge "$limit" ]; then
    homingpigeon send "$mount is $used% full on $(hostname)." --idempotency-key "disk-$(hostname)-$mount-$day"
  fi
done

Then run it every hour from cron:

0 * * * * PATH=/usr/local/bin:/usr/bin:/bin /home/me/disk-check.sh

Good to know

  • The text reads like "/home is 93% full on web-1." The mount point and the date in the idempotency key mean each disk texts you at most once a day while it stays over the limit, even though the check runs every hour.
  • The hostname in the key keeps two servers that share one key from silencing each other. A quiet phone means every disk is under the limit.
  • df -P keeps each disk on one line and puts the percentage used in the fifth column, so the script reads the same output on Linux and macOS.
  • Run df -h to see your disks under "Mounted on". A folder on the same disk as / reports the same number, so list each disk once to avoid two texts about the same disk.
  • Set the limit low enough to leave time to act. On a disk that fills quickly, 80 is safer than 90.
  • Verify as the same user the cron job runs as, because the key is saved in that user's home folder. Messages are limited to 480 characters and go only to the US mobile number you verified. 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.