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
Claude Code 'overnight' skill — autonomous all-night run: pre-flight GO/NO-GO gate, self-pacing loop with live usage-meter checks, one disposable subagent per task, morning report
Run a long, autonomous, all-night task plan unattended. Opens with an interactive pre-flight GO/NO-GO gate (vet the plan, set usage limits, acquire all credentials), then launches a self-pacing loop that respects the 5-hour session limit (pause/resume) and a weekly usage cap (hard stop), spawns one disposable subagent per task, verifies with spot-checks, and leaves a morning report. Use when the user says "overnight", "work on this all night", "run this while I sleep", "autonomous overnight run", "set up an overnight task", or invokes /overnight.
Overnight
Assign work the agent runs unattended for a whole night. The user is asleep — there is no one
to approve anything, and nothing can be re-authenticated at 3am. The whole design follows from that.
Two phases, always in order:
Phase A — Pre-flight gate (you are awake; interactive). A hard GO/NO-GO that vets the task
plan, sets the usage limits, acquires every credential, and confirms the sandbox. Nothing
launches until every check is green. → PREFLIGHT.md
Phase B — The loop (you are asleep; unattended). A heartbeat wakes a lean coordinator; each
wake it checks the live usage meters with scripts/usage.sh (one tokenless HTTP call to
Anthropic's own usage endpoint), works only when there is headroom, dispatches one disposable
subagent per task, verifies with spot-checks, commits/pushes, and defers anything needing approval
to a morning queue. → LOOP.md
Core invariants — never violate
Mandate — don't idle credit, stay on-goal. Spend the budget on reasonably useful,
sandbox-admissible work that advances the run's goal. While budget remains under the weekly cap, keep
finding and doing useful on-goal work — not random high-priority tickets unrelated to the
objective. A finished plan, an empty issue query, a missing label, or a tracker/tool being
unavailable are sourcing details, not stop reasons — switch source, or save the work locally
and continue.
THE RULE IS ABSOLUTE: if ANY genuine remaining work exists and weekly < cap, you MUST continue —
immediately, to the next item. Presenting a status and waiting for direction, offering "which
should I do next?", or ending your turn with a question while work + budget remain is itself a
forbidden stop. Do not report-and-wait; pick the next on-goal item and do it. If you can name
genuine remaining work (you just did, in a "remaining work" list), that is proof you must keep going —
naming it and stopping is the exact failure. The only stops: weekly cap, usage-probe stall, or
zero remaining work after obtaining every resource / deciding every fork (stated trail).
The failure modes this skill prevents: (1) stopping early with budget left; (2) drifting off-goal;
(3) report-and-wait when you could just continue; (4) calling work "deploy-gated / verify in the
morning" when a git push already triggers the sanctioned CI/CD staging deploy — push, wait for
green, and verify against staging (only a local-only prod deploy is a real wall); (5) asking "should
I run the real E2E?" (or leaving it "for you in the morning") instead of just running it — a check that
could fail is work to RUN, not a question to ask; passing unit tests are not a verified integration,
and any setup it needs (combine branches, deploy, force a flag) is part of running it. (See
LOOP.md §Keep working / §Stop.)
No mid-task approval. A decision is NEVER a stop. When you hit any choice — reversible or
critical (architecture, security, token-custody, where code lives) — you do exactly one of: pick
one (adopt your own best call / recommendation, log the rationale, and keep building on it), or
try all (build each viable option on a worktree branch, cap 2, budget permitting, keep
building on each). You then continue — the human reviews finished PRs/branches in the morning
and can override. NeverAskUserQuestion mid-run, never wait for sign-off, never park a
decision in the morning queue as a blocker. "Blocked on a decision" is a contradiction — decide it.
Respect the 5-hour session limit (pause/resume). Stop dispatching new subagents at the
configured per-session stop %; re-arm the heartbeat to the window's reset time and sleep through
it (one usage check, no polling), then resume.
Respect the weekly cap (hard stop). When the live weekly meter reaches the configured cap,
terminate unconditionally. Checked before every dispatch.
Front-load ALL access up front — for the whole GOAL, not just task 1. The pre-flight gate must
anticipate that the run keeps working past the initial plan (invariant: don't-idle), so enumerate
every credential / repo / live-access the goal could need, discover what's already on the
machine (.env*/config tokens, gh auth, forge/wrangler creds, Playwright logged-in
profiles, ability to gh repo create), and confirm the whole set WITH the user at the start.
Mid-run you then use and create freely from that confirmed surface — read the .env token,
gh repo create, drive a live site via a logged-in profile — and never stop to ask for access
you could find or make. "Self-grant" you must avoid means new external grants the user never
authorized (prod, a new cloud account), not using the project's own existing credentials. A
resource that is genuinely absent everywhere is a NO-GO at pre-flight, surfaced then — never
discovered as a mid-run stop.
Stay in the sandbox. Allowed unattended: edit/test/commit, push branches, open/update PRs,
submit-branch → babysit CI to green. Forbidden: production deploy, local→staging deploy,
auto-merge to main (unless explicitly opted in for the run), secrets commands. Out-of-sandbox
work is deferred to the morning queue, never executed.
Quick start
You (awake): /overnight <task, or "pull ready-for-agent issues">
→ Phase A runs the gate WITH you: writes NIGHT-PLAN.md, sets limits,
captures auth, confirms sandbox, prints GO or the red items.
→ On GO it arms the watcher and the loop starts. You go to sleep.
You (awake): read ~/.overnight-runs/<repo>/<run-id>/MORNING-REPORT.md (a push wakes you at stop).
Usage is read by scripts/usage.sh — one HTTP call to api.anthropic.com/api/oauth/usage (the
endpoint Claude Code's own /usage panel uses) with the OAuth token already in the keychain. No
browser, no model tokens, ~1s, fail-closed. See PREFLIGHT.md §Limits and
LOOP.md §Usage check.
State (everything the loop knows lives on disk)
~/.overnight-runs/<repo>/<run-id>/ — NIGHT-PLAN.md, journal.md, state.json,
DECISIONS-FOR-MORNING.md, MORNING-REPORT.md, evidence/. The coordinator re-grounds from
state.json on every wake, so a lost/compacted session always recovers. → templates in
templates/.
Project defaults
Defaults target conf-app conventions (submit-branch, babysit-pr, spot-check, lite-dev). The
issue tracker is Multica (multica issue list --project <project-id> = ""); GitHub
ready-for-agent is an optional secondary source. Labels are a sourcing hint, never a gate —
never stop because a label/query didn't match; switch source (read Multica, or add items to it) and
keep working. For another repo, the pre-flight gate re-confirms the equivalents.
Interactive, while the user is awake. Mandatory. Run every check. Any RED → do NOT
launch; fix it interactively, then re-check. Never launch degraded — there is no recovery at 3am.
Create the run dir first: RUN_DIR=~/.overnight-runs/<repo>/<YYYY-MM-DD-HHMM> and copy the
templates/ into it.
A · Task contract → NIGHT-PLAN.md
The loop only works on tasks that are already well-specified. Force that here.
Build an ordered task list. Seed it from the user's prompt and/or by pulling
ready-for-agent issues (gh issue list --label ready-for-agent), but vet each one.
For every task write acceptance criteria in spot-check format — each criterion names
behavior · observable signal · method and is independently pass/fail-checkable. Split into:
auto-verifiable (build/tests/grep), real-world spot-check (needs captured evidence), and
cannot-verify-unattended (→ pre-marked for the morning queue). See
templates/NIGHT-PLAN.md.
Set each task's ceiling (default pr = submit-branch + babysit to green; opt in to
staging/merge only with explicit user say-so).
A task with no writable acceptance criteria is not admitted — flag it to the user, don't guess.
B · Limits (live-read, not assumed)
Reader = scripts/usage.sh (HTTP api/oauth/usage, tokenless, no browser). Run it here and
show the user the live session %, weekly All-models % and reset times. Exit 0 + ok:true
is a GO precondition — if it fail-closes,
fix it now (no-credentials → is the keychain readable from this shell? token-expired-or-revoked
→ re-login) rather than discovering it at 3am.
Fallbacks, only if the probe can't be made to work: statusLine rate_limits passthrough, or the
Playwright MCP scrape of claude.ai/settings/usage. See LOOP.md §Fallback readers.
Set, into state.json:
session_stop_pct — stop dispatching at this session % (default 80; lower it if a single
task can burn >~15% of a window, so one in-flight subagent can't blow past 100%).
weekly_cap_pct — hard terminate at this weekly All-models % (weeklyAll). Show current
weekly % so the user sets a meaningful ceiling above it (not the illustrative "20%" if they're
already higher).
weekly_start_pct — the current weekly reading, for the morning report's start→end delta.
C · Access — front-load the WHOLE GOAL, DISCOVER not just check
Scope to the goal, not task 1. The run keeps working past the initial plan (don't-idle), so vet
access for everything the goal could plausibly need — including likely follow-on work: repos to
push/create, live sites to verify against, tokens for integration tests. Discovering a "need X"
mid-run is a pre-flight failure. And DISCOVER credentials (go find them), don't just check a
binary — most are already on the machine.
gh auth status; can you gh repo create? (you'll likely need new repos)
usage check (always)
scripts/usage.sh returns exit 0 / ok:true (reads the Claude Code OAuth token from the keychain)
Atlassian token (for live Confluence read/write tests)
grep .env* / .dev.vars / wrangler.toml / git config / env — e.g. FORGE_API_TOKEN, ATLASSIAN_API_TOKEN. It's almost always already there.
live Confluence/site verification
a logged-in Playwright profile / storageState for the site (same mechanism as the usage probe)
Forge / Cloudflare-D1 (if in scope)
forge whoami / wrangler whoami
any MCP the goal uses
reachable now (cheap read)
Confirm the full set WITH the user, here, at the start — which site/tenant + token to use for
live tests, whether to create repos and under which org, any scope limits. Get every confirmation the
run could need now, so the loop never pauses to ask later. A resource genuinely absent everywhere
= NO-GO surfaced now (the user provides it before launch), never a mid-run stop.
D · Environment
caffeinate -dimsu running (Mac stays awake) — the loop is local-only; closing the lid stops it.
The launching terminal stays open for the night.
Clean working tree on a known base branch; room for git worktrees (critical-fork branches).
--dangerously-skip-permissions accepted for the loop's claude invocations (zero prompts).
E · GO / NO-GO
Print a checklist with ✅/❌ per item above. Any ❌ → NO-GO, name the blocker, stop.
On all green → GO: write state.json, arm the watcher (see LOOP.md §Arming), confirm
to the user the interval, thresholds, task count, and where the morning report will be — then they sleep.
Three pieces: a heartbeat (wakes the coordinator), a lean coordinator (checks usage + decides
what), and disposable task subagents (do the work). All local; the user is asleep.
Usage check — scripts/usage.sh (HTTP, default)
One Bash call. No browser, no model tokens, ~1s:
~/.claude/skills/overnight/scripts/usage.sh
→ {"ok":true,"session":2,"weeklyAll":33,"weeklyScoped":[{"model":"Fable","percent":37,…}],
"sessionResets":"Resets in 4h 55m","sessionResetsAt":"2026-07-25T13:00:00Z",…}
It hits GET https://api.anthropic.com/api/oauth/usage — the same endpoint Claude Code's own
/usage panel calls — with the OAuth token already in the macOS keychain (~/.claude/.credentials.json
on Linux). Read-only: it never refreshes or writes the credential, because a refresh_token grant
rotates the token and would break the running CLI. The live session keeps that token fresh by itself,
which is exactly the overnight case. Endpoint is undocumented → the script fail-closes if the
shape changes rather than guessing.
This replaced the Playwright meter-scrape (2026-07-25). The browser path is a fallback only —
see §Fallback readers.
Decision (before dispatching any subagent):
weeklyAll ≥ weekly_cap_pct → write MORNING-REPORT.md, push notification, terminate.
All-models is the gate. weeklyScoped (the per-model weekly meters, e.g. Fable 37% vs all-models
33%) is reported for the morning write-up only — never gate on it.
session ≥ session_stop_pct → set the next heartbeat to sessionResetsAt + 2 min,
update state.json, end the turn without working (one check, no polling through the wait —
this is how the 5-hour wall is crossed cheaply).
exit code ≠ 0 / ok:false → fail-closed: pause, push an alert, do not assume headroom.
reason says which: no-credentials, token-expired-or-revoked, rate-limited-probe,
unexpected-shape, http-*, network-error.
otherwise → headroom exists; do one work cycle below, then let the heartbeat wake you again.
Because it is tokenless, the once-per-wake discipline is no longer a cost constraint — but still
don't poll tighter than the heartbeat. Measured 2026-07-25: ~15 calls inside a minute earns a
429 with retry-after: 41, and the bucket needs ~2 min of quiet to refill. The script honours
retry-after for one retry (giving up past OVERNIGHT_USAGE_MAX_WAIT, default 120s) and then
fail-closes as rate-limited-probe. A 30-min heartbeat is nowhere near the limit.
Heartbeat (the /loop sleeper)
A plain background sleeper provides the wake cadence — it burns no model tokens by itself, and
with the HTTP probe the usage check is free too, so the only token cost is the work. Arm it once via
/loop (monitored background sleep <interval>; echo TICK with notify_on_output). Default
interval 30 min; after a session-stop, re-arm a single long sleep to sessionResetsAt instead.
watch.sh still gates wakes entirely in the background shell (sentinels
^OVERNIGHT_(WAKE|TERMINATE|STALL)); point it at usage.sh. Env: OVERNIGHT_SESSION_STOP,
OVERNIGHT_WEEKLY_CAP, OVERNIGHT_RUN_DIR.
Fallback readers (only if usage.sh fail-closes)
statusLine passthrough — zero cost, no token handling. Claude Code feeds every statusLine
command a JSON stdin containing rate_limits.{five_hour,seven_day}.{used_percentage,resets_at}
(header-derived, so present only after the session's first API call, and no per-model breakdown).
A statusLine script can tee that to a file, which any watcher then reads. Useful when the
keychain is unreadable but a session is live.
Playwright MCP scrape of claude.ai/settings/usage — browser_navigate, then
browser_evaluate over [role=progressbar]aria-valuenow (→ [session, weeklyAll, …], plus
the "Resets in …" texts). Costs a model turn. Needs the MCP browser logged into claude.ai all
night. Don't build a standalone scripted-Chrome probe instead: claude.ai is Cloudflare-
protected, and a borrowed cf_clearance is fingerprint-bound and degrades within minutes — that
approach was tried, shipped, and deleted 2026-07-25 in favour of usage.sh.
Coordinator — runs on each heartbeat wake
Keep your own context lean: hold only pointers + status; push all heavy work into subagents so
their file-dumps and exploration die with them. Each wake:
Re-ground from state.json + NIGHT-PLAN.md (never trust in-session memory — it may have
been compacted). Pick current_task (first not done/blocked).
Check usage before dispatching — run scripts/usage.sh (§Usage check). Apply its decision:
weekly cap → terminate; session stop → re-arm the heartbeat to sessionResetsAt and end the turn;
ok:false → fail-closed. You cannot interrupt a running subagent, so this gate is always before
dispatch, never during.
Dispatch one subagent for the current task (chunk large tasks into multiple small dispatches
so no single one can swing the meter far). Give it: the task, its acceptance criteria, the
sandbox rules, and "return a compact result + evidence file paths, not a narrative."
Verify — the subagent must run spot-checks for real-world criteria and capture evidence
into evidence/. A UI/real-world criterion is PASS only with evidence (screenshot / snapshot
/ network intercept / Mixpanel row / D1 row); otherwise SKIPPED with its blocker — never a
silent PASS (project hard rule).
Record — append journal.md (actions, decisions + rationale, spot-check results), update
state.json (task status, evidence links), git commit + push the branch, submit-branch to
open/update the PR and babysit CI to green.
Resolve the task: all criteria PASS-with-evidence → done. Any criterion only SKIPPABLE
(structural blocker, needs prod/human) → done-with-caveats: move the item to
DECISIONS-FOR-MORNING.md with its blocker and advance. Retry a flaky spot-check up to 2×
before declaring it blocked. Never stall the night on something it structurally cannot finish.
Loop to the next task. When NIGHT-PLAN.md is exhausted, do not end — go to §Keep
working and find the next useful, admissible item. Only end at a true stop reason (§Stop) or a
session-pause. "Plan done" is never, by itself, a reason to end with budget left.
Sandbox (enforced every dispatch)
Allowed unattended: edit/test/lint/build, commit to feature branches, push branches, open/update
PRs, submit-branch + babysit-pr to green. Forbidden: production deploy; local→staging
deploy (staging only ever via CI/CD on push/merge); auto-merge to main unless the run opted
in; secrets commands. Anything outside → write it to DECISIONS-FOR-MORNING.md and move on.
Never self-grant access the pre-flight gate didn't bless.
Decisions & forks — NEVER a stop (req 1)
Hitting a decision is never a reason to stop, ask the human, or idle. You are the decider. Two
moves only — pick one, or try all — and then keep building:
Pick one — the default. Reversible choice, OR a fork where analysis/a spike yields a clear
winner (even a security/architecture call like token-custody once you've reasoned it through):
adopt your own recommendation, log the rationale in journal.md, and continue building on
it. A recommendation is your decision to act on, NOT a request for human sign-off. The human
reviews/overrides in the morning via the PR — the loop never waits.
Try all — only when a fork is genuinely 50/50 AND hard-to-reverse (schema / public API /
data-model) and budget covers it: build each viable option (cap 2) on parallel git
worktrees as separate draft PRs, keep building on each, and surface both in the morning
report for the human to pick from finished work — still no blocking. Budget tight → fall back to
pick one (your best call), not stop.
Forbidden: stopping at a decision, AskUserQuestion mid-run, or parking a decision in
DECISIONS-FOR-MORNING.md as a blocker. The morning queue is for work that is genuinely
impossible to do or decide unattended — needs prod, a new external credential, or an
external-party approval — never for a design/architecture/security choice you can reason out or
branch. "Blocked on a decision" is a contradiction: decide it.
The run's goal may span repos in the same workspace (e.g. an agent-side MCP package next to
conf-app). A different directory you already have git access to is not "new access" (invariant 4
is about new external auth/scope) — keep working there if it serves the goal.
Keep working — exhaust useful work, don't stop on technicalities
The mandate: while budget remains and there is reasonably useful, sandbox-admissible work that
advances THIS RUN'S GOAL, keep doing it. Idle credit is the failure. A NIGHT-PLAN.md finishing is
not a stop — it's a cue to find more on-goal work.
Stay on-goal — don't pull random issues. The run has an objective (the deliverable in
state.json / the NIGHT-PLAN theme). Refill work must advance that objective. An unrelated issue
is out of scope even if it's higher priority — leave it for its own run (note it in the report if
notable). "Keep working" never means "grab the tracker's top item"; it means "find the next thing that
moves this goal forward." When the plan is exhausted with headroom left, look in this order:
The run's own backlog / the tracker, filtered to the run's theme — label-agnostic. Pull open
work related to the goal from wherever the project tracks it. For conf-app that is Multica:
multica issue list --project <id> --status todo (project "" = <project-id>), then keep only
the items that serve the run's objective (e.g. for a "local-agent diagram integration" run, the
agent_*/MCP issues — not unrelated security/refactor tickets). GitHub ready-for-agent is one
optional source, not the gate. Labels are a hint, never a reason to stop — if there are
on-goal todo items you can write acceptance criteria for and they fit the sandbox, work them. If
the only gap is "no matching label" or "the GitHub query was empty," that is not a stop
reason — switch source (read the Multica board, or add the items to it) and continue on-goal.
Strengthen what this run produced — tests for a spike, fill a PRD's open questions, tighten a
doc, add the regression test an issue's AC implied. Reasonably useful + low-risk counts.
Adjacent low-risk improvements in the touched area that fit the sandbox.
Degrade, don't stop. If a tool you'd use to source or record work is unavailable — Multica
down, no network, an auth error, a CLI missing — that is never a stop reason. Persist locally
and continue: append to a local file (BACKLOG.local.md), do the next admissible useful thing,
note what couldn't be synced. Saving locally + continuing always beats terminating.
A missing RESOURCE is not a stop — OBTAIN it. Before ever deferring something as "needs X":
No repo / remote for the work?gh repo create it (the user's gh is already authed), or build
commit locally now and create the remote when ready. "There's no repo yet" is a thing to do, not
a wall.
Need a credential/token? It is almost always already on the machine — go find it: grep the
project's .env* / .dev.vars / wrangler.toml, git config, gh auth token, forge config,
~/.config, env vars. Use the existing project credential; do not stop and ask for what you can read.
Need to verify against a live web UI/API? Drive it with Playwright reusing a logged-in
profile — exactly how the usage probe works. A login wall you can cross with an existing session
is not a blocker.
Need to deploy something to verify it? Pushing a branch already triggers the project's CI/CD
staging deploy — that IS the sanctioned deploy path (only a local→staging deploy is forbidden).
So: push → wait for CI green → verify against staging (logged-in Playwright profile / PVT /
curl). "Needs a deploy to verify" is therefore almost never a stop — the deploy you need is the one
CI runs on your push, and you have creds (forge/wrangler/.env) + a live session to check the
result. A component CI doesn't yet deploy (a new Worker, a new function) → wire it into the CI path
(buildable work), don't defer verification to the morning. The ONLY real deploy wall is one that can
only be run locally against prod (or a staging target with genuinely no CI path). Writing code you
could have pushed-and-verified against staging and calling it "deploy-gated / verify in the morning"
is the premature-stop failure this rule exists to kill.
Only a credential that genuinely exists nowhere on the machine and cannot be created — and that
must have been surfaced at pre-flight (§C), not discovered mid-run — is a real deferral.
Admissibility still gates WHICH work, never WHETHER to continue. Self-vet each candidate: can you
write concrete acceptance criteria autonomously, and does it fit the already-authorized sandbox
(no new auth, no prod, no scope the gate didn't bless)? If a candidate needs unauthorized scope or is
underspecified → queue it to DECISIONS-FOR-MORNING.md and move to the next candidate — do not
treat one inadmissible item as "nothing left to do." Never self-grant access (invariant 4).
A check that COULD fail is work to RUN, not a question to ask. If you built something and there's
a real end-to-end verification that might reveal a bug — a live UI E2E, driving the actual flow, hitting
the deployed thing — run it. Passing unit tests are NOT a verified integration; the bugs live exactly
in the gap between "units pass" and "the real path works" (this is where a red CI, a CSP block, a
separate-iframe assumption, and a Durable-Object-binding bug each surfaced — every one only from
running the real thing). Ending a turn with "should I run the E2E / the real test now?" while you
could just run it is the report-and-wait failure — the fact that it could fail is the reason to
run it, not the reason to ask. Run it; report what it found (green, or the bug); fix or continue. And if
running it needs setup — combine two feature branches onto one deploy, push to trigger the staging
deploy, toggle a flag (or force it via a localStorage/URL override on a throwaway verification branch) —
that setup IS part of running it, not a reason to defer. The instinct "this might not work / might
be a big exercise" is the tell that you MUST run it.
Stop & morning report
Legitimate stop reasons — only these: (a) OVERNIGHT_TERMINATE (weekly cap hit); (b) an
unrecoverable OVERNIGHT_STALL (the usage probe can't read the budget — not any other tool
down); (c) you have actively searched the tracker + run-strengthening + adjacent work AND tried
to obtain every missing resource (created the repo, grepped .env*/config for the token, tried a
logged-in Playwright profile, pushed to trigger the CI staging deploy and verified against staging)
and every remaining candidate still genuinely needs a local-only prod deploy (a staging deploy
is reachable via CI-on-push and does not count as "needs prod"), a credential that exists nowhere
on the machine and cannot be created, or an external-party approval — and you
state exactly what you searched, where you looked for each credential, and why it's truly
impossible (a one-line "plan done" / "needs your token" is NOT acceptable — did you check .env?).
NOT stops (handle and keep going): plan finished; empty query / missing label; any non-usage tool
down (→ degrade to local); a pending decision or fork (→ pick one or try all, never ask); work
in another workspace repo (→ go work there); a missing repo (→ create it); a credential in
.env/config (→ read and use it); a live site behind login (→ Playwright logged-in profile);
work that "needs a deploy to verify" (→ push already triggers the CI/CD staging deploy — the
sanctioned path; then verify against staging via a logged-in Playwright profile / PVT / curl; only a
local-only prod deploy is a real wall — a new component CI doesn't yet deploy → wire it into CI);
report-and-wait — pausing to present a status or ask "which item next?" while genuine work +
budget remain (→ just pick the next on-goal item and continue; naming remaining work then stopping is
the failure). Session limit is a pause, never a stop. When you do stop, write MORNING-REPORT.md (landed PRs + criteria
PASSed with evidence, the DECISIONS-FOR-MORNING queue, critical-fork pairs, stop reason with the
search trail, weekly start%→end%), kill the watcher PID, fire onePushNotification (extra
push on a fail-closed stall). See templates/MORNING-REPORT.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 'OVERNIGHT_STALL {"prompt":"Usage probe failed (see watch.log for the reason field: no-credentials / token-expired-or-revoked / rate-limited-probe / unexpected-shape). Fail-closed: pause work, push an alert, and restore the usage read before resuming."}'
if [ "$WEEKLY" -ge "$OVERNIGHT_WEEKLY_CAP" ] 2>/dev/null; then
echo "OVERNIGHT_TERMINATE {\"weekly\":$WEEKLY,\"prompt\":\"Weekly cap reached ($WEEKLY% >= $OVERNIGHT_WEEKLY_CAP%). Write MORNING-REPORT.md, push the report notification, and stop the run.\"}"
break
elif [ "$SESSION" -lt "$OVERNIGHT_SESSION_STOP" ] 2>/dev/null; then
Ordered. The loop works top-down, then refills from ready-for-agent. Each task is admitted ONLY
if it has writable acceptance criteria below. A task with no checkable criteria is NOT admitted.
Ceilings: pr (default = submit-branch + babysit to green) · staging (push/merge → CI deploys) ·
merge (auto-merge to main — opt-in only). Production deploy is never a ceiling.
1. · ceiling: pr · source: <prompt | issue #NN>
Goal: <one line — what changes and why>
DONE only when every [ ] is PASS with evidence.
Auto-verifiable (every iteration)
pnpm test:unit green [vitest]
pnpm build:lite succeeds [vite]
[grep/typecheck]
Real-world spot-check (PASS needs captured evidence in evidence/)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters