### Install OpenCode with Claude and desktop notifications Source: https://github.com/777genius/agent-notifications/blob/main/docs/opencode-notifications.md Use this guided installer command to install OpenCode along with Claude and enable desktop notifications. Requires Agent Notifications v1.46.0 or newer. If setup fails, earlier installations remain; fix the error and rerun. ```bash (set -o pipefail; curl -fsSL https://agent-notifications.com/install.sh | bash -s -- --products claude,opencode --desktop) ``` -------------------------------- ### Install as local plugin with Claude commands Source: https://github.com/777genius/agent-notifications/blob/main/CONTRIBUTING.md Adds the local marketplace, installs the plugin, restarts Claude, and runs init/settings commands. `init` uses the locally built binary from `bin/` if present, otherwise downloads from GitHub Releases. ```bash # Add as local marketplace /plugin marketplace add . # Install plugin /plugin install claude-notifications-go@claude-notifications-go # Restart Claude for hooks to take effect # Download binary and configure settings /claude-notifications-go:init /claude-notifications-go:settings ``` -------------------------------- ### Install Pi with desktop notifications via common installer Source: https://github.com/777genius/agent-notifications/blob/main/docs/pi-notifications.md Run the common Agent Notifications installer from Bash (or native Git Bash on Windows) to install Pi with desktop alerts. Requires the official standalone Pi distribution with `pi` on `PATH`; on Windows use real `pi.exe` (npm `pi.cmd` shim is refused). If setup reports `pi prerequisite unavailable: not found in selected PATH`, verify `command -v pi` and `pi --version` in the same shell and add the Pi directory to the exported `PATH` before retrying; alternatively pass `--pi-executable /absolute/path/to/pi`. ```bash (set -o pipefail; curl -fsSL https://agent-notifications.com/install.sh | bash -s -- --product pi --desktop) ``` -------------------------------- ### Install, test, generate, and preview commands Source: https://github.com/777genius/agent-notifications/blob/main/landing/README.md Run these commands in order to install dependencies, typecheck, test, generate the static site, install the Playwright Chromium browser, run browser tests, and preview the production build. Requires Node 22.12+ and exact dependencies from package-lock.json. The production preview is served at http://127.0.0.1:4173/. ```sh npm ci npm run typecheck npm test npm run generate npx playwright install chromium npm run test:browser npm run preview ``` -------------------------------- ### Guided installer command Source: https://github.com/777genius/agent-notifications/blob/main/README.md Run this command to install or update agent notifications. It requires curl, Bash, and python3 or node on PATH. Choose one or more agents (Claude, Codex CLI, OpenCode, Gemini CLI, Qoder, Cursor CLI, Pi) and ensure their CLIs are installed first. ```bash (set -o pipefail; curl -fsSL https://agent-notifications.com/install.sh | bash) ``` -------------------------------- ### Install Multiple Products with Desktop Channel (--products codex,qoder,cursor --desktop) Source: https://github.com/777genius/agent-notifications/blob/main/docs/INSTALLATION.md Pass a comma-separated list to the common loader to select agents together. The loader downloads and validates one installer, then applies each selected integration through its own lifecycle. --desktop and --webhook apply to each selected OpenCode/Gemini/Qoder/Cursor/Pi integration, with consent saved independently. ```bash (set -o pipefail; curl -fsSL https://agent-notifications.com/install.sh | bash -s -- --products codex,qoder,cursor --desktop) ``` -------------------------------- ### Install Pi with other agents in one command Source: https://github.com/777genius/agent-notifications/blob/main/docs/pi-notifications.md Share one setup command to install Pi alongside other selected agents (Claude, Codex, Pi) with desktop notifications. Use `--webhook` for webhooks only or `--desktop --webhook` for both channels; configure the webhook destination separately. Channel consent belongs to Pi; adding it does not enable another agent's channels. An update without channel flags preserves Pi's saved choice. ```bash (set -o pipefail; curl -fsSL https://agent-notifications.com/install.sh | bash -s -- --products claude,codex,pi --desktop) ``` -------------------------------- ### Run local installer preview with make preview-installer Source: https://github.com/777genius/agent-notifications/blob/main/docs/INSTALLATION.md Builds the committed source and portable package into a private reusable TEST cache, then runs the installer with fresh HOME, working directory, and client profiles. Requires Python 3.9+, Go, and macOS signing/sandbox tools. Use --plain for line prompts and --state-dir to reuse a private cache. ```bash make preview-installer ``` ```bash make preview-installer PREVIEW_ARGS='--plain --state-dir /path/to/private-TEST-cache' ``` ```bash BOOTSTRAP_VERBOSE=1 make preview-installer ``` ```bash make preview-installer PREVIEW_ARGS='--gemini-cli /absolute/path/to/gemini' ``` -------------------------------- ### Run setup wizard for notifications Source: https://github.com/777genius/agent-notifications/blob/main/docs/volume-control.md Starts the interactive setup wizard to configure notification settings, including volume selection from 0% to 100%. The wizard previews a sound at the selected volume before saving. ```bash /setup-notifications ``` -------------------------------- ### BotFather API Token Example Source: https://github.com/777genius/agent-notifications/blob/main/docs/webhooks/telegram.md Example API token format provided by BotFather after creating a bot. Save it securely. ```text 123456789:ABCdefGHIjklMNOpqrsTUVwxyz ``` -------------------------------- ### Manual setup-opencode install command Source: https://github.com/777genius/agent-notifications/blob/main/docs/opencode-notifications.md Run the verified native binary to install the plugin into a new managed runtime. Requires --binary and --runtime-root; --desktop enables desktop consent. On macOS desktop, also pass --native-app with the checksum-verified ClaudeNotifier.app. Existing installations may omit --runtime-root to use their recorded location. ```bash "$NOTIFICATIONS_BIN" setup-opencode install \ --binary /absolute/path/to/verified-native-binary \ --runtime-root /absolute/path/to/new-managed-runtime \ --desktop ``` -------------------------------- ### Manual iTerm2 venv setup Source: https://github.com/777genius/agent-notifications/blob/main/docs/CLICK_TO_FOCUS.md Manual setup for the iTerm2 Python API when automatic setup failed. Creates a virtual environment and installs the iterm2 package. Requires Python 3 and the iTerm2 Python API enabled in settings. ```bash python3 -m venv ~/.claude/claude-notifications-go/iterm2-venv ~/.claude/claude-notifications-go/iterm2-venv/bin/pip install iterm2 ``` -------------------------------- ### Manual installation slash commands for Claude Source: https://github.com/777genius/agent-notifications/blob/main/docs/INSTALLATION.md Run these slash commands in the Claude chat, not in the system terminal, when the bootstrap doesn't work. The commands add the marketplace, install the plugin, restart Claude, download the binary, and optionally configure settings. Note that 'claude-notifications-go' is the frozen Claude marketplace, plugin, and command namespace; changing these identifiers breaks existing installations and updates. ```text # 1) Add marketplace /plugin marketplace add 777genius/agent-notifications # 2) Install plugin /plugin install claude-notifications-go@claude-notifications-go # 3) Restart Claude # 4) Download binary /claude-notifications-go:init # 5) (Optional) Configure sounds and settings /claude-notifications-go:settings ``` -------------------------------- ### Install Gemini CLI with desktop notifications Source: https://github.com/777genius/agent-notifications/blob/main/docs/gemini-notifications.md Use this bash pipeline to install the Gemini CLI and enable desktop notifications. The installer selects matching native assets automatically and does not impose version minimums or maximums. Replace --desktop with --webhook for webhook-only delivery, or specify both flags for both channels. ```bash (set -o pipefail; curl -fsSL https://agent-notifications.com/install.sh | bash -s -- --product gemini --desktop) ``` -------------------------------- ### UAP Installer Engine Usage Source: https://github.com/777genius/agent-notifications/blob/main/install/uapinstaller/README.md Shows the core workflow: create the engine, prepare an install request, defer closing the prepared plan, and apply with a confirmed decision. New validates paths but does not create directories or run helpers; directories are created on Recover or confirmed Apply. ```go engine, err := uapinstaller.New(uapinstaller.Config{StateRoot: stateRoot, HelperExecutable: helper}) prepared, err := engine.Prepare(ctx, uapinstaller.Request{Operation: uapinstaller.OpInstall, ...}) defer prepared.Close() result, err := engine.Apply(ctx, prepared, uapinstaller.Decision{Confirmed: true}) ``` -------------------------------- ### Run setup-notifications operations (prepare, status, permission-status, request-permission, register, enable, disable, remove) Source: https://github.com/777genius/agent-notifications/blob/main/docs/commands/setup-notifications.md Templates for the claude-notifications setup-notifications CLI operations. Replace paths, verified team ID, and N with operator-selected values. Read status again before every mutation; N must be the installation's exact positive generation. Register and enable are separate actions with no atomic transaction. After any error, reread status and use installer recovery if needed. ```text claude-notifications setup-notifications prepare --legacy-config /physical/legacy/config.json --defaults-config /physical/bundle/config.json --expected-generation N claude-notifications setup-notifications status --json claude-notifications setup-notifications permission-status --json claude-notifications setup-notifications request-permission --expected-generation N claude-notifications setup-notifications register --provider codex --config /physical/client/config.toml --command /physical/runtime/bin/claude-notifications --expected-generation N claude-notifications setup-notifications enable --app /physical/Applications/Codex.app --team-id ABCDE12345 --allow-unknown-caller true --allow-caller-asserted false --expected-generation N claude-notifications setup-notifications status claude-notifications setup-notifications disable --expected-generation N claude-notifications setup-notifications remove --provider codex --config /physical/client/config.toml --command /physical/runtime/bin/claude-notifications --expected-generation N ``` -------------------------------- ### Install expanded Qoder plugin package Source: https://github.com/777genius/agent-notifications/blob/main/docs/QODER.md Install the expanded package with Qoder's native plugin installer. For lifecycle qualification, use a disposable TEST profile and actual Qoder session, observe one completion notification, then update and remove the same plugin. Qoder Desktop may require a reload/restart before a newly installed hook becomes active. ```sh qoder plugins install /absolute/TEST-qoder/package --scope user qoder plugins list --json ``` -------------------------------- ### Recover orphan consumer with internal-install-runtime --recover-orphan-consumer Source: https://github.com/777genius/agent-notifications/blob/main/docs/INSTALLATION.md Recovers an entirely absent installer consumer for an abandoned secondary runtime. Requires the exact consumer ID, physical runtime root, installation ID, and positive generation from that consumer's ownership record. Use --dry-run --json to preview first; repeat without --dry-run to execute. The transaction removes only that consumer's absent runtime file ownership and preserves retained consumers and policy. ```sh claude-notifications internal-install-runtime --recover-orphan-consumer \ --consumer 'codex:/absolute/TEST/codex/hooks.json' \ --runtime-root /absolute/TEST/codex/claude-notifications-go \ --control-root /absolute/TEST/config/agent-notifications \ --expected-installation-id INSTALLATION_ID --expected-generation 18 \ --dry-run --json ``` -------------------------------- ### Repair pruned Claude cache with setup-products repair-cache Source: https://github.com/777genius/agent-notifications/blob/main/docs/INSTALLATION.md Runs only the cache repair for managed files lost when Claude prunes an old versioned plugin cache. The --yes flag performs explicit unattended repair with the same identity checks. Declining interactive setup leaves the installation unchanged. ```sh claude-notifications setup-products repair-cache # Explicit unattended repair, with the same identity checks: claude-notifications setup-products repair-cache --yes ``` -------------------------------- ### Sound preview usage examples Source: https://github.com/777genius/agent-notifications/blob/main/docs/interactive-sound-preview.md Shows how to use the bin/sound-preview binary to play sounds at different volumes and display help. The default volume is full (1.0), and 0.3 is recommended for testing. ```bash # Full volume (default) bin/sound-preview sounds/task-complete.mp3 # 30% volume (recommended for testing) bin/sound-preview --volume 0.3 sounds/task-complete.mp3 # 50% volume bin/sound-preview --volume 0.5 /System/Library/Sounds/Glass.aiff # Show help bin/sound-preview --help ``` -------------------------------- ### Record release progress start and pass with evidence Source: https://github.com/777genius/agent-notifications/blob/main/docs/RELEASE_SPEED.md Use these commands to record the start of a release phase and, after inspecting the real result, mark it as passed with a nonempty regular file as evidence. The journal binds exact C/O/version, timestamps, and SHA256 of receipts; it does not interpret receipts or grant qualification. No implicit restart overwrites an existing phase. ```sh node scripts/release-progress.mts start /private/tmp/TEST-release-progress.json C O vX.Y.Z signing ``` ```sh # After inspecting the real result; evidence path must be a nonempty regular file: node scripts/release-progress.mts pass /private/tmp/TEST-release-progress.json C O vX.Y.Z signing /private/tmp/TEST-signing-run.json ``` -------------------------------- ### Install OpenCode with desktop notifications only Source: https://github.com/777genius/agent-notifications/blob/main/docs/opencode-notifications.md Use this command to install OpenCode with desktop notifications enabled. Requires Agent Notifications v1.46.0 or newer. Restart OpenCode after installation to load the plugin. ```bash (set -o pipefail; curl -fsSL https://agent-notifications.com/install.sh | bash -s -- --product opencode --desktop) ``` -------------------------------- ### New Source: https://github.com/777genius/agent-notifications/blob/main/install/uapinstaller/README.md Creates a new UAP installer engine instance. Validates paths and does not create directories, open a journal, or run a helper. ```APIDOC ## New ### Description Creates a new UAP installer engine instance. Validates paths and does not create directories, open a journal, or run a helper. ### Method Constructor ### Signature ```go func New(config Config) (*Engine, error) ``` ### Parameters #### Config - **StateRoot** (string) - Required - Root directory for state. - **HelperExecutable** (string) - Required - Path to the helper executable. - **Assess** (func) - Optional - Digest-bound assessor; block and unavailable never become allow. - **Progress** (ProgressFunc) - Optional - Coarse progress phases, observational. ### Returns - **engine** (*Engine) - The installer engine instance. - **error** (error) - Error if path validation fails. ``` -------------------------------- ### Install multiple agents with combined selectors Source: https://github.com/777genius/agent-notifications/blob/main/docs/gemini-notifications.md Use this combined pipeline to install Claude, Codex, OpenCode, and Gemini with both desktop and webhook channels. The channel choices apply to each selected observer agent (Gemini and OpenCode) with consent persisted separately per agent, and do not affect Claude/Codex notification channels. ```bash (set -o pipefail; curl -fsSL https://agent-notifications.com/install.sh | bash -s -- --products claude,codex,opencode,gemini --desktop --webhook) ``` -------------------------------- ### Shell script to initialize agent notifications Source: https://github.com/777genius/agent-notifications/blob/main/commands/init.md This shell script initializes agent notifications by checking for the installer binary, configuring the provider, and running the setup wizard. It handles different platforms (Windows, Darwin, Linux) and skips setup if the binary is missing or outdated. On failure, it prints an error and exits. ```shell MINGW*|MSYS*|CYGWIN*) NOTIFY_BIN="${CLAUDE_PLUGIN_ROOT}/bin/claude-notifications.bat"; NOTIFY_READY=(-f "$NOTIFY_BIN"); USE_WIZARD=true ;; Darwin|Linux) NOTIFY_BIN="${CLAUDE_PLUGIN_ROOT}/bin/claude-notifications"; NOTIFY_READY=(-x "$NOTIFY_BIN"); USE_WIZARD=true ;; *) NOTIFY_BIN="${CLAUDE_PLUGIN_ROOT}/bin/claude-notifications"; NOTIFY_READY=(-x "$NOTIFY_BIN"); USE_WIZARD=false ;; esac if ! test "${NOTIFY_READY[@]}"; then echo "agent-notify setup skipped; installer binary not found. Plugin install succeeded." >&2 [ "$SEEN_AGENT_NOTIFY" != true ] || exit 1 elif [ "$USE_WIZARD" = true ] && "$NOTIFY_BIN" --help /dev/null | grep -Fq -- 'setup-notifications wizard'; then POLICY_HELP=$("$NOTIFY_BIN" setup-notifications --help /dev/null) || POLICY_HELP="" if [[ "$POLICY_HELP" != *--policy-only* || "$POLICY_HELP" != *--preserve-enabled* ]]; then echo "agent-notify setup skipped; installed binary predates portable setup. Plugin/hooks install succeeded. Update to a matching release before enabling MCP." >&2 [ "$SEEN_AGENT_NOTIFY" != true ] || exit 1 exit 0 fi case "$(uname -s 2>/dev/null)" in Darwin|Linux|MINGW*|MSYS*|CYGWIN*) if ! "$NOTIFY_BIN" setup-notifications configure --provider claude "${CONFIGURE_ARGS[@]}" --policy-only --preserve-enabled; then printf 'agent-notify configure failed; plugin install files remain. Retry: %s\n' "$(quote_shell_command "$NOTIFY_BIN" setup-notifications configure --provider claude "${CONFIGURE_ARGS[@]}" --policy-only --preserve-enabled)" >&2 exit 1 fi ;; esac wizard=(setup-notifications wizard --action install --install-or-update --agents claude --hooks false --agent-notify true --yes --plugin-root "${CLAUDE_PLUGIN_ROOT}") [ "$SEEN_AGENT_NOTIFY" = true ] || wizard+=(--preserve-existing-units) case "$(uname -s 2>/dev/null)" in MINGW*|MSYS*|CYGWIN*) ;; # The native helper is the installed primary, not this BAT shell launcher. *) wizard+=(--helper "$NOTIFY_BIN") ;; esac if [ -n "${CLAUDE_CONFIG_DIR:-}" ]; then wizard+=(--claude-config "$CLAUDE_CONFIG_DIR") claude_home="$CLAUDE_CONFIG_DIR" else claude_home="${HOME:-${USERPROFILE:-}}" if [ -n "$claude_home" ]; then wizard+=(--claude-config "$claude_home/.claude") fi fi if [ -n "$claude_home" ]; then wizard+=(--claude-mcp-config "$claude_home/.claude.json") fi claude_exec=$(command -v claude 2>/dev/null || true) case "$claude_exec" in /*|[A-Za-z]:/*|[A-Za-z]:\\*) wizard+=(--claude-executable "$claude_exec" --client-executable "$claude_exec") ;; esac if ! "$NOTIFY_BIN" "${wizard[@]}"; then echo "agent-notify setup failed; plugin install files remain. Use the wizard's retry or next resume command above; if absent, rerun /init with the same installed release." >&2 case "$(uname -s 2>/dev/null)" in MINGW*|MSYS*|CYGWIN*) echo "On Windows, run that command in PowerShell (the printed quoting is PowerShell syntax)." >&2 ;; esac exit 1 fi else echo "agent-notify setup skipped; installed binary lacks portable wizard. Plugin/hooks install succeeded. Update to a matching release before enabling MCP." >&2 [ "$SEEN_AGENT_NOTIFY" != true ] || exit 1 fi fi ``` -------------------------------- ### Non-interactive install for multiple agents with desktop Source: https://github.com/777genius/agent-notifications/blob/main/README.md Use this command to install Claude, Codex, and OpenCode with desktop notifications enabled. Add more agents to --products or use --product for a single agent. Channel flags like --desktop and --webhook control notification channels. ```bash (set -o pipefail; curl -fsSL https://agent-notifications.com/install.sh | bash -s -- --products claude,codex,opencode --desktop) ``` -------------------------------- ### Clone and build with Make Source: https://github.com/777genius/agent-notifications/blob/main/CONTRIBUTING.md Clones the repository, changes into the directory, and runs `make build` to compile the project. Requires Go 1.25.0+ and Make. ```bash git clone https://github.com/777genius/agent-notifications cd agent-notifications make build ``` -------------------------------- ### Non-interactive install for Codex only Source: https://github.com/777genius/agent-notifications/blob/main/README.md Use this command for non-interactive installation of Codex only. The --product flag selects a single agent. ```bash (set -o pipefail; curl -fsSL https://agent-notifications.com/install.sh | bash -s -- --product codex) ``` -------------------------------- ### Fix: Set TMPDIR to $HOME/.claude/tmp and start Claude Source: https://github.com/777genius/agent-notifications/blob/main/docs/troubleshooting.md Recommended workaround: create a temporary directory on the same filesystem as ~/.claude and launch Claude with TMPDIR set. ```bash mkdir -p "$HOME/.claude/tmp" TMPDIR="$HOME/.claude/tmp" claude ``` -------------------------------- ### Example Output: Webhook Log Entries Source: https://github.com/777genius/agent-notifications/blob/main/docs/webhooks/monitoring.md Sample output from the grep command showing webhook sending, failure, retry, and success log lines with the request ID. ```text [webhook] Sending webhook: status=task_complete session=abc-123 request_id=550e8400-e29b-41d4-a716-446655440000 [webhook] Webhook failed (attempt 1/3): request_id=550e8400-e29b-41d4-a716-446655440000 status=503 [webhook] Retrying webhook: request_id=550e8400-e29b-41d4-a716-446655440000 [webhook] Webhook sent successfully: request_id=550e8400-e29b-41d4-a716-446655440000 latency=250ms ``` -------------------------------- ### Retry plugin install command Source: https://github.com/777genius/agent-notifications/blob/main/docs/troubleshooting.md Command to retry the plugin installation after applying the TMPDIR workaround. ```text /plugin install claude-notifications-go@claude-notifications-go ``` -------------------------------- ### State-based with Fixed TTL - Example Failure Timeline Source: https://github.com/777genius/agent-notifications/blob/main/docs/issues/01-stats-counting-plan-mode.md Example failure timeline showing the 60s TTL cleanup issue: the hook timestamp is cleaned up before the next Stop hook, causing incorrect counting. ```text 20:00 - User text message 20:05 - Stop hook (saved to state) 20:11 - State cleaned up (60s TTL expired) 20:12 - Next Stop hook: - userTS = 20:00 (11 min old) - hookTS = missing (cleaned up) - Uses 20:00 → counts 12 minutes of tools ❌ ``` -------------------------------- ### Minimal Webhook Configuration Source: https://github.com/777genius/agent-notifications/blob/main/docs/webhooks/configuration.md Basic webhook setup with Slack preset. Enables notifications with a minimal set of options. ```json { "notifications": { "webhook": { "enabled": true, "preset": "slack", "url": "https://hooks.slack.com/services/..." } } } ``` -------------------------------- ### --capabilities-json --setup Source: https://github.com/777genius/agent-notifications/blob/main/swift-notifier/PROTOCOL.md Probes a known modern helper for permission request support. The helper must be verified for identity and base capabilities first; this setup probe returns a bounded JSON response indicating supported permission request versions and backend. ```APIDOC ## [PROBE] --capabilities-json --setup ### Description Probes a known modern helper for permission request support. The helper must be verified for identity and base capabilities first; this setup probe returns a bounded JSON response indicating supported permission request versions and backend. ### Method CLI probe (two-argument grammar) ### Endpoint `--capabilities-json --setup` ### Parameters #### Command-Line Arguments - `--capabilities-json` (flag) - Required - Must be the first argument; indicates capabilities mode. - `--setup` (flag) - Required - Must be the second argument; requests setup capabilities. ### Response #### Success Response - **schemaVersion** (integer) - Required - Must be exactly 1. - **permissionRequestVersions** (array of integers) - Required - Must be exactly `[1]`. - **backend** (string) - Required - Must be `macos.usernotifications`. #### Response Example ```json {"schemaVersion":1,"permissionRequestVersions":[1],"backend":"macos.usernotifications"} ``` ### Notes - Only this exact two-argument probe grammar is supported; no transport marker. - The probe requires no app metadata or AppKit/UN initialization. - Base capabilities retain their existing schema and output implementation. - Setup is neither a notification action kind nor a send protocol version. - Go `DecodeSetupCapabilities` requires exactly schema 1 and request versions `[1]`; it rejects unknown, missing, null, duplicate, oversized or unsupported fields. - Probe failure, malformed replies, or unsupported versions fail closed; they do not permit a request or fallback send. ``` -------------------------------- ### Remove marketplace to fix network source mismatch Source: https://github.com/777genius/agent-notifications/blob/main/docs/troubleshooting.md Run this command to remove the marketplace registered under the old repository name when the installer fails with a network source mismatch. Then re-run the installer. ```bash /plugin marketplace remove claude-notifications-go ``` -------------------------------- ### Final codex-install output message Source: https://github.com/777genius/agent-notifications/blob/main/docs/planning/codex-multiagent-support/03-phase2-installer.md Shown to the user after a successful install. Lists installed hooks and events, then instructs the user to run 'codex' and approve 'claude-notifications-go' via '/hooks'. Warns that no notifications arrive until trusted. Includes a diagnostics log path. ```text ✅ Codex hooks installed -> ~/.codex/hooks.json Events: Stop, PermissionRequest (binary: ) ⚠ Required last step — Codex won't run these hooks until you trust them: 1) run: codex 2) at the Codex prompt type: /hooks 3) approve "claude-notifications-go" when asked Until then, no notifications arrive. Diagnostics: ~/.claude/claude-notifications-go/notification-debug.log ``` -------------------------------- ### Parse setup arguments for agent-notify configuration Source: https://github.com/777genius/agent-notifications/blob/main/commands/init.md Shell script that parses CLI arguments for the setup command, validating values for --navigation, --app, and other options. It enforces mutual exclusivity between --agent-notify and --skip-agent-notify, and exits with errors for missing values or invalid inputs. ```bash SKIP_AGENT_NOTIFY=false SEEN_AGENT_NOTIFY=false CONFIGURE_ARGS=() quote_shell_command() { local quoted="" arg for arg in "$@"; do quoted="${quoted:+$quoted }$(printf '%q' "$arg")" done printf '%s' "$quoted" } while [ "$#" -gt 0 ]; do case "$1" in --skip-agent-notify) SKIP_AGENT_NOTIFY=true; shift ;; --agent-notify) SEEN_AGENT_NOTIFY=true; shift ;; --navigation|--app|--team-id|--allow-unknown-caller|--allow-caller-asserted) [ "$#" -ge 2 ] || { echo "Missing value for $1" >&2; exit 1; } case "$1" in --navigation) [ "$2" = none ] || { echo "Invalid navigation: $2" >&2; exit 1; } ;; --app) case "$2" in /*) ;; *) echo "App path must be absolute." >&2; exit 1 ;; esac case "$2" in *..*) echo "App path must be a physical path." >&2; exit 1 ;; esac ;; esac CONFIGURE_ARGS+=("$1" "$2"); shift 2 ;; --request-permission|--json) CONFIGURE_ARGS+=("$1"); shift ;; *) echo "unknown option: $1" >&2; exit 1 ;; esac done if [ "$SEEN_AGENT_NOTIFY" = true ] && [ "$SKIP_AGENT_NOTIFY" = true ]; then echo "--agent-notify and --skip-agent-notify are mutually exclusive." >&2 exit 1 fi ``` -------------------------------- ### Run installed preflight measurement tests Source: https://github.com/777genius/agent-notifications/blob/main/docs/evidence/navigation/2026-10-05/README.md Runs Swift tests for installed preflight measurement with explicit path/team opt-ins. Requires NOTIFIER_TEST_INSTALLED_PREFLIGHT=1, NOTIFIER_TEST_INSTALLED_APP, NOTIFIER_TEST_INSTALLED_TEAM, and NOTIFIER_TEST_PREFLIGHT_SAMPLES=50. ```sh NOTIFIER_TEST_INSTALLED_PREFLIGHT=1 NOTIFIER_TEST_INSTALLED_APP=/Applications/ChatGPT.app NOTIFIER_TEST_INSTALLED_TEAM=2DC432GLL2 NOTIFIER_TEST_PREFLIGHT_SAMPLES=50 swift test --package-path swift-notifier --filter NativePreflightMeasurementTests ``` -------------------------------- ### Handle interrupted recovery with --recover-pending and --rollback-pending Source: https://github.com/777genius/agent-notifications/blob/main/docs/INSTALLATION.md Selects one pending operation for an interrupted transaction. Requires an existing private managed control root, valid ownership, and an existing transaction journal and permanent locks. An installation with no pending journal is refused without creating locks or changing its generation. Rollback restores ownership metadata, not missing payload, and can leave status invalid. ```sh claude-notifications internal-install-runtime --recover-pending --control-root ABS --json claude-notifications internal-install-runtime --rollback-pending --control-root ABS --json ``` -------------------------------- ### Setup capabilities response JSON Source: https://github.com/777genius/agent-notifications/blob/main/swift-notifier/PROTOCOL.md The bounded setup response is a single newline-terminated JSON object. It requires exactly schema 1 and request versions [1]; unknown, missing, null, duplicate, oversized, or unsupported fields are rejected. ```json {"schemaVersion":1,"permissionRequestVersions":[1],"backend":"macos.usernotifications"} ``` -------------------------------- ### Smoke test via --plugin-dir Source: https://github.com/777genius/agent-notifications/blob/main/docs/LOCAL_DEVELOPMENT.md Runs a real Claude run against the repo checkout without changing the installed marketplace/plugin source. ```bash scripts/e2e-real-claude.sh smoke-plugin-dir ``` -------------------------------- ### Initialize shared configuration after successful installation Source: https://github.com/777genius/agent-notifications/blob/main/commands/init.md Initialize shared configuration once after successful resource installation and registration. Repeated calls are safe; existing valid config is a no-op preserving byte/mode/mtime, invalid config is an error, and missing automatic config is created at N. ```bash "$NOTIFICATIONS_BIN" config init "$NOTIFICATIONS_BIN" config inspect --json ``` -------------------------------- ### Inspect config path and settings with config path --json and config inspect --json Source: https://github.com/777genius/agent-notifications/blob/main/docs/CONFIGURATION.md Use the installed config-capable executable (shown as $NOTIFICATIONS_BIN) to query the selected configuration file path and inspect its settings. Both commands output JSON. ```bash "$NOTIFICATIONS_BIN" config path --json "$NOTIFICATIONS_BIN" config inspect --json ``` -------------------------------- ### Commands used for local E2E test Source: https://github.com/777genius/agent-notifications/blob/main/docs/evidence/agent-notify/plan14-local-e2e-2026-09-11.md Sets up the environment and runs the Swift build and Go test for the isolated install flow. The optional commented command enables Darwin Notification Center send and production-bundle LS with AGENT_NOTIFY_DARWIN_E2E=1. ```sh export GOTOOLCHAIN=local GOMAXPROCS=2 HOME=/tmp/agent-notify-e2e-home TMPDIR=/tmp/agent-notify-e2e-tmp swift build -c release --arch arm64 --package-path swift-notifier /opt/homebrew/bin/go test -p 1 -count=1 -timeout=180s ./cmd/claude-notifications/ -run 'TestAgentNotifyIsolatedInstallFlowE2E' # optional operator-visible Darwin NC send / production-bundle LS: # AGENT_NOTIFY_DARWIN_E2E=1 /opt/homebrew/bin/go test -p 1 -count=1 -timeout=180s ./cmd/claude-notifications/ -run 'TestAgentNotifyIsolatedInstallFlowE2E' ``` -------------------------------- ### Install with explicit combined product selection Source: https://github.com/777genius/agent-notifications/blob/main/docs/cursor-notifications.md Explicitly selects codex, qoder, and cursor products with desktop delivery. Requires the official Cursor CLI installed and its agent launcher on PATH. Restart Cursor CLI after setup. ```bash (set -o pipefail; curl -fsSL https://agent-notifications.com/install.sh | bash -s -- \ --products codex,qoder,cursor --desktop) ``` -------------------------------- ### State File Format (JSON) Source: https://github.com/777genius/agent-notifications/blob/main/docs/ARCHITECTURE.md Example JSON structure for per-session state files, storing session ID, last interactive tool, timestamps, and working directory. ```json { "session_id": "abc-123", "last_interactive_tool": "ExitPlanMode", "last_ts": 1234567890, "last_task_complete_ts": 1234567890, "cwd": "/path/to/project" } ``` -------------------------------- ### Prepare release candidate and promotion Source: https://github.com/777genius/agent-notifications/blob/main/docs/RELEASE_SPEED.md Runs cheap preflights for candidate C and promotion P together. Requires absolute paths for candidate and promotion roots. ```sh make release-prepare RELEASE_VERSION=X.Y.Z CANDIDATE_SHA=C \ CANDIDATE_ROOT=/absolute/candidate PROMOTION_ROOT=/absolute/promotion ``` -------------------------------- ### Example Alert Script Source: https://github.com/777genius/agent-notifications/blob/main/docs/webhooks/monitoring.md Bash script that checks webhook success rate from a log file and alerts on critical or warning conditions, plus checks if the circuit breaker is open today. ```bash #!/bin/bash LOG_FILE="notification-debug.log" # Check success rate SUCCESS=$(grep -c "webhook sent successfully" "$LOG_FILE") FAILED=$(grep -c "webhook failed (final attempt)" "$LOG_FILE") TOTAL=$((SUCCESS + FAILED)) if [ $TOTAL -gt 0 ]; then SUCCESS_RATE=$(echo "scale=1; $SUCCESS * 100 / $TOTAL" | bc) if (( $(echo "$SUCCESS_RATE < 90" | bc -l) )); then echo "🚨 CRITICAL: Webhook success rate is $SUCCESS_RATE%" # Send alert (email, Slack, PagerDuty, etc.) elif (( $(echo "$SUCCESS_RATE < 95" | bc -l) )); then echo "⚠️ WARNING: Webhook success rate is $SUCCESS_RATE%" fi fi # Check circuit breaker state if grep "Circuit breaker opened" "$LOG_FILE" | tail -1 | grep -q "$(date +%Y-%m-%d)"; then echo "🚨 CRITICAL: Circuit breaker is OPEN" fi ``` -------------------------------- ### Chat Object JSON Response Source: https://github.com/777genius/agent-notifications/blob/main/docs/webhooks/telegram.md Example JSON response from getUpdates showing the chat object with the chat ID. ```json { "chat": { "id": 123456789, "first_name": "Your Name", "type": "private" } } ``` -------------------------------- ### Preview flow steps Source: https://github.com/777genius/agent-notifications/blob/main/docs/interactive-sound-preview.md Shows the interactive preview flow: detect system, list sounds, preview phase, then proceed with selection. Includes example user and Claude interactions. ```text Step 1-2: Detect system and list available sounds ↓ Step 3: INTERACTIVE PREVIEW PHASE User: "play Glass" Claude: [plays Glass.aiff] Claude: "Would you like to hear another sound?" User: "preview Hero" Claude: [plays Hero.aiff] User: "ready" ↓ Step 4: Ask only for requested changes; Keep unchanged is the default (Users can still preview during questions) ↓ Step 5: Optional explicit webhook leaf changes ↓ Step 6: Submit only requested edits with config edit --stdin --expect-revision TOKEN ↓ Step 7: Summary & test ``` -------------------------------- ### Development Webhook Configuration Source: https://github.com/777genius/agent-notifications/blob/main/docs/webhooks/configuration.md Development setup with fast failures and less aggressive retry. Disables circuit breaker and rate limiting for quicker feedback. ```json { "notifications": { "webhook": { "enabled": true, "preset": "slack", "url": "https://hooks.slack.com/services/...", "retry": { "enabled": true, "maxAttempts": 2, "initialBackoff": "500ms", "maxBackoff": "2s" }, "circuitBreaker": { "enabled": false }, "rateLimit": { "enabled": false } } } } ``` -------------------------------- ### Check Platform Status Pages Source: https://github.com/777genius/agent-notifications/blob/main/docs/webhooks/troubleshooting.md Check status pages for Slack, Discord, and Telegram to isolate platform issues. ```bash # Check platform status pages # Slack: status.slack.com # Discord: discordstatus.com # Telegram: telegram.org ``` -------------------------------- ### Run all tests with make test Source: https://github.com/777genius/agent-notifications/blob/main/CONTRIBUTING.md Runs the full test suite for the project. Use this as the primary command to verify all tests pass. ```bash make test ``` -------------------------------- ### Inspect OpenCode settings with --target opencode Source: https://github.com/777genius/agent-notifications/blob/main/README.md Managed OpenCode uses a separate settings target. Use the executable and control root reported by its installer. ```bash agent-notifications config path --target opencode --json agent-notifications config inspect --target opencode --json ``` -------------------------------- ### Minimal Webhook Configuration Source: https://github.com/777genius/agent-notifications/blob/main/docs/webhooks/custom.md Basic webhook setup with only the required fields: enabled, preset, url, and format. Use this as a starting point for simple notifications. ```json { "notifications": { "webhook": { "enabled": true, "preset": "", "url": "https://webhook.site/unique-url-here", "format": "json" } } } ``` -------------------------------- ### Show help and options Source: https://github.com/777genius/agent-notifications/blob/main/docs/interactive-sound-preview.md Displays the help and available options for the sound preview binary. ```bash ./bin/sound-preview --help ``` -------------------------------- ### List available sounds with bin/list-sounds Source: https://github.com/777genius/agent-notifications/blob/main/docs/CONFIGURATION.md Use `bin/list-sounds` to see all built-in and system sounds. Add `--json` for JSON output, `--play` to preview a sound, and `--volume` to set preview volume. The skill command `/claude-notifications-go:sounds` also lists sounds. ```bash # List all sounds (built-in + system) bin/list-sounds # Output as JSON bin/list-sounds --json # Preview a sound bin/list-sounds --play task-complete # Preview at specific volume bin/list-sounds --play Glass --volume 0.5 ``` -------------------------------- ### Test Webhook with handle-hook Command Source: https://github.com/777genius/agent-notifications/blob/main/docs/webhooks/README.md Sends a test webhook event using the `handle-hook` subcommand with a PreToolUse payload. Use this after enabling webhooks to verify the setup. ```bash echo '{"session_id":"test","tool_name":"ExitPlanMode"}' | \ bin/claude-notifications handle-hook PreToolUse ``` -------------------------------- ### Custom Webhook Configuration with Auth Source: https://github.com/777genius/agent-notifications/blob/main/docs/webhooks/configuration.md Custom webhook setup with authentication headers, custom format, and full retry, circuit breaker, and rate limiting configuration. ```json { "notifications": { "webhook": { "enabled": true, "preset": "", "url": "https://api.yourservice.com/webhooks/claude", "format": "json", "headers": { "Authorization": "Bearer YOUR_TOKEN", "X-Service-Name": "claude-notifications" }, "retry": { "enabled": true, "maxAttempts": 3, "initialBackoff": "1s", "maxBackoff": "10s" }, "circuitBreaker": { "enabled": true, "failureThreshold": 5, "successThreshold": 2, "timeout": "30s" }, "rateLimit": { "enabled": true, "requestsPerMinute": 60 } } } } ``` -------------------------------- ### Repeatable local install/update testing with dev script Source: https://github.com/777genius/agent-notifications/blob/main/CONTRIBUTING.md Uses an isolated Claude config dir under `~/.claude-dev/claude-notifications-go` by default, avoiding changes to your real Claude setup. ```bash scripts/dev-local-plugin.sh install scripts/dev-local-plugin.sh bootstrap scripts/dev-local-plugin.sh status ``` -------------------------------- ### Authentication Header Formats (JSON) Source: https://github.com/777genius/agent-notifications/blob/main/docs/webhooks/troubleshooting.md Three JSON examples showing header formats for Bearer token, API Key, and Basic auth. Use the appropriate one for your authentication method. ```json {"Authorization": "Bearer YOUR_TOKEN"} ``` ```json {"X-API-Key": "YOUR_KEY"} ``` ```json {"Authorization": "Basic BASE64_ENCODED_CREDENTIALS"} ``` -------------------------------- ### Build the binary with make build Source: https://github.com/777genius/agent-notifications/blob/main/docs/LOCAL_DEVELOPMENT.md Builds the project binary. This is the first step in the local development workflow. ```bash make build ``` -------------------------------- ### focusCommand for activate-window-by-title extension Source: https://github.com/777genius/agent-notifications/blob/main/docs/issues/ubuntu-focus-implementation-plan.md Use this as the focusCommand when the activate-window-by-title extension is installed. It calls the extension's D-Bus method to activate a window by substring, here matching 'Code'. ```bash focusCommand: "gdbus call --session --dest de.lucaswerkmeister.ActivateWindowByTitle --object-path /de/lucaswerkmeister/ActivateWindowByTitle --method de.lucaswerkmeister.ActivateWindowByTitle.activateBySubstring 'Code'" ``` -------------------------------- ### JSON Configuration for 50% Volume Source: https://github.com/777genius/agent-notifications/blob/main/docs/volume-control.md Example configuration for home office with volume set to 0.5. Enables desktop notifications with sound. ```json { "notifications": { "desktop": { "enabled": true, "sound": true, "volume": 0.5, "appIcon": "${AGENT_NOTIFICATIONS_ROOT}/claude_icon.png" } } } ``` -------------------------------- ### Run a single test with go test -run Source: https://github.com/777genius/agent-notifications/blob/main/CONTRIBUTING.md Runs a specific test by name, using the -run flag. The example runs TestStateMachine in the analyzer package with verbose output. ```bash go test -run TestStateMachine ./internal/analyzer -v ``` -------------------------------- ### Check e2e real Claude status Source: https://github.com/777genius/agent-notifications/blob/main/CONTRIBUTING.md Start local testing with the e2e real Claude script to check its status. Follow docs/LOCAL_DEVELOPMENT.md for the detailed workflow and validation matrix. ```bash scripts/e2e-real-claude.sh status ``` -------------------------------- ### Preview a sound with list-sounds --play Source: https://github.com/777genius/agent-notifications/blob/main/commands/sounds.md This script sets the plugin root and then uses the list-sounds binary with the --play flag to preview a specified sound at a given volume. ```bash PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT}" if [ -z "$PLUGIN_ROOT" ]; then INSTALLED_PATH="$HOME/.claude/plugins/marketplaces/claude-notifications-go" if [ -d "$INSTALLED_PATH" ]; then PLUGIN_ROOT="$INSTALLED_PATH" else PLUGIN_ROOT="$(pwd)" fi fi # Use list-sounds --play for playback "${PLUGIN_ROOT}/bin/list-sounds" --play "" --volume 0.3 ``` -------------------------------- ### Telegram Bot Can't Initiate Conversation Error (JSON) Source: https://github.com/777genius/agent-notifications/blob/main/docs/webhooks/troubleshooting.md Error response from Telegram when the bot cannot initiate a conversation with a user. The solution is to have the user start the conversation by sending /start or any message. ```json {"ok":false,"error_code":403,"description":"Forbidden: bot can't initiate conversation with a user"} ``` -------------------------------- ### Example Telegram Message with HTML Formatting Source: https://github.com/777genius/agent-notifications/blob/main/docs/webhooks/telegram.md Shows the plain-text format of a Telegram message using HTML tags for bold, italic, and code. The message includes a task completion status, a bold-cat label, and a session identifier. ```text ✅ Task Completed [bold-cat] Created new authentication system with JWT tokens Session: abc-123 ``` -------------------------------- ### Disable Cursor notifications while retaining registration Source: https://github.com/777genius/agent-notifications/blob/main/docs/cursor-notifications.md Use the installed wizard to disable notifications while keeping registration. An empty interactive channel selection cancels setup; it does not disable notifications. An update without channel flags preserves disabled consent. ```bash "$AN" setup-notifications wizard --action install --agents cursor \ --hooks false --agent-notify false --scope-root "$CURSOR_PROFILE" \ --client-executable "$CURSOR_CLI" --yes --json ``` -------------------------------- ### Inspect and uninstall Cursor notifications with setup-notifications wizard Source: https://github.com/777genius/agent-notifications/blob/main/docs/cursor-notifications.md Use the installed executable (AN) to inspect or uninstall Cursor notifications. Pass the exact --control-root, --runtime-root, and --global-config paths reported by setup when they differ from defaults. Uninstall removes only owned integration entries and runtime references, preserving foreign hook entries and other clients. ```bash "$AN" setup-notifications wizard --action inspect --agents cursor \ --scope-root "$CURSOR_PROFILE" --client-executable "$CURSOR_CLI" --json "$AN" setup-notifications wizard --action uninstall --agents cursor \ --hooks false --agent-notify true --scope-root "$CURSOR_PROFILE" \ --client-executable "$CURSOR_CLI" --yes --json ``` -------------------------------- ### Run with explicit absolute roots and helper Source: https://github.com/777genius/agent-notifications/blob/main/install/uapinstaller/example/README.md Run the sample with explicit absolute paths for state, package, config, helper, and client executable. Required for reinstall after removal. ```sh GOWORK=off go run . -state /abs/uap -package /abs/pkg -config /abs/config \ -helper /abs/helper -client-exe /abs/client ``` -------------------------------- ### make release-canary with SEALED_DIR, RELEASE_ID, CANARY_SCRATCH, CANARY_STATE Source: https://github.com/777genius/agent-notifications/blob/main/docs/RELEASE_SPEED.md Run the downloaded host canary in one command after the draft has its complete sealed inventory. Requires a numeric GitHub release ID and an existing private scratch directory with space for the host executable and small TEST profiles. On macOS or Linux, validates the original seal and source tag, downloads the local host executable by immutable asset ID, checks size/SHA256, runs the canonical isolated version and synthetic Claude/Codex Stop canary, rechecks release/asset identity, and records a receipt in a new TEST-release-canary-* child. Use CANARY_STATE=public for an already published release; the default accepts either state and records the observed state. Failed inputs retain their report and downloaded bytes; a new invocation creates a new child and never overwrites an existing receipt or rebuilds artifacts. ```sh make release-canary SEALED_DIR=/absolute/original-seal RELEASE_ID=NUMERIC_ID \ CANARY_SCRATCH=/absolute/private-scratch CANARY_STATE=draft ``` -------------------------------- ### Pi notifications configuration JSON (schemaVersion 2) Source: https://github.com/777genius/agent-notifications/blob/main/docs/pi-notifications.md Override Pi's notification settings by merging these leaves into an existing configuration after following the schema 2 upgrade instructions. Enables desktop notifications with sound, volume 0.5, no terminal bell, and click-to-focus; disables the webhook. Note that `sound:false` disables the configured cue, `terminalBell:false` keeps the terminal bell quiet, and `clickToFocus:false` disables the terminal action. ```json { "schemaVersion": 2, "agents": { "pi": { "notifications": { "desktop": { "enabled": true, "sound": true, "volume": 0.5, "terminalBell": false, "clickToFocus": true }, "webhook": { "enabled": false } } } } } ```