| description | Run ONE iteration of an unattended loop — babysit a PR to green, clear an epic leaf by leaf, or poll a label and dispatch /work-issue — with budgets and stop conditions kept on disk. Recurrence comes from /loop, a session cron, or a scheduled task (--cron-id schtasks:<TaskName>). |
|---|
/tracker-loop [ref] [--label ] [--merge | --draft] [--restart] [--cron-id schtasks:] | status | stop []
One iteration per invocation. /tracker-loop never schedules itself and never calls ScheduleWakeup; recurrence is external:
| Recurrence | How |
|---|---|
| Self-paced (preferred) | /loop /agent-issue-tracker:tracker-loop babysit #42 — the harness picks each delay; this command ends every iteration with a pacing hint the self-paced loop follows |
| Fixed interval | /loop 15m /agent-issue-tracker:tracker-loop poll |
| Armed by a driver | /work-issue #42 --start --loop or /resume-initiative #9 --start --loop creates a session cron that fires this command (see those commands) |
| Scheduled task (long-lived) | Windows Task Scheduler runs claude -p "/agent-issue-tracker:tracker-loop poll --cron-id \"schtasks:<TaskName>\"" every loops.interval, each fire a fresh session; see Recurring mode below. keel's keel tasks install registers one per project as Tracker Loop <project> |
Session crons expire after seven days and end with the conversation. A scheduled task outlives every session and is the documented answer for a loop that runs for weeks; /schedule (cloud routines) is the other, and is not wrapped here.
/tracker-loop babysit [<pr-number> | <issue-ref>] [--merge] [--restart] [--cron-id schtasks:<TaskName>]
/tracker-loop clear <epic-ref> [--draft | --merge] [--restart] [--cron-id schtasks:<TaskName>]
/tracker-loop poll [--label <name>] [--draft | --merge] [--restart] [--cron-id schtasks:<TaskName>]
/tracker-loop status
/tracker-loop stop [<loop-id>]
--cron-id names the external scheduler that fires this loop and selects Recurring mode (below). It must start with schtasks: (the task's name follows, spaces allowed; quote it); refuse any other value with a one-line message, since a session cron is never passed on the command line (the drivers record theirs with LR set-cron). Without --cron-id every step below behaves as it always has.
--draft and --merge are mutually exclusive; refuse with a one-line message if both are passed. They pass straight through to the /work-issue invocations a loop makes and to the babysit merge rule. When neither is on the command line, the loaded record's options.merge / options.draft apply (a loop armed by a driver, or re-armed from a resume note, keeps the flags it was created with); a flag on the command line wins over the record for that iteration. "The effective --merge" / "the effective --draft" below means this resolved value. --restart creates a fresh record even when a stopped one already exists for that mode and ref (see step 2).
Optional loops: block in the effective config (defaults shown; examples/issue-tracker.yaml.example documents it; README "Where the config is found"):
loops:
interval: 15m # cron cadence for --loop; poll idle cadence
max_iterations: 50
max_hours: 24
idle_stop_after: 12 # consecutive no-change iterations
pr_mode: draft # draft | ready — PRs opened by unattended loops
poll_label: agent-ready
# claim_label: agent-claimed
# max_concurrent: 1Read each key with "${CLAUDE_PLUGIN_ROOT}/scripts/lib/common.sh"'s ait_config_get loops.<key>; an unset key takes the default above.
All bookkeeping goes through "${CLAUDE_PLUGIN_ROOT}/scripts/loop-record.sh" (LR below). Every subcommand prints JSON.
-
Collect. Run
"${CLAUDE_PLUGIN_ROOT}/scripts/session-brief-collect.sh"for the current branch (SBbelow). It runs first, before the record is loaded, because step 2 needsSB(the babysit ref and the session transcript). Modesclearandpollalso read the tracker in their own step. -
Load or create the record. The record's
<ref>is:poll→ the poll label in use (--label, elseloops.poll_label, defaultagent-ready);babysitwith no argument →SB.ticket.key, else#<SB.pr.number>, else the current branch name;babysit <arg>→ that argument, normalised: strip a leading#; a bare number is then a PR number whengh pr view <n>resolves one, else an issue number, and either way is recorded as#<n>(the form the no-argument case uses), sobabysit 128andbabysit #128find the same record;owner/repo#Nand any other issue ref are kept as-is;clear→ the epic ref.LR findandLR createalways take the normalised ref.LR find <mode> <ref>; if it returns a live record whosecron_job_idstarts withschtasks:, it belongs to a scheduled task: printloop <id> is driven by <cron_job_id>; not actingand end the iteration without acting (pacing hintstopped), and never adopt it. If it returns any other live record, use it. Otherwise, unless--restartwas passed,LR find --any --no-scheduled <mode> <ref>(--no-scheduledleaves out every record a scheduled task owns, so this path never reopens one or reports its stop reason):null→ create (below).- the newest record is stopped with a
stop_reasonbeginningcheckpoint:→ a checkpoint continues only in a different session. IfSB.session.transcriptis non-null and differs from the record'sstop_transcript,LR reopen <id>and continue with that record: itsstartedtime, iterations,prs_opened, budgets and options are kept, so the budgets keep counting, and itscron_job_idis cleared, since the checkpointing session's cron ended with that session. Otherwise printloop <id> is checkpointed for a fresh session; press Esc to end this /loop, then start a new session with the resume note (or pass --restart)and end the iteration without acting, with pacing hintstopped: a same-session/loopkeeps firing into this message until the operator presses Esc. - the newest record is stopped for any other reason → print
loop <id> is stopped (<reason>); pass --restart to begin a new loopand end the iteration without creating or acting.
--restartskips thefind --anycheck above and always creates a fresh record.With
--cron-id, step 2 follows Recurring mode "Load or create" instead of the three bullets above.reopennever resetsstarted: a reopened record'smax_hoursbudget includes the gap between the checkpointing session and the one that reopened it. That is by design;--restartis the way to a fresh clock.Create:
LR create <mode> <ref> <branch> [--merge] [--draft] --max-iterations … --max-hours … --idle-stop-after … --interval …with the configured budgets and the command-line flags.<branch>is the current branch forbabysit, the epic ref's slug forclear, and""forpoll. Refuse to create a second live loop of the same mode and ref; report the existing id instead.Flags. With the record loaded, resolve the effective
--merge/--draft(see Modes): the command line wins; otherwise the record'soptions.merge/options.draft. -
Budget check.
LR check <id>. Onok: falsewithrecurring: true(a scheduled loop whose window budget is spent), do not stop:LR append <id> wait "<reason>" --noop, print step 7's report line withnext: <window_ends>, then the window line (Recurring mode), and end the iteration. On any otherok: false, go to step 8 with thereason.max_iterationscounts the record'siterations[]entries whose action is notskip: skip entries are clear-mode bookkeeping, so a cascade of skips does not burn the iteration budget, anditerations[]can be longer than the countLR checkreports. -
Decide. The mode's table yields exactly one action, or
wait, orstop <reason>. -
Act. Perform that one action through the existing skills and commands. An "action" is one mutating work action — a push, a rebase, a branch update, a merge, or a
/work-issuedispatch; bookkeeping (the skip comment,LR append … skip) doesn't count against the limit. Never two mutating actions in one iteration, except where a mode's table below says otherwise (poll, clear). -
Checkpoint. Apply the
/session-briefverdict table (commands/session-brief.mdStep 3) toSB.session. On afresh sessionverdict, in this order: run step 7'sLR appendfor the action just taken (so it is on the record), write the resume note exactly as/session-briefStep 4 does, including the**Loop:**re-arm line, thenLR stop <id> "checkpoint: fresh session" --transcript <SB.session.transcript>(omit--transcriptwhen that is null) and go to step 8, which does not stop the record a second time.- The
**Loop:**re-arm line is written from the record this iteration holds (its mode, ref and effective--merge/--draft), not fromSB.loop: the collector matchesSB.loopby branch, so it is null for a clear or poll loop. - A
/compactverdict does not checkpoint: continue to step 7 and append· suggest /compactto its report line. The loop never compacts itself. - The verdict applies only to the loop's own session. When this command runs inside a subagent,
SB.sessiondescribes the parent's transcript whatever itstranscript_source(env,session-idordiscovered); treat the verdict askeep goingthere. Branches a clear or poll loop entered itself (its leaves' and PRs' worktrees) do not count toward the table's "more than one branch or ticket" row; only the turn, span and compaction rows can checkpoint such a loop.
- The
-
Record and report.
LR append <id> <action> "<detail>" [--noop]— appendwait-ciwithout--noopfor the CI-in-progress wait (babysit table row 8; it doesn't count towardidle_stop_after), andwaitwith--noopfor the idle wait (row 9) and any other no-op iteration. No other action takes--noop. Then print one line:loop <id> · <mode> <ref> · iteration <n> · <action or noop> · next: <pacing hint>A scheduled loop (Recurring mode) then runs
LR window <id>and prints itslineas the last line of the iteration's output, on its own:loop <id> window okwhen something acted since this fire'sLR check, elseloop <id> window skipped. The wrapper that runs the task may parse it: keel'skeel runkeeps it as the run's summary and records the run asokeither way, since an idle fire is a healthy one. -
Stop.
LR stop <id> "<reason>"(already done by step 6 for a checkpoint); if the printedcron_job_idis set and does not start withschtasks:,CronDeleteit. Aschtasks:id is never passed toCronDelete: the task belongs to Task Scheduler, not to this session, and stopping the record does not unregister it; a scheduled loop runsLR window <id>beforeLR stopand ends with that line (Recurring mode "Window line"). For a checkpoint, first print step 7's report line withnext: stoppedfor the action step 6 appended. Print the reason. When the reason is NEEDS YOU, print the NEEDS YOU block (author, path:line, excerpt) exactly as/session-briefwould. A loop stopped with reasoncheckpoint: fresh sessioncontinues only from a different session: a fire whoseSB.session.transcriptdiffers from the record'sstop_transcriptreopens it (step 2) with its iterations,prs_openedand budgets intact, while a fire from the same session reports it checkpointed and takes no action. A loop stopped for any other reason stays stopped: the next fire's step 2 reports it and takes no action.--restartbegins a fresh record in either case.
Work source, by case:
- The current branch has a PR →
SB.pr. - The ref is a PR number (step 2's normalised
#<n>thatgh pr viewresolved) →gh pr view <n> --repo <nwo> --json headRefNamegives the branch; enter the worktree/work-issueStep 3's worktree lookup returns for it (ait_worktree_for_branch <branch>: whichever directory under.claude/worktrees/has the branch checked out) when there is one, else operate from the primary checkout, and collectSBthere. - The ref is an issue ref → derive its branch with
/work-issueStep 3's naming, thengh pr list --repo <nwo> --head <branch>finds the PR; enter that branch's worktree as above.
gh must have answered before the table is read. Whenever SB.repo.gh_ok is false or SB.errors[] names a failed gh step (for example gh api user failed (auth?), gh pr view failed, gh graphql review threads failed), the iteration's action is wait (hint: 5m), recorded with --noop, regardless of SB.pr, SB.ci or SB.review: the table's inputs are then untrustworthy (with no viewer, no thread is marked awaiting_you, so an open change request would be invisible to the merge rows). A gh outage that never clears still ends the loop through idle_stop_after. The table below is consulted only when the collector reports no gh errors; only then does a null SB.pr mean the branch has no PR (see Failure modes).
Before the table, classify every SB.review.threads[] with awaiting_you == true as code (a concrete, actionable change request: rename, split, add a test, handle a case) or judgement (a question, a design objection, or anything a reasonable engineer would want the author to answer in prose).
Also before the table, when pr.state is OPEN, read the merge-readiness fields and attach them to pr: gh pr view <pr.number> --repo <nwo> --json headRefOid,mergeStateStatus,reviews. The collector does not carry them, and the BEHIND row and the merge rows cannot be decided without them. This read is the command's own, not a collector step in SB.errors: if it fails, leave the fields absent rather than waiting out the iteration. The PR is then not review-clear this iteration, every other row still applies, and the iteration's detail says merge readiness could not be read.
| Observation (first match wins) | Action |
|---|---|
pr.state is MERGED or CLOSED |
stop: done — when pr.state == MERGED and the record's ref is an issue ref (or SB.ticket.key resolves one), the stop action is /work-issue <ref> --finish; a failure there is a WARN in the stop line, never a reason to keep looping |
pr.mergeable == "CONFLICTING" |
rebase onto git.base, resolve, push |
pr.mergeStateStatus == "BEHIND", pr.reviewDecision is empty ("") and the PR is not a draft |
update-branch: gh pr update-branch <pr.number> --repo <nwo> (its default, a merge of the base into the PR branch made on the server; never --rebase, which would need the force-push the safety rails forbid), then git pull --ff-only in the PR's worktree. Where that command is unavailable: git fetch, git merge origin/<git.base> and a plain push. GitHub reports BEHIND only where the base branch requires an up-to-date head, so the PR cannot merge until it is updated, and a BEHIND PR has no conflict to resolve. A PR that is approved or waiting on a reviewer is left alone: an update there can dismiss the approval or churn CI under the reviewer. On a base that keeps moving this row can fire again after every CI run; max_iterations and max_hours bound it |
ci.conclusion == "failure" |
fix-ci: superpowers:systematic-debugging on ci.failed_jobs, superpowers:test-driven-development for the fix, push |
an awaiting thread classified code |
address-review: make the change, push, reply on the thread naming the commit SHA, resolve the thread |
an awaiting thread classified judgement |
stop: needs-you — quote author, path:line, excerpt |
the PR is review-clear (defined below) and the effective --merge |
merge: gh pr merge --<merge_method> --match-head-commit <pr.headRefOid> --auto (merge_method from the effective config, default squash; falls back to a direct merge with the same method and pin only where auto-merge is unavailable; never --delete-branch). A direct merge lands immediately: run /work-issue <ref> --finish and stop: done. An armed auto-merge lands when the checks pass: record the action and keep iterating (wait-ci while checks run), so the first row observes pr.state == MERGED and runs --finish at its stop |
the PR is review-clear, no effective --merge |
stop: ready-to-merge — the operator's call |
ci.status is queued, in_progress, requested, waiting or pending, or a ci.all_workflows entry on the PR head has one of those statuses |
wait-ci (hint: CI in progress) — recorded without --noop; does not count toward idle_stop_after |
| anything else | wait (hint: idle, see Pacing hint) — recorded with --noop; counts toward idle_stop_after |
Review-clear means the merge-readiness fields were read (pr.headRefOid is set), the PR is not a draft (pr.isDraft is false), and one of:
- Approved:
pr.reviewDecision == "APPROVED". - No review required, and green on its head. All of:
pr.reviewDecisionis present and empty (""). GitHub returns that when the base branch requires no review, so nobody will ever approve the PR. A null or absent decision is not empty; do not coerce one into"".- no reviewer's standing verdict in
pr.reviewsisCHANGES_REQUESTED. A reviewer's standing verdict is their newest review (bysubmittedAt) whose state isAPPROVED,CHANGES_REQUESTEDorDISMISSED; a laterCOMMENTEDreview, which every thread reply creates, does not withdraw a change request. Without required reviews the decision can stay empty after someone requests changes, and a review with only a top-level body opens no thread for the rows above to catch. pr.mergeStateStatusisCLEAN(orHAS_HOOKS). That is GitHub's own verdict for the current head: no conflict, not blocked or behind, and every check on it passing, including workflows and checks the collector does not look at.- the runs the collector saw on the PR head are finished and one is green. The runs on the head are
ciitself and the entries ofci.all_workflowswhoseshapr.headRefOidstarts with. At least one hasconclusion == "success", and none has astatusother thancompleted. That ties the green to the commit that would merge, not to an earlier push. Any workflow counts, because a path-filtered primary workflow does not run on every push;CLEANabove already rules out a failing check, and the "none still running" half covers a workflow whose checks GitHub has not registered yet. A head no workflow succeeded on is not green.
On the no-review branch green checks stand in for the approval, which is why it asks for more than the approved branch does. A PR that misses a condition falls through: to wait-ci while CI is running, otherwise to wait. Babysit therefore never merges a PR on a base branch that has neither required reviews nor CI; merge that by hand, or through /work-issue --merge, which verifies locally before it merges.
REVIEW_REQUIRED and CHANGES_REQUESTED are never review-clear, and neither is a draft, with or without --merge.
Replies to humans are always code-backed: a pushed commit plus a comment naming it. The loop never argues a review point in prose; that is a NEEDS YOU.
Work source: /resume-initiative <epic-ref>'s next-up derivation (commands/resume-initiative.md "Deriving child state" and "Tree traversal"), reused as written — depth cap, cycle guard, and legacy branch included.
| Observation (first match wins) | Action |
|---|---|
| no open leaf | stop: initiative clear |
the next leaf carries the needs_design_label, or its body fails the agent-prompt bail criteria (skills/feature-request/SKILL.md) |
skip (bookkeeping, not this iteration's action — see step 5): upsert_comment on the leaf with marker <!-- tracker-loop:skip --> and a body naming the gap, LR append … skip, move to the next open leaf; three consecutive skips stop: stop: three skips |
| the next leaf already has an open PR | run one babysit iteration against it (enter its worktree; table above) instead of starting a new leaf |
| the next leaf is workable | start: /work-issue <leaf> --start with the effective --draft / --merge passed through; LR add-pr <id> <pr-ref> when it opens a PR. That PR is this loop's babysit target on later iterations |
The skip comment goes through upsert_comment, so it is idempotent: a later iteration that derives the same leaf as next-up again replaces that one marker comment instead of adding another.
Skipping may cascade within one iteration — the skip row moves to the next open leaf without ending the iteration — but at most one start may follow a run of skips in the same iteration, once a workable (or already-open-PR) leaf is found; that start (or babysit action) is the iteration's one action. Each skip is its own LR append … skip entry, and step 3's LR check does not count skip entries toward max_iterations.
The checkpoint after each leaf is the reason this mode exists: a long clearing run compacts or hands off instead of degrading.
Work source: list_open_issues({label: <poll_label>}) through the configured backend.
Claimed issues are skipped. An issue is claimed when any of:
- a worktree for its ref exists (the branch
/work-issueStep 3's naming derives is checked out in any worktree: abranch refs/heads/<branch>line ingit worktree list --porcelain, with no.claude/worktrees/gate, since a branch checked out anywhere is a claim; or aworktrees[]entry intracker-brief-collect.shoutput whoserefmatches), - an open PR in this repo references it (
gh pr list --repo <nwo> --state open --search "<ref>"), - another live loop record names it (
LR list): itsrefequals the issue ref, or one of itsprs_openedPRs has the issue ref in its body (gh pr view <n> --repo <nwo> --json body), - it carries
loops.claim_label, when that key is set.
Per iteration (at most one mutating action — see step 5):
- If this record's
prs_openedhas any still-open PR, babysit only the oldest one, entering its worktree (table above). A babysit stop reason ofdonedrops that PR from consideration;needs-youstops the whole loop. - A new issue may be dispatched in this same iteration only when step 1 found no open PR, or that babysit iteration took no mutating action of its own: its outcome was
wait,wait-ciorstop: done. A mutating action (rebase, update-branch, fix-ci, address-review, merge) orneeds-youpermits no dispatch. If fewer thanmax_concurrent(default 1) of this record's PRs are open, take the oldest unclaimed issue (the lowest issue number on GitHub; elsewhere the earliestcreatedwhenlist_open_issuesreturns it, else the backend's listing order), applyclaim_labelviaadd_labelwhen configured, and dispatch/work-issue <ref> --start. The PR mode: an effective--mergeon the loop wins overloops.pr_modeand is passed through as--merge; otherwise an effective--draftpasses--draft; otherwiseloops.pr_modedecides (draft, the default, passes--draft;readypasses neither).LR add-pr <id> <pr-ref>once the PR exists. - Nothing to do → wait (hint:
loops.interval).
No remove_label operation exists in the contract, so a claim_label stays on the issue until a human removes it or the issue closes. Two machines polling the same label without a claim_label can collide; the local claim signals do not cross machines.
A loop fired by Windows Task Scheduler (--cron-id schtasks:<TaskName>, recorded as the record's cron_job_id) runs for weeks, one fresh claude -p session per fire. Session budgets would end it within hours while every fire exits green, so a schtasks: record counts its budgets per window instead. The scheduler, not this command, decides when the next fire comes; the pacing hint is informational.
- Windows.
budget.max_hourslong, back to back from the record'sstarted.max_iterationscounts the window's acting entries: an action other thanwait,wait-ciorskip, not a noop. When they are spent,LR checkreturnsok: false, recurring: true, reason: "window: max_iterations"and the window's later fires do nothing (step 3) until the next window.max_hoursis the window length and never stops the loop;idle_stop_afternever stops it either, because idle is a scheduled loop's normal state and the scheduler pays for the fire whatever happens (LR checkstill reportstrailing_noops).LR appendkeeps the current and the previous window's entries only. - Load or create (step 2). One call,
LR claim <mode> <ref> <branch> --cron-id <cron-id> [--restart] [--merge] [--draft] --max-iterations … --max-hours … --idle-stop-after … --interval …with the configured budgets, decides; read itsaction:use/create/reopen→ continue with itsid.useis the live record this task owns;reopenis this task's owncheckpoint:record, reopened with the cron id restored (every fire is a fresh session);createis a fresh record carrying the cron id, as--restartwould make.--restartis implicit apart from the pause below.refuse→ print itsmessage, then itsline(loop <id> window skipped) as the last line, and end the fire without acting. It refuses when a live loop of the same mode and ref is driven by anything else and is still alive (an interactive/loopor a session cron in a checkout that shares the project key,messageloop <id> is owned by …; not acting): that loop is never adopted, so it keeps its own budgets exactly as before. Such a loop counts as abandoned, andclaimstops it and goes on to create, when its own nextLR checkwould stop it anyway (itsmax_iterations,max_hoursoridle_stop_after, in that order; the stop reason is the samebudget: …), or when nothing has iterated it for four of its pacing steps (itsoptions.interval, at least 30 minutes, the slowest idle hint a session loop gets; reasonorphaned: no iteration in <n> min): a closed or Esc'd/loop, or the cron-less record a 1.12.0-erapoll --restartfire left live. Both refusal messages startloop <id> is owned byorloop <id> is stopped, which keel'skeel runrecords as a skipped run. It also refuses when this task's newest record was stopped with reasonoperator stop(an operator paused the scheduled loop, seestop):loop <id> is stopped (operator stop); pass --restart to begin a new loop.- A stop of another driver's record never pauses the task; only a record whose
cron_job_idis this task's is reopened or paused on.
- Checkpoint (step 6). Each fire is its own session, so the verdict is almost always
keep going; when it is not, the checkpoint stop and the next fire's reopen above carry the loop on. - Stop (step 8). A mode's stop row (
done,needs-you,initiative clear, …) stops the record as usual and never callsCronDelete; the next fire starts a fresh record. That is how aneeds-youPR is left to the operator while the poll carries on with other issues: the PR stays open and claimed, and the fresh record'sprs_openeddoes not hold it. - Window line. Every fire ends with a window line as its last output line:
LR window <id>'slineafter step 7, and on a stop pathLR window <id>run beforeLR stop(a record that is no longer live always reportsskipped); a fireLR claimrefused prints thelineit returned.loop <id> window okmeans an acting entry was appended in this fire,loop <id> window skippedthat nothing acted.
To pause a scheduled loop without touching Task Scheduler, /tracker-loop stop <id> (reason operator stop); to resume it, run the task's own prompt once by hand with --restart added; the pause holds until then. To end it for good, unregister the task (keel tasks uninstall, or Task Scheduler itself).
When the keel CLI is on PATH, LR reports to it through keel's local spool (keel … --spool, never a network call): loop.created on create, loop.iteration for each non-noop entry, loop.stopped with the reason on stop, and a loop:<id> heartbeat (payload cron_id, mode, ref) on create, on each check of a live loop and on reopen. The project is the slug in the repo's .keel/project.yaml. Without keel, or with AIT_KEEL=0, nothing is reported and nothing else changes.
The last line of every iteration. A self-paced /loop follows it; a fixed-interval loop ignores it.
| State | Hint |
|---|---|
| CI in progress | the duration of that workflow's last completed run, from one call: gh run list --repo <nwo> --workflow <name> --branch <branch> --status completed --limit 1 --json databaseId,startedAt,updatedAt (updatedAt − startedAt), floor 3m, cap 30m |
| a fix was just pushed | 5m — CI is about to start |
gh could not answer (gh_ok false or a gh entry in errors[]) |
5m |
| waiting on a reviewer | 30m |
idle (babysit wait: nothing to act on) |
30m, as waiting on a reviewer |
| poll found nothing | loops.interval |
| clear just started a leaf | none — the leaf's pipeline ran inline in this turn; next hint is 5m |
| stopped | none — say stopped |
status:LR list, printed one line per live loop (id · mode ref · iteration n · last action · cron armed|none), followed by the last three stopped records with their reasons.<state-dir>isait_state_dir "$PWD"from"${CLAUDE_PLUGIN_ROOT}/scripts/lib/common.sh"(${XDG_CACHE_HOME:-~/.cache}/agent-issue-tracker/<project-key>/); list<state-dir>/loops/*.jsonandLR geteach stopped one.stop [<id>]: with an id,LR stop <id> "operator stop"andCronDeleteitscron_job_idif set and not aschtasks:id. A scheduled loop stopped this way stays paused (Recurring mode): say so, and name its task. Without an id and exactly one live loop, stop that one; with several, list them and ask which.
An unattended loop commits while nobody is at the keyboard, so on a machine that signs commits it needs a signer that never prompts. A 1Password desktop signer (op-ssh-sign) fails while the app is locked, and the iteration ends with its work staged and uncommitted. The documented answer is scripts/git-sign.sh as gpg.ssh.program: it tries op-ssh-sign first and falls back to a dedicated agent key read through the 1Password Automation service account (setup in the script's header). /tracker-doctor Phase 4 warns when it is missing. Never bypass signing to get a loop past a commit.
- Never merge without
--merge; never open a ready PR on red (/work-issueStep 5 already refuses); never force-push. - Never delete a remote branch; GitHub's
deleteBranchOnMergesetting owns that. - At most one mutating action per iteration (step 5's definition; poll and clear's controlled exceptions are spelled out in their tables); a NEEDS YOU always stops the loop over continuing.
- Every tracker write is a contract op (
backends/_interface.md):add_labelfor the claim label,upsert_commentfor the skip comment (marker<!-- tracker-loop:skip -->). Every git-host write is one/work-issuealready documents. - Budgets are enforced from the record on disk (
LR check), before acting. /tracker-loop stop,CronDelete, andEscon a/loopall end a loop; the record says which when it wasstop. A scheduled loop is ended by unregistering its task;stoppauses it.- Never
CronDeleteaschtasks:id: it is not a session cron.
LR find/createcannot write the state dir → report the path and stop; nothing else runs.- gh could not answer in babysit (
SB.repo.gh_okfalse, orSB.errors[]names a failed gh step) → wait (hint: 5m) with--noop, whateverSB.pr,SB.ciandSB.reviewsay: neverstop: no PR, and never a merge, rebase, branch update or review action on inputs gh did not fully deliver. An auth or network blip must not end the loop, delete its cron, or merge over a thread it could not see. A gh outage that never clears ends throughidle_stop_after. SB.pris null in babysit and gh answered → no PR on this branch; stop with reasonno PRand print the/work-issueline that would open one.- The tracker is unreachable in clear/poll → the backend reports it; stop with the reason and point at
/tracker-doctor. Do not fall back togh issueor an MCP call. - A leaf is not workable (needs-design label, vague body) → that is the clear
skiprow, checked here before any dispatch:/work-issuedoes not refuse a leaf for scope and leaves no comment. The skip row's ownupsert_comment(marker<!-- tracker-loop:skip -->) is the record. - Iteration exceeds the session cron's interval (a full
/work-issuepipeline can) → the harness skips fires while the REPL is busy and does not catch up; nothing to do, the next fire picks up from the record.