pushbag
Use cases

Get a phone alert when your coding agent finishes

Use a Claude Code Stop hook or the Codex notify setting to send a pushbag alert when a turn ends. For a test result, send the alert from the command that runs the tests.

Last updated:

Send a test from the agent’s shell

Install the CLI, then create a Notifications key using the instructions printed by the login command. Allow it to publish to your personal channel.

npm install -g @pushbag/cli
pushbag auth login

Run pushbag auth set YOUR_KEY with the new key. If the agent runs in a container, inject the key there as PUSHBAG_API_KEY instead. A login on the host does not configure the container. Install the Android app on Google Play or the iPhone app, sign in and allow notifications. Now test delivery from the terminal your agent uses.

pushbag notify "Test from the agent terminal" --title "Agent setup"

The receipt has the form Sent to CHANNEL_ID (MESSAGE_ID). Check that the message also appears on your phone before leaving a job running.

For a machine-readable test, add --json to the notify command. The result includes id, channelId, receipt and duplicate. Keep the receipt with the run log if the job runs unattended. If the message is in the dashboard but absent on the device, confirm that the phone is signed in to the same account, has permission to display notifications and is receiving the intended channel before changing either hook.

Tell the agent what counts as done

For a test run, ask: “Run the tests. After the last test exits, send me one pushbag notification with the result, including the failing suite if there is one.” That instruction covers both outcomes. For an alert after every Claude response, use the Claude Code setup.

Run a Claude Code Stop hook

For alerts in one project, merge the following into .claude/settings.local.json. Keep any existing event handlers. This command sends fixed text even if the last response contains customer data. Leave the key in the shell environment or pushbag profile.

{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          { "type": "command", "command": "pushbag notify 'Ready for your next instruction' --title 'Claude turn ended' >/dev/null" }
        ]
      }
    ]
  }
}

Start Claude Code in that project and ask for a one-line reply. After the reply ends, look for “Claude turn ended” in Personal. If the terminal test worked but the hook cannot find pushbag, use the executable path printed by command -v pushbag in the hook. A Stop event can occur several times in a conversation. Claude Code hook reference

Configure Codex turn notifications

Put this top-level setting in ~/.codex/config.toml, before any table headers. Replace the script path with its actual absolute path. Codex appends the event as one JSON argument. This Python script forwards only the event type you care about. Codex advanced configuration

notify = ["python3", "/absolute/path/notify-turn.py"]
import json
import subprocess
import sys

event = json.loads(sys.argv[1])
if event.get("type") == "agent-turn-complete":
    subprocess.run(["pushbag", "notify", "Review the latest Codex response",
                    "--title", "Codex turn ended"], check=True)

Start a new Codex session with Python and pushbag on its path. Finish a short turn before leaving the terminal. You should see the Codex title on your phone even when the response only asks you to clarify something.

Route a job result

For a shared build, specify the granted channel ID with --channel. To open a build log, add --click "$BUILD_URL" with the full URL from the job. Reserve a higher priority for a failure that needs someone now. If the CLI prints --priority takes 1-5 or min, low, default, high, urgent., replace a label such as “critical” with high or a number in range.

If the work produces private HTML, switch to a Both key and upload that file with --private --notify. The alert then opens the exact version that produced it. A colleague who reads the channel does not acquire access to your private file.

Frequently asked questions

Can the alert include the report?

Yes. Upload the HTML report with --notify using a Both key. The notification links to the exact version that finished uploading.

Does finishing a turn mean the tests passed?

A turn can end with a question, an error, or a successful test run. Send the exit status from the test process when you need a pass or fail alert.

Which account should I use on my phone?

Sign in to the mobile app with the account that owns the personal channel. Open that channel in the dashboard to distinguish a successful publish from a phone delivery problem.

Can I send only the project name to my phone?

Use a fixed title and message in the hook. The script can ignore the prompt and response text in the event payload.