Skip to content
Back to skills

Principle Push Not Poll

ASecurity

Apply when designing, reviewing, or authoring any mechanism that waits on a long-running background action: a CI/build watcher, a deploy or merge poller, a status-check loop, an agent babysitting a backgrounded command. Prefer a push/wakeup signal over a tight poll loop.

  • 4 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 19, 2026
ai-agents

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 19, 2026

npx -y skills add EdbertChan/catstack --skill principle-push-not-poll --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Principle Push Not Poll?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Principle Push Not Poll
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/edbertchan-principle-push-not-poll/badge)](https://www.skillsdirectory.com/skills/edbertchan-principle-push-not-poll)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: principle-push-not-poll
description: "Apply when designing, reviewing, or authoring any mechanism that waits on a long-running background action: a CI/build watcher, a deploy or merge poller, a status-check loop, an agent babysitting a backgrounded command. Prefer a push/wakeup signal over a tight poll loop."
disable-model-invocation: true
---

# Push, Not Poll

A poll loop that re-sends or re-evaluates growing state on every check compounds cost near-quadratically in check count, not linearly in wall-clock time. Waiting longer isn't the expensive part — checking often is.

**Why:** When a system waits on a long-running background action inside a growing conversation or log, each poll re-transmits (and often re-bills, via cached-input pricing) the entire accumulated state so far, not just the delta since the last check. Tightening the poll interval doesn't just add checks linearly — it multiplies the resend cost by a state size that is itself growing with every check. The fix isn't "poll less" as a vague instinct; it's recognizing that a push/wakeup notification (the background action tells the watcher when it's done) pays for the wait once, while a poll loop pays for it once per check.

**Pattern:**
- Prefer a callback, webhook, event, or completion signal from the long-running action itself over a caller that repeatedly asks "are you done yet?"
- If no push mechanism exists and polling is unavoidable, widen the interval and cap the check count — don't poll on a fixed short cadence for an unbounded or long wait.
- Treat "we polled every N seconds for M minutes" as a red flag in review, not a neutral implementation detail — ask whether N was chosen for responsiveness or just left at a default.
- When a poll loop resends conversation/log history on each check, the cost driver is check count × accumulated state, not check count alone — cheaper to grow the interval than to trim the state per check.
- If you control both sides (the waiter and the thing being waited on), add the push path rather than tuning the poll harder.

**Battle-tested:** Invoker's fix-ci auto-repair sessions backgrounded a 15–45 minute verify command and polled it every 10–30 seconds, each poll re-sending the whole growing conversation as cached input — 50–125M tokens burned per session. Measured against Invoker's fix-ci-token-bench simulator: a 10s-cadence, no-cap polling policy cost 74,147,000 tokens for a 45-minute wait; a 180s-cadence, 15-check-cap policy cost 966,000 tokens for the same wait — a 98.7% reduction, now gated permanently into Invoker's pnpm test. The mechanical, Invoker-specific implementation of this principle for workflow/worker authors lives outside this repo as the Invoker skill named push-not-poll — this skill is the general, harness-agnostic version of the same lesson.

Files in this skill

  • SKILL.md2.8 KB
  • tests/fires_example.md1.1 KB
  • tests/stays_silent_example.md560 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.