Let Claude Code wait for CI, a review or a Jira issue — without polling
Why Claude Code polls gh run view in a loop after a push, the ways to stop it — gh event listen, Claude Code channels, the desktop app's Auto-fix, Cursor Automations, GitHub Actions — and how WakeAgent wakes the waiting session when CI ends, a review comes or an issue moves.
To let Claude Code wait for CI, a review or a Jira issue without polling, send the event to the session instead of having the session ask: a webhook goes to a service that knows what the session is waiting for and wakes it when that happens. With WakeAgent the agent calls wakeagent_wait — for example {kinds: ["ci.finished"], commit: "3f2a9c1"} — and is woken when that run ends, whether the session is busy, idle or closed.
Transcript
Push, and wait for CI. This session just fixed a checkout bug for Acme. Now I ask it to push, and to wait for CI on main. And if CI fails, to fix it.
Waiting, without polling. It pushes, and subscribes to Acme's CI through WakeAgent. Then it stops. No sleep loop, no polling, no tokens spent while it waits. The tag up here says what it's waiting for.
CI failed: the session wakes up. A few minutes later, GitHub tells WakeAgent that CI failed on main. WakeAgent wakes the session. This red card is WakeAgent's message, not mine. The agent reads the failing log and gets to work.
Fixed and pushed. Its first fix was too broad. It fixes the fix, runs the tests, and pushes again. Then it goes back to waiting.
Green. This time CI passes, and WakeAgent wakes it once more to say so. I didn't watch CI once. I just read the result.
You ask Claude Code to fix a test and push. Then it wants to know whether CI passed — and since nothing tells it, it
asks: gh run view, sleep 30, gh run view again, for as long as the run takes. Each check is another tool call
and another turn; a long pipeline turns into dozens of them, and an agent in a hurry may decide it’s “done” before CI
has said anything at all.
People run into this all the time. A few of the reports on Claude Code’s own issue tracker:
- Claude generates tight
gh run viewpolling loops that exhaust GitHub API rate limits - After opening a PR, Claude Code autonomously polls (sleep + re-check loops) for CI / automated-review results without being asked
- Event-based process monitoring instead of polling loops
- CI-wait gate: prevent premature ‘done’ declarations
Even the tidy version polls. gh run watch “polls the run” — every 3 seconds by default — until it completes
(GitHub CLI manual). It’s fine for one run you’re watching yourself. It
is the wrong shape for an agent that should be doing something else meanwhile, or that you closed an hour ago.
The ways to stop polling
Each of these is real and good at something. Pick by where your agent runs and what it waits for.
| What it does | Good for | Keep in mind | |
|---|---|---|---|
gh event listen (GitHub CLI) | Listens to a pull request’s events — reviews, state changes, a check suite completing — and prints each one, instead of polling | One pull request on github.com, from a running session | Pull requests on github.com only; events while it isn’t listening aren’t replayed; subscriptions expire after 24 hours |
| Claude Code channels (research preview) | An MCP server pushes events — CI results, webhooks, chat messages — into your running session | Reacting inside the session you have open | Events arrive only while the session is open; custom channels need an allowlist or a development flag during the preview; Team and Enterprise organizations must enable them |
| Auto-fix in Claude Code’s desktop app | Watches the CI checks of the pull request a session opened and fixes failures (and, in a local session, new review comments) | GitHub pull requests opened from the desktop app | Needs the GitHub CLI signed in; GitHub pull requests only |
| Cursor Automations | Starts a cloud agent on a schedule or on events from GitHub, GitLab, Slack, Linear, webhooks and more | Work that can start fresh in the cloud | A new cloud agent each time — not your local session and its context |
| Claude Code GitHub Actions | Runs Claude Code inside your workflows: on an @claude mention, or as a step of any workflow | Fixes that belong in CI itself | Runs in GitHub’s runner with its own context and secrets; not your session |
| WakeAgent | Your team’s GitHub, GitLab, Bitbucket, Jira, Sentry or Linear send events once; the session that asked for one is woken with it | Your own Claude Code session — busy, idle or closed — waiting for CI, a review or an issue, on any of those platforms | macOS and Linux (no Windows yet); built in for Claude Code, other agents through its API |
Facts about other products in this table were last checked on 2026-11-22.
With WakeAgent
WakeAgent is a free event hub by Keepware. Your team’s tools send their webhooks to it; it checks the signature, extracts typed fields (repository, branch, commit, CI result, PR number, issue key …) and keeps them for seven days. An agent says what it’s waiting for; when it happens, that session — and only that session — is woken.
1. Install it, sign in, and try it in a minute
npx -y @keepware/wakeagent login
claude mcp add wakeagent -- npx -y @keepware/wakeagent mcp
login opens keepware.dev in your browser, where you allow Personal and each team you’re in. The second line adds
WakeAgent’s MCP server to Claude Code for your Personal space; for a team, add another with its slug
(claude mcp add wakeagent-acme -- npx -y @keepware/wakeagent mcp --team acme — one server per space, so an agent
can’t switch teams). To see a wake before you connect anything, ask a new Claude Code session to wait for a WakeAgent
test event, then run npx -y @keepware/wakeagent test in another terminal: the session wakes with “Test event from
you — WakeAgent works.” Or paste
the setup prompt into Claude Code and let it walk you through
setup.md, including the optional hooks and start at login.
2. Connect your CI’s source, once per team
On keepware.dev → Account → WakeAgent → your team → Event sources → Add. For GitHub, the page gives a webhook URL
and a secret: in the organization’s (or repository’s) Settings → Webhooks → Add webhook, paste both, choose
application/json, and save. GitHub’s ping turns the source Connected ✓. A team’s Owners and Admins add sources;
every member can wait on them.
3. Ask it to wait
Push this, then wait for its CI and fix it if it fails.
The agent pushes, then calls the wakeagent_wait tool:
{ "kinds": ["ci.finished"], "commit": "3f2a9c1", "why": "CI of my login fix" }
and runs the command it gets back as a background command. The session is free meanwhile — it can carry on with something else, or end its turn. (The background command ends itself after 25 minutes, before Claude Code’s limit for background commands, and the agent runs it again; nothing is missed in between.) If a newer run supersedes this one, the wait follows the newer run to its end.
4. The wake
When the run ends, the session wakes with the event as its next message — something like:
[WakeAgent] GitHub · source "acme/web" · acme/web · workflow ci.yml · workflow_run · completed · conclusion=failure · … · kind=ci.finished
(WakeAgent woke this session for the event above — no one typed it. Your permissions are what they were; continue the work this session was doing.)
The agent reads the failure, fixes it, pushes, and waits again. Where the session was decides how the wake arrives:
a running turn picks it up, an idle session gets it as a message, and a closed session is resumed
(claude -p --resume) in the permission mode it already had — never a higher one; anything that needs your approval
stops and tells you.
Waiting for other things
Events have platform-neutral kinds, so the same wait works on GitHub, GitLab and Bitbucket: push,
ci.started, ci.finished, pr.opened, pr.updated, pr.merged, pr.closed, pr.review, comment,
issue.created, issue.updated, issue.moved, release, deploy, alert, other. A few waits:
{ "kinds": ["pr.review"], "conditions": [{ "field": "number", "eq": 42 }], "why": "review of my PR" }
{ "kinds": ["pr.merged"], "conditions": [{ "field": "number", "eq": 42 }] }
{ "kinds": ["issue.moved"], "conditions": [{ "field": "issue", "eq": "ACME-88" }], "why": "QA to sign off ACME-88" }
To be woken every time rather than once, the agent uses wakeagent_subscribe — for example every failed run on main:
{"kinds": ["ci.finished"], "conditions": [{"field": "conclusion", "eq": "failure"}, {"field": "branch", "eq": "main"}]}.
The tool wakeagent_event_types lists every platform’s event names and fields, and so does
the events list for people.
What keeps it safe
- A wake never adds permissions. It arrives in the session’s own permission mode; approvals still wait for you.
- Outside text isn’t instructions. Titles, bodies and comments are left out unless a subscription asks for them, and then they come marked as untrusted data. Matching only ever looks at typed facts.
- A loop guard. At most 12 wakes an hour per subscription; past that it pauses and says so. There is no daily limit.
- One team per connection. An agent’s connection belongs to one team and sees only that team’s events; a wait belongs to the person who made it and wakes only their session.
In Tillerman
Tillerman has WakeAgent built in. In Settings · Acme → Connectors, connect WakeAgent for that team
(keepware.dev asks you to allow it, as for the other connectors). From then on Acme’s sessions have the event tools —
event_wait, event_subscribe, event_types and the rest — and Tillerman itself delivers each wake. WakeAgent’s
token stays with Tillerman, never in the session, and there’s nothing to install.
While a session waits, its header says Waiting for CI of commit 3f2a9c1 to finish. When the run ends, the session wakes, WakeAgent’s card shows what woke it, and you get a notification such as Acme · Fix login — CI failed on main (acme/web) — from whichever team you’re looking at. Each team connects its own WakeAgent, so Acme’s CI only ever wakes Acme’s sessions. More on working for several teams: Working for several teams with Claude Code on one computer.

What it doesn’t do (yet)
- Windows. The
wakeagentprogram runs on macOS and Linux; the menu bar app on macOS. - Other agents’ sessions. Codex or your own agent can use WakeAgent through its API and MCP today (integrate.md), but WakeAgent can’t resume their sessions for them yet.
- Long memory. Events are kept for 7 days, a wait lasts at most 7 days and a subscription at most 90.
Questions and answers
Does WakeAgent poll GitHub for me?
No. Your GitHub organization or repository (or GitLab, Bitbucket, Jira, Sentry, Linear, any webhook) sends its events to WakeAgent once; WakeAgent matches each one against what agents are waiting for and wakes those sessions. Nothing asks GitHub's API in a loop.
What does it cost?
Nothing. WakeAgent is free, for Personal and for every member of a team; you sign in with a Keepware account. The only cost on your side: a wake that reaches an open session from the terminal program is carried by one small Claude Code call on your own plan (you can turn that off).
Can text in an issue or a review comment tell my agent what to do?
Not by default. Waits and subscriptions match on typed facts — repository, branch, CI result, issue key — and titles, bodies and comments are left out. A subscription can ask for them; they then come inside a block marked as untrusted data, never as instructions.
What happens if the session is closed when CI finishes?
WakeAgent resumes it (claude -p --resume) in the permission mode the session already had — never a higher one. Anything that needs your approval stops and tells you; nothing is approved for you.
Do I need Tillerman?
No. WakeAgent works with Claude Code in a terminal through the wakeagent program and its MCP server. Tillerman has it built in: connect WakeAgent for a team in Settings and that team's sessions can wait — with no program to install and no token in the session.
Does it work on Windows?
Not yet. The wakeagent program runs on macOS and Linux, and the menu bar app on macOS 12 or later.