pitwallDocs

    The loop

    Drive

    /pitwall:drive

    Start the loop: one task per round until the queue is empty or you stop it.

    What it does

    /pitwall:drive starts the loop: one /pitwall:lap after another, each scheduling the next, until the queue is empty or you stop it. Drive itself does no work; it checks the ground, writes the loop’s state and hands over to the first lap.

    Use it when

    • the queue is ready and its questions are answered
    • you are about to leave the machine for a while, or for the night

    Try it

    /pitwall:drive              start with the first pickable task
    /pitwall:drive P2-05        start with this task (it must be in the queue)

    While the loop runs, do not work in this checkout: it switches branches there.

    Before it starts

    Drive refuses to start, and says why, when:

    • the repo has no profile (/pitwall:init first)
    • the working tree has uncommitted changes (commit or stash them)
    • gh is not signed in, or the dependencies are not installed
    • the queue has no task it could pick: all blocked, or waiting for a merge (/pitwall:queue first, or answer the blocked questions)

    It starts, but warns you, when the browser in the profile does not connect (browser checks wait, and bug-fix tasks park) or the tracker’s tools are not connected (tasks are not logged).

    What you’ll see

    The example comes from a made-up repo, acme/shop.

    Loop started · 4 tasks in the queue
      Each round: pick from the queue → work → /pitwall:gauge → review → PR. No merges, no questions; stuck → park and move on.
      While it runs, don't work in this checkout.
      Stop with /pitwall:stop (after this task) or /pitwall:brake (now).

    Then one report per round, as on the lap page. A round you did not start yourself that opens a PR, parks a task or stops the loop also sends one push notification, when your setup has them. When the queue is empty, the loop checks back every 30 minutes for PRs that merged.

    Stop it

    • /pitwall:stop finishes the task in progress, then stops.
    • /pitwall:brake stops now and saves the work as a WIP commit; the next /pitwall:drive resumes it.
    The playbook the agent followsThe full spec for /pitwall:drive. This page sums it up; when the two differ, the playbook wins.

    /pitwall:drive — start the loop

    Arguments (optional): /pitwall:drive 2.6 = start with this task first (must be in the queue) · any other argument (e.g. a question) → answer it, don’t start the loop

    1. The profile has a “multi-machine” section → receive state per that section first (the other machine is still running → don’t start)
    2. Preconditions (any one fails → tell the user and don’t start):
      • .claude/agent-loop.md exists — missing → this repo has not set up the loop yet
      • git status --porcelain is empty — not empty → have them commit / stash first (the loop switches branches in this checkout)
      • gh auth status passes · dependencies installed (command in the profile)
      • state has at least one pickable task in queue (no blocked, waitFor merged or empty — lap.md section 2) — none → have them run /pitwall:queue first, or answer the blocked questions; a queue of blocked tasks only would wake every 30 minutes for nothing
      • the browser from the profile won’t connect (usually Claude in Chrome on the default browser) → can start, but B/C items become ⏳ case 3 of /pitwall:lap (PR is PARTIAL; bug-fix tasks will park)
      • profile tracker is set but its tools are not connected → can start, but tasks won’t be logged (/pitwall:ticket later) · queue items with source tracker are skipped
    3. Write state at the path in the profile (create the folder if missing; keep the existing queue, done, parked, parents):
      { "running": true, "stopRequested": false, "startedAt": "<ISO now>", "firstTask": "<arg if any>",
        "currentTask": null, "branch": null, "step": null, "taskStartedAt": null, "lintBaseline": null }
      existing state has currentTask (left over from /pitwall:brake) → keep currentTask / branch / step / stash → the first round will resume
    4. Tell the user in 3 lines (in the profile’s user language): the rules (pick from the queue → work → /pitwall:gauge → review → PR, no merge → next one, no questions along the way, stuck → park and move on) · while the loop runs, don’t work in this checkout · stop with /pitwall:stop or /pitwall:brake
    5. Call the Skill loop with args /pitwall:lap (self-paced; every later wakeup prompt is /loop /pitwall:lap, lap.md section 8) — /pitwall:lap does the first round right away, then schedules itself

    Never do the work in this skill itself — everything is in /pitwall:lap · permissions to set on the machine that runs the loop: the “permissions” section in the profile