Nighttime autonomous work loop while the human is ASLEEP and can't answer the chat. The agent takes ANY backlog task (not needing a human architectural decision), writes code, builds, tests on the harness, fixes, periodically commits and PUSHES, and self-restarts the loop. Stops ONLY when: (1) a wake time has arrived, (2) the human writes in the chat, (3) an insurmountable critical error. Invoked by the human ("run the night loop", "work overnight", "nightloop", "work until morning") and by t...
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Nightloop?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/mikalaikryvusha-nightloop-kaif)
---
name: nightloop
description: Nighttime autonomous work loop while the human is ASLEEP and can't answer the chat. The agent takes ANY backlog task (not needing a human architectural decision), writes code, builds, tests on the harness, fixes, periodically commits and PUSHES, and self-restarts the loop. Stops ONLY when: (1) a wake time has arrived, (2) the human writes in the chat, (3) an insurmountable critical error. Invoked by the human ("run the night loop", "work overnight", "nightloop", "work until morning") and by the agent when the human goes to sleep.
---
# /nightloop — autonomous work until morning
Night. The human is ASLEEP — no interaction, no one to ask. The machine is on, the harness is available.
The agent's job: **enter a self-directed loop and grind the backlog until morning**, setting itself
not-too-hard tasks, committing/pushing, and self-restarting the loop.
This is the night variant of `/autoloop`: same execution discipline, but with **hard stop conditions on
time and on the human appearing**, and **self-restart via `ScheduleWakeup`**.
## 🛑 STOP CONDITIONS (check at the START of each iteration)
Stop the loop ONLY if one of:
1. **It is ≥ the wake time** (default 09:00 local; set it when starting the loop). ⏰ Check the time
(`date "+%H:%M"`) PERIODICALLY — don't miss the wake hour. The human comes online in the morning.
Reaching the wake time means **START `/end-chat-soft`** — never a rushed stop and never an EARLY
finish out of deadline fear: work at your normal pace right up to the hour (`AGENT_GUIDE.md` →
Working until a named time). At the start of each iteration take the clock by a probe (`date '+%Y-%m-%d %H:%M %z'`), never by feel; before any closing
ceremony print `BOUNDARY: now <that probe> · named <the owner's time> · pool <empty | N items>` — the clock decides (origin issue #96).
2. **The human wrote in the chat — classify before you switch** (the drive-by rule, `AGENT_GUIDE.md`): a direct request →
exit, switch to them immediately; a **drive-by idea/bug not about the current task** → capture it
(`/propose-idea` / `/report-bug`, source: "tossed by the owner"), confirm in one line and
CONTINUE the night; vision-level → `/fix-vision`, then continue. A message delivered MID-TURN is the same word — the system signs its author (`AGENT_GUIDE.md` → "The owner's word mid-turn"): "stop" ends the loop in this turn; "switch" writes a `PARKED:` line in `STATUS.md` first.
3. **ONLY a truly critical error** that can't be worked around autonomously and makes continuing
impossible in principle. RARE.
❗ **Non-critical errors are NOT a stop condition — just keep working:** failed build (fix), flaky
connection (reconnect), software bug (file & fix or defer), hard task (take an easier one), crash
(investigate/fix). Working situations, not reasons to stop.
Until one fires — don't stop, don't wait for confirmations, work.
> ⛔ **"Context overflow / filling up", "turn exhausted", "tired", "risk of hitting the limit" are NOT
> stop conditions and NOT a reason to announce a pause or cut the turn short.** Context management is the
> harness's job (it summarizes and continues on its own). Do NOT assess how much context is left and do
> NOT end the turn yourself. Grind until morning — until a real stop condition above fires.
## 🔁 The cycle (one iteration)
1. **Check stop conditions** (above). If stop — go to "Finishing".
2. **Pick ANY backlog task.** Sources & priority as in `/dayloop` (finish started > bugs/polish > new ideas).
- Make technical/implementation decisions yourself.
- ONLY brand/UX/architecture-defining decisions — file an `/interview` + mark `STATUS.md`, take another task.
- Tasks needing human actions (real hardware, external accounts) — file homework in `homeworks/`.
3. **Do it**: code → build (`<BUILD_COMMAND>`) → deploy → test on the harness (`<TEST_HARNESS>`),
verify objectively. High-level harness commands first; if missing, do it low-level then ADD the command.
Execute the item by the fable loop (`/fable-method`; `/fable-loop` for substantive items) — its gates
and forced artifacts (`INTENT`/`AUTH`/`TWINS`/`PENDING`) apply inside the cycle too. A HEAVY item
with no plan yet → `/plan-epic` first (research → meta-plan), then execute phase by phase.
4. **Judge pass — MANDATORY before "done"**: run `/fable-judge` over the finished item — re-run the
claimed checks, diff what actually changed against the item's scope. REFUTED → back to work (step 3),
not to "done"; after 3 failed fix-judge cycles, record it honestly in `STATUS.md`/`bugs/` and take
another task.
5. **Document**: worklog in `plans/`, bug docs in `bugs/`, `STATUS.md` along the way; append the
approach-level lesson to `EXPERIENCE.md` after a meaningful success/failure (skill: `/experience`). Then say the knowledge line:
`KNOWLEDGE: <what the item taught about the project · the document it is written in>` or `KNOWLEDGE: nothing new` (2.10, epic MM).
6. **Commit and PUSH** (per `AGENT_GUIDE.md`): after each finished task or every ~20–30 minutes.
`<COMMIT_COMMAND>`. **The one-step rule:** one meaningful change = one full gate run = one commit —
no batch commits (a big diff can't be honestly reviewed; a judged failure rolls back one file, not a
night). `/fable-judge` pass before every push.
7. **Short chat report** (1–3 lines): so in the morning the human sees the progress.
8. **Self-restart**: if there's work left in the turn — just continue the next iteration in the same
turn; don't assess how much context is left and don't end the turn yourself (the harness does that).
`ScheduleWakeup` (same `/nightloop` input, short listen) is a *mechanical fallback* for when the
harness ITSELF ends the turn: then the cycle resumes in a new turn. Don't call it preemptively
"because context is filling up".
## ⚙️ Practice
- **Don't go interactive:** no questions to the human with waiting — they're asleep. Human-level
decisions (UX/brand/architecture) — defer with a note, don't decide alone.
- **Change safety:** small verified commits; if you break something, fix it or revert via git history.
- **⏰ Watch the time** (`date "+%H:%M"`) so you don't miss the wake hour (stop condition).
- **🔄 Periodically refresh context** — every few iterations call `/refresh-context`; the hour rule
applies (`AGENT_GUIDE.md` → Context refresh): >60 min since the last refresh, or a HEAVY item
next → refresh now, with the marker + quote witness.
- **🧹 Occasionally revise the backlog** — every few iterations call `/check-backlog`.
- **🐞 Hit a bug** you won't fix now — file it with `/report-bug`.
- **💡 A worthwhile NEW idea** — file it with `/propose-idea` and continue with OTHER tasks. **Don't
implement before the human approves.**
## Finishing (when a stop condition fired)
- Stop = the wake time → **start `/end-chat-soft`**: finish the current item to a natural cut at
your normal pace, then the full unhurried ceremonies (status + handover, judge pass, commit AND
push, the night's summary in the chat). The wake time bounds the WORKING, not the closing.
- Stop = the human wrote — switch to them; give a short summary of the night.
- Stop = a critical error — get the current micro-step compiling if you can, **commit and push**
(don't leave broken/uncommitted main), describe what happened and what you tried; wait.
## Notes
- This is an INTENSIVE mode: don't spare tokens/time, maximize useful autonomous work overnight.
- The global goal and vision live in `STATUS.md`/`plans/`/`AGENT_GUIDE.md`/`PHILOSOPHY.md`. Keep checking against them.