You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Babysit step 6 on Claude Code: say how to run watch-pr (background in the main session, bounded in a subagent) #232
On Claude Code, the poteto-mode Babysit playbook does not say how to run the PR watcher. Agents either hold it in the foreground or wrap it in a babysit subagent that polls CI.
skills/poteto-mode/playbooks/babysit.md step 6 (identical in installed 1.4.1 and main at 9368993, 1.15.0):
On GitHub, run skills/poteto-mode/scripts/watch-pr/watch-pr --owner "$base_owner" --repo "$base_name" --pr "$pr" under the installed plugin. … The bare command polls until a terminal verdict, which is drive behavior. … Run drive and background under /loop in dynamic mode. Rearm the watcher after every push wave and every verdict you act on. Watcher output drives wakeups. Never add a second sleep loop.
watch-pr --timeout defaults to 0 ("deadline; 0 disables it") in scripts/watch-pr/cli.ts. On Claude Code that means:
Foreground in any session: the bare watcher has no deadline. It hits the 10-minute Bash cap and blocks the conversation until then.
Background in the main session (run_in_background: true): this works. The exit notification re-invokes the session, which matches "Watcher output drives wakeups".
From one month of Claude Code transcripts on one machine (2026-09-19 to 10-19), where babysitting ran as one background subagent per PR:
227 polling loops, 9.5 h. 9.3 h of that was inside subagents, almost all of them babysit subagents.
By what the loop waited for: the subagent's own test or build log marker (3.7 h), its own background task output file (2.9 h), and CI or GitHub checks (2.3 h).
The longest single babysit subagent spent 1.44 h polling.
Suggested text
Add to step 6, for Claude Code:
On Claude Code, run the watcher from the main session with Bash run_in_background: true and act on its exit notification. Inside a subagent, run it in the foreground with --timeout 570 and re-arm on timeout. Do not background it and then poll its output file.
Optionally, mention the same thing in references/codex-tools.md. Codex exec_command already returns with a session id, so it is unaffected.
Not verified
Whether /loop dynamic mode on Claude Code already re-arms a backgrounded watcher correctly. I did not test that path.
Thanks for this, and for quoting the exact text. Both quotes check out on main at 9368993: step 6, and watch-pr's --timeout default of 0.
Testing on Claude Code 2.1.304 changes two details of the suggested text:
A foreground Bash call that reaches its timeout moves to the background instead of stopping, and the default timeout is 2 minutes. So a foreground watcher also needs Bash timeout: 600000.
--timeout 570 can still overrun the 10-minute limit. watch-pr checks its deadline only before each sleep, and one sleep can last up to 300 s after a retry. We'll use --timeout 240 and rearm on TIMEOUT.
On your "Not verified" question: /loop can't run inside any subagent, because subagents don't get ScheduleWakeup. So step 6's /loop line works only in the main session.
We plan to fix this together with #233 in one PR: a Claude Code section in references/codex-tools.md that says how the main session and subagents wait, and one sentence in step 6 that points to it. We'll link the PR here.
This shipped in Open Pstack 1.16.0 (https://github.com/ericlitman/open-pstack/releases/tag/v1.16.0) through #239. The lane agents no longer set background: true, and references/codex-tools.md has a "Waits on Claude Code" section that babysit step 6 points to. Thanks for the careful reports.
Activity
ericlitman commentedon Oct 21, 2026
Thanks for this, and for quoting the exact text. Both quotes check out on
mainat9368993: step 6, andwatch-pr's--timeoutdefault of 0.Testing on Claude Code 2.1.304 changes two details of the suggested text:
timeout: 600000.--timeout 570can still overrun the 10-minute limit.watch-prchecks its deadline only before each sleep, and one sleep can last up to 300 s after a retry. We'll use--timeout 240and rearm onTIMEOUT.On your "Not verified" question:
/loopcan't run inside any subagent, because subagents don't getScheduleWakeup. So step 6's/loopline works only in the main session.We plan to fix this together with #233 in one PR: a Claude Code section in
references/codex-tools.mdthat says how the main session and subagents wait, and one sentence in step 6 that points to it. We'll link the PR here.ericlitman commentedon Oct 21, 2026
The fix is open as #239.
fix(pstack): rearm the subagent watcher after acted-on verdicts (#232)
Merge pull request #239 from ericlitman/fix/232-233-claude-code-waits
ericlitman commentedon Oct 21, 2026
This shipped in Open Pstack 1.16.0 (https://github.com/ericlitman/open-pstack/releases/tag/v1.16.0) through #239. The lane agents no longer set
background: true, andreferences/codex-tools.mdhas a "Waits on Claude Code" section that babysit step 6 points to. Thanks for the careful reports.fix(pstack): let Claude Code subagents wait in the foreground (ericli…