Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.

agent-notify

agent-notify sends notifications when long-running CLI/agent tasks finish.

It supports two usage styles:

  1. Wrap a command (agent-notify run -- ...)
  2. Receive task-level events from interactive agents (Codex, Claude Code, Gemini, Ollama pipelines)

Why People Use This

  • You can keep coding in one window and get notified when a background task completes.
  • Notifications include success/failure, duration, and exit code.
  • Works on macOS and Windows (with console fallback when desktop notifications are unavailable).

Install

Recommended:

pipx install agent-notify

Alternative:

pip install agent-notify

From source:

python -m pip install -e .

Confirm install:

agent-notify --help
agent-notify test-notify --channel console

2-Minute Quickstart

Run any long command through the wrapper:

agent-notify run -- python3 -c "import time; time.sleep(8)"

If the command fails, the notification title changes to Failed.

Choose Your Mode

Mode A: Task-Level Notifications (Recommended for interactive CLIs)

This notifies when an agent turn/task completes inside Codex/Claude/Gemini flows. You do not need to exit the CLI session.

Mode B: Shell Exit Notifications (shell-init)

This notifies when shell commands end. For interactive agents, that usually means on CLI exit. Use this only if you want process-exit behavior.

Interactive Tool Setup

Codex CLI

Codex provides a notify hook. Use the included bridge:

chmod +x examples/codex_notify_bridge.sh
BRIDGE_PATH="$(realpath examples/codex_notify_bridge.sh)"
echo "$BRIDGE_PATH"

Add to ~/.codex/config.toml:

notify = [
  "/absolute/path/to/examples/codex_notify_bridge.sh"
]

Optional debug logs:

export AGENT_NOTIFY_DEBUG=1

Log location: ~/.agentnotify/logs/codex_notify.log

Claude Code

Configure hooks in .claude/settings.local.json (or user settings):

{
  "hooks": {
    "Stop": [
      {
        "matcher": "*",
        "hooks": [
          {
            "type": "command",
            "command": "agent-notify claude-hook --event Stop --name claude-code --channel both --quiet-when-focused --chime ping"
          }
        ]
      }
    ],
    "SubagentStop": [
      {
        "matcher": "*",
        "hooks": [
          {
            "type": "command",
            "command": "agent-notify claude-hook --event SubagentStop --name claude-code --channel both --quiet-when-focused --chime ping"
          }
        ]
      }
    ]
  }
}

Gemini CLI

Configure AfterAgent hook:

{
  "hooksConfig": {
    "enabled": true
  },
  "hooks": {
    "AfterAgent": [
      {
        "matcher": "*",
        "hooks": [
          {
            "type": "command",
            "command": "agent-notify gemini-hook --name gemini --channel both --quiet-when-focused --chime ping",
            "timeout": 10000
          }
        ]
      }
    ]
  }
}

Ollama

  • Pure interactive ollama run currently has no native per-turn completion hook.
  • If you use ollama launch codex or ollama launch claude, configure Codex/Claude hooks above.
  • For non-interactive JSON output (--format json), pipe into agent-notify ollama-hook.

Example:

ollama run llama3 --format json | agent-notify ollama-hook --name ollama --channel both

Core Commands

agent-notify run -- <cmd...>

  • Run and notify on completion.
  • Wrapper exits with the same exit code as the wrapped command.

agent-notify watch --pid <pid>

  • Watch an existing process ID until exit.

agent-notify test-notify

  • Send a sample notification.

agent-notify tail --file <path> --pattern <text>

  • Notify when a log pattern appears.

agent-notify shell-init

  • Generate shell hook script for process-exit notifications.

Hook bridge commands used by integrations:

  • agent-notify gemini-hook
  • agent-notify claude-hook
  • agent-notify codex-hook
  • agent-notify ollama-hook

Common Customizations

Suppress notifications while terminal is focused (macOS):

agent-notify gemini-hook --quiet-when-focused

Add sound:

agent-notify claude-hook --chime ping

Force console output:

agent-notify run --channel console -- your-command

Configuration

Environment variables:

  • AGENT_NOTIFY_TITLE_PREFIX="Agent"
  • AGENT_NOTIFY_CHANNELS="desktop,console"
  • AGENT_NOTIFY_TAIL_LINES=20
  • AGENT_NOTIFY_POLL_INTERVAL=1.0

Optional TOML config at ~/.agentnotify/config.toml:

title_prefix = "Agent"
channels = ["desktop"]
tail_lines = 20
poll_interval = 1.0

Environment variables override file values.

Troubleshooting

I only get notifications when I exit the CLI

You are likely using shell-init mode. That is process-exit based.

Use task-level hooks (codex-hook, claude-hook, gemini-hook) instead and remove shell-init lines from your shell startup file.

Desktop notifications do not appear

  1. Test fallback path:
    • agent-notify test-notify --channel console
  2. Verify platform backend:
    • macOS uses osascript
    • Windows uses PowerShell/BurntToast (with win10toast fallback)

Codex notifications not firing

  1. Confirm notify is configured in ~/.codex/config.toml.
  2. Confirm bridge script is executable: chmod +x examples/codex_notify_bridge.sh.
  3. Enable bridge debug logs with AGENT_NOTIFY_DEBUG=1 and inspect ~/.agentnotify/logs/codex_notify.log.

Platform Notes

macOS:

  • Desktop notifications via Notification Center (osascript).

Windows:

  • Primary backend: PowerShell + BurntToast.
  • Optional fallback dependency: pip install "agent-notify[windows]".

For Maintainers

Development checks:

python -m pip install -e ".[dev]"
ruff check .
pytest -q
python -m build
twine check dist/*

Release checklist:

  • docs/release_checklist.md

Project/process docs:

  • docs/project_charter.md
  • docs/scrum_working_agreement.md
  • docs/assumptions.md
  • docs/commit_plan.md
  • SECURITY.md

License

MIT (LICENSE)

Release files for agent-notify 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agent-notify 0.1.1
File Size Uploaded
agent_notify-0.1.1.tar.gz 26.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agent-notify 0.1.1
File Interpreter ABI Platform
agent_notify-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 56.9 kB

Release files / agent_notify-0.1.1.tar.gz

Download URL agent_notify-0.1.1.tar.gz
Size 26.7 kB
Tags Source
SHA-256 checksum
How to use checksums
39d0ff74c185f39f7f74355c60c4f835e05c7aa9090332f7420355599166190f
BLAKE2b-256 checksum
How to use checksums
254d728809d693f9bc72b553bcda8e40b9ab0726974dc164f909d3af9faccdf4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Release files / agent_notify-0.1.1-py3-none-any.whl

Download URL agent_notify-0.1.1-py3-none-any.whl
Size 30.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8e9b357e4af01e5d118a4eca230d55d384ee873d9f6de2bc40c7fa6e3d2c4936
BLAKE2b-256 checksum
How to use checksums
053f4e58261708d26d1bc9ac2892f33a32e28e47062af710b0bc44ba2b47e32a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.8

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page