AI coding agents
Start a long agent task, walk away, get a push when Cursor, Claude Code, or Codex finishes — or when it needs your attention.
How it works
- You save a small shell script that calls Trigv.
- Your AI tool runs that script when the agent stops (via “hooks”).
- Trigv sends a push to your phone.
Before you start
- API key exported as
TRIGV_API_KEYin your shell (create one) - Optional: create an
agentschannel in the dashboard curlandjqinstalled (macOS: usually pre-installed or via Homebrew)
Step 1 — Save the notify script
Create ~/.local/bin/trigv-notify.sh:
Code
#!/usr/bin/env bash
set -euo pipefail
TITLE="${1:-Agent finished}"
DESCRIPTION="${2:-}"
CHANNEL="${TRIGV_CHANNEL:-agents}"
LEVEL="${TRIGV_LEVEL:-info}"
: "${TRIGV_API_KEY:?Set TRIGV_API_KEY}"
PAYLOAD=$(jq -n \
--arg channel "$CHANNEL" \
--arg title "$TITLE" \
--arg description "$DESCRIPTION" \
--arg level "$LEVEL" \
--arg event_type "agent.completed" \
'{channel: $channel, title: $title, description: $description, level: $level, event_type: $event_type}')
curl -sS -X POST https://api.trigv.com/api/v1/events \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${TRIGV_API_KEY}" \
-d "$PAYLOAD" >/dev/null Then run: chmod +x ~/.local/bin/trigv-notify.sh
Step 2 — Test manually
Code
export TRIGV_API_KEY=trgv_...
~/.local/bin/trigv-notify.sh "Test" "Hooks will work" Check your phone before wiring hooks.
Step 3 — Pick your tool
- Cursor — hooks in
.cursor/hooks.json - Claude Code — hooks in settings
- OpenAI Codex — hooks in config.toml
- Other agents — wrapper scripts
Keep keys out of git. Use environment variables — never commit API keys in hook config files.