Skip to content
Automation
Skill

/background-watch-hook

Run durable `vibe watch` waits for PR reviews, CI, files or external signals, then resume the Agent in the right Session.

From plugin
avibe
6377 skills

Claude Code

$ npx -y skills add avibe-bot/avibe --skill background-watch-hook --agent claude-code

SKILL.md

background-watch-hook.SKILL.md
name: background-watch-hook
slug: background-watch-hook
description: Run durable `vibe watch` waits for PR reviews, CI, files or external signals, then resume the Agent in the right Session.
version: 0.20.0

Background Watch Hook

Use `vibe watch` for a durable wait that resumes an Agent when an external event arrives. The waiter detects events; the follow-up Agent verifies live state and acts. A success candidate is not merge authorization.

Contract and lifecycle

| Waiter exit | Meaning | | --- | --- | | `0` | One **new** reportable event; summary on stdout | | `75` (or configured retry code) | Still waiting; no Agent turn | | `64` plus `avibe-watch: no-event` on stderr | Quiet completed cycle: retire once, re-arm forever | | `124` or other terminal failure | Notify the Agent and stop |

A bare `64` is an error. Keep diagnostics on stderr. A once Watch waiting for its first event uses a retry code, not `64`. Forever waiters need durable cursors or edge detection; a persistent true condition is not a new event. Avibe serializes follow-ups, re-arms after they settle, and pauses rapid repeated events for repair.

  • Read `vibe watch add --help` before first use; inspect/update with

`vibe watch <list|show|update|pause|resume|remove>`.

  • `--timeout` bounds each cycle (default six hours); `--lifetime-timeout` bounds

the whole Watch. Use `0` for an intentionally unbounded PR delivery loop.

  • Remove the Watch at close-out. Do not use detached shells for durable waits.

Session targeting

  • Inside an Avibe-injected Agent shell, omitting the target continues this conversation.
  • Use `--session-id <id>` only when resuming a different existing Agent Session.
  • Use `--create-session --same-scope` for one visible sibling Session; use

`--create-session-per-run --same-scope` for a separate visible Session per event.

  • Use `--scope-id <scopes.id>` instead of `--same-scope` for an explicit scope.
  • If `--cwd` is omitted, Avibe uses the command's current working directory.

Preferred PR + CI watch

Use `--forever` and one owner-specific state file for the whole loop. Seed and arm before the watched push/review trigger; for a new PR, create it first, then immediately seed/arm. Keep the same Watch and cursor across all later rounds.

  • `wait_pr.py --workflow <actual-name>` combines PR activity with exact-head CI;

repeat `--workflow` for every required workflow. Omit `--sha` to follow pushes.

  • Authenticated PR watches also report paginated merge-queue timeline events:

enqueue, removal (with GitHub's reason), and `MERGED` (with merge commit/ref). These survive filters, success coalescing, and restart/delivery acknowledgement. Keep this same Watch through queue validation; PR-head CI is not merge-group CI. On removal, inspect the reason and associated queue run, then follow `pr-delivery-loop` recovery. Only `MERGED` readback permits close-out.

  • `--coalesce-success`: keep half-success quiet; report one same-head CI/review

success candidate. Findings, errors and unfamiliar results remain reportable.

  • `--actionable-only` drops review triggers and empty envelopes; `--settle 20`

batches review bursts. New CI failures bypass settle. Final gates belong to `pr-delivery-loop`, including the stricter qualification of Codex reactions.

  • A Codex review of the current head that stays running for

`--review-stall-minutes` (default 30, `0` disables) is reported as `Codex review stalled`, again each further window it lasts; the follow-up re-requests the review as `pr-delivery-loop` says.

  • Set `--timeout 0` on both sides of the `--` command separator; six quiet hours

is not a PR failure. Verify workflow names: missing CI is never green.

  • Never reseed or replace its state between rounds. Filters/reporting modes are

part of cursor ownership; enable them on the initial seed and armed command.

  • Cursor corruption, ownership conflicts or write failures require repair with

evidence preserved, not a fresh baseline. Retryable GitHub failures keep waiting.

Run scripts from the loaded Skill directory, not a guessed installation path:

BACKGROUND_WATCH_HOOK_DIR="<directory containing the loaded SKILL.md>"
STATE_FILE="$HOME/.avibe/state/watch-cursors/pr-151-review.json"
BRANCH="$(gh pr view 151 --repo avibe-bot/avibe --json headRefName --jq .headRefName)"

uv run --no-project "$BACKGROUND_WATCH_HOOK_DIR/scripts/wait_pr.py" \
  --repo avibe-bot/avibe --pr 151 --branch "$BRANCH" \
  --workflow lint --coalesce-success --actionable-only \
  --state-file "$STATE_FILE" --seed-state

vibe watch add \
  --name "Watch PR 151 review and CI" --forever --timeout 0 \
  --message "PR #151 has an event. Follow pr-delivery-loop; verify live gates, handle findings/errors, and keep half-success silent." \
  -- \
  uv run --no-project "$BACKGROUND_WATCH_HOOK_DIR/scripts/wait_pr.py" \
    --repo avibe-bot/avibe --pr 151 --branch "$BRANCH" \
    --workflow lint --coalesce-success --actionable-only \
    --settle 20 --state-file "$STATE_FILE" --interval 60 --timeout 0

After confirming the seeded Watch is live, push or trigger review. Check exactly one live Watch per owner/PR/concern at each round's end. The state file stages reports until delivery acknowledgement, so an undelivered report may replay; never discard it merely to avoid a duplicate.

Other waits and troubleshooting

Use `wait_pr.py` without CI arguments for PR-only activity; use `wait_action.py` for standalone Actions and `wait_issue.py` for issues. Do not combine `--new-prs` with CI options. `--catch-up` and explicit cursors deliberately replay history, not routine re-arming. Keep Watch messages short and action-oriented; reference loaded policy rather than restating it on every fire.

[Detailed waiter reference](references/waiters.md) covers alternative commands, filters, replay, authentication, and cursor/settle internals. Read it only for those tasks or a concrete failure, not for routine PR monitoring.

Read more
@avibe-bot
Ships withavibe

The local-first Agent OS — your AI partner lives on your own machine. Drive the official Claude Code, Codex & OpenCode from your browser or any chat app.

Stars on GitHub

Momentum

stars in total
637
Star history of avibe-bot/avibe on GitHub, a chart by star-history.com

Other skills on avibe.

agent-prompt-audit

agent-prompt-audit

Audit and improve the prompt surface of Avibe Agents across backends (Claude, Codex/GPT, OpenCode) — global and project rules,…

@avibe-bot@avibe-botInstall Skill
computer-use

computer-use

Use Avibe's local Computer Use CLI for carefully bounded desktop observation and actions.

@avibe-bot@avibe-botInstall Skill
use-avibe-harness

use-avibe-harness

Use Avibe Harness for durable Agent delegation, Sessions, scheduled Tasks, Watches, Runs, queues, and work that must continue…

@avibe-bot@avibe-botInstall Skill
use-avibe-vault

use-avibe-vault

Use Avibe Vault for API keys, tokens, passwords, protected credentials, authenticated HTTP requests, or digest signing without…

@avibe-bot@avibe-botInstall Skill
use-avibe

use-avibe

Safely inspect and modify local Avibe configuration, routing, runtime settings, watches, scheduled tasks, Avibe Cloud remote…

@avibe-bot@avibe-botInstall Skill
use-show-pages

use-show-pages

Build, inspect, update, restore, or share Avibe Show Pages for visual explanations, diagrams, reports, or interactive prototypes.…

@avibe-bot@avibe-botInstall Skill

More skills from other plugins.

agent-builder

agent-builder

Load immediately after an Agent intent, before the first agent_builder_* call. Governs how you create, configure, test, and…

n8n10d209k
@n8n-io@n8n-ioInstall Skill
browser-use

browser-use

Direct browser control via CDP for web interaction: automation, scraping, testing, screenshots, and site/app work. Also covers…

@browser-use@browser-useInstall Skill
agent-browser

agent-browser

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling…

@vercel-labs-2@vercel-labs-2Install Skill
add-anydoc

add-anydoc

Add local office-document-to-Markdown conversion to NanoClaw agent containers with the pinned Firecrawl AnyDoc CLI. Use when…

@nanocoai@nanocoaiInstall Skill

Questions about background-watch-hook.

Which coding agents can use background-watch-hook?
background-watch-hook installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.