Install
openclaw skills install night-shiftQueue coding plans during the day, approve them, execute later in isolated worktrees, and inspect reports. Background agentic execution requires an explicitly configured non-interactive runner.
openclaw skills install night-shiftNight Shift is an autonomous queued-execution skill for engineering work.
Instead of asking the agent to do one large coding task immediately, you build a queue of plans, review or approve them, then run them in a controlled batch window. Each plan is split into phases, executed in isolation, verified, checkpointed, and summarized in a report.
Mental model:
This is useful when you want:
Use Night Shift when the user asks for things like:
Prefer Night Shift over immediate execution when:
Do not use Night Shift for:
A plan is the unit of queued work. It includes:
Each plan is split into phases. A phase has:
Each phase chooses one of several execution methods:
shellcursorclaude-codesubagentThis lets the framework mix deterministic shell work with agentic coding work.
Each plan runs in its own git worktree under data/night-shift/worktrees/.
That means Night Shift can:
Phases can be checked after execution using one of several verification modes, including:
files_existcheck_git_diffrun_testslint_checksmoke_testimport_checkintegration_checksnapshot_diffnoneAfter execution, Night Shift writes a report so the next interaction starts from evidence instead of guesswork.
These are the command patterns the skill is designed around.
| Command | Purpose |
|---|---|
plan add <desc> | Create a new plan with generated phases |
plan steal <url> <desc> | Queue work derived from an external repo/project |
plan list [status] | Show plans in the queue |
plan show #<id> | Show full details for one plan |
plan approve #<id> | Approve one plan |
plan approve all | Approve all queued plans |
plan remove #<id> | Remove a plan |
plan priority #<id> <level> | Change priority |
plan edit #<id> phase <n> prompt <text> | Refine a phase prompt |
good night | Start execution of approved plans |
night shift status | Show current state |
night shift stop | Request stop / halt execution |
night shift dry-run | Preview what would execute |
morning | Show the latest execution report |
night shift merge #<id> | Merge completed plan results |
night shift inspect #<id> | Inspect outputs/worktree |
night shift retry #<id> | Retry a failed or partial plan |
If your host agent uses a different natural-language wrapper, preserve the same intent and lifecycle.
Night Shift is split into a few major parts.
models.py — core plan/phase data models and enumsqueue.py — CRUD, queue index, plan storage, approvals, updatesphase_generator.py — creates initial phases from plan inputexecutor.py — main run loop, orchestration, locking, budget checks, reportingphase_runner.py — executes individual phases using the chosen methodsubagent_runner.py — helper for subagent-based executionverifier.py — phase verification logiccheckpoint.py — save/resume progressfailure_memory.py — track known failures and avoid blind repetitionlock.py — prevent overlapping runsbudget.py — per-phase/per-plan/night budget trackingmemory_guard.py — watchdog for memory/process hygienegit_manager.py — worktree setup, commit/reset helpersreporter.py — morning-style summariesmonitor.py — notifications and health checkswatchdog.py — execution monitoringstatus.py — status helperscron_trigger.sh / ns-control.sh — optional shell wrappersThe bmad_*.py files are advanced helpers for richer planning/PRD flows. They are not required for the core Night Shift lifecycle.
A typical run looks like this:
Preflight
Plan selection
Per-plan setup
Per-phase execution
Verification
Persistence
Completion
Night Shift is designed to be agentic, but not reckless.
You still need sensible approval and review.
Night Shift may be flagged by automated scanners because it intentionally includes operational automation primitives:
cron_trigger.sh, ns-control.sh, claude-wrapper.sh)These are expected for an unattended coding workflow, but they deserve review before use. Night Shift does not bundle private keys, hidden credentials, miners, persistence malware, or background network beacons. It only uses credentials and CLIs already available in the host environment.
Before running it in a new workspace:
night shift dry-run first when available.For non-interactive ClawHub installs, some registries may require --force after scanner warnings. Treat that as a prompt to review the code, not as a failure signal.
Night Shift stores runtime state under:
data/night-shift/
├── queue.json
├── plans/
├── worktrees/
├── execution/
├── reports/
├── failure-memory.json
├── budget.json
└── execution.log
queue.json — lightweight queue indexplans/*.json — full plan recordsworktrees/<plan_id>/ — isolated git worktree per planfailure-memory.json — prior failed step fingerprintsbudget.json — current budget trackingexecution.log — main execution logNight Shift now supports portable configuration instead of relying on hardcoded local paths.
OPENCLAW_WORKSPACE — override workspace rootNIGHT_SHIFT_MODEL — preferred model hint for model-driven helpersCURSOR_CLI — explicit path to Cursor CLI / agent binaryNIGHT_SHIFT_CHAT_ID — target chat for Night Shift notificationsTELEGRAM_CHAT_ID — fallback notification targetTELEGRAM_BOT_TOKEN — Telegram Bot token for notificationsNight Shift also inherits normal environment from the host runtime, including anything needed by:
If a specific execution method requires additional auth or binaries, document that at the host level.
data/night-shift/cursor executionclaude-code executionUser intent:
Add OAuth login to the app, but do it overnight.
Night Shift flow:
plan add add OAuth login to the appplan approve #<id>good nightUser intent:
Queue three fixes now, run them all tonight.
Flow:
User intent:
Show me what would run tonight.
Flow:
night shift dry-runUser intent:
Retry the failed parser plan.
Flow:
night shift retry #<id>User intent:
Show me what Night Shift changed before we merge.
Flow:
night shift inspect #<id>night shift merge #<id> when satisfiedNight Shift works best when the plan title/description is concrete.
Better:
Worse:
Approve unattended runs when:
Avoid approval when:
Use:
shell for deterministic scripted workcursor / claude-code for coding-heavy phasessubagent for delegated structured workBe honest about these.
Approve at least one plan before starting execution.
A lock file or active run exists. Inspect status before forcing a restart.
Check:
Check notification env vars:
TELEGRAM_BOT_TOKENNIGHT_SHIFT_CHAT_ID or TELEGRAM_CHAT_IDSet the expected binary path explicitly or install the required tool:
CURSOR_CLIclaude-codeInspect checkpoints, report output, logs, and plan status. Resume/retry instead of starting from scratch blindly.
Night Shift is publishable as a power-user engineering skill.
Its strongest differentiators are:
Its biggest adoption caveats are:
That is fine. Don’t oversell it as “plug-and-play for everyone.” Sell it as a serious autonomous coding workflow for advanced users.
Core engine files in scripts/ include:
models.pyqueue.pyphase_generator.pyexecutor.pyphase_runner.pyverifier.pycheckpoint.pyfailure_memory.pybudget.pygit_manager.pylock.pyreporter.pymonitor.pywatchdog.pysubagent_runner.pymemory_guard.pyOptional/advanced helpers:
bmad_batch.pybmad_context.pybmad_guardrails.pybmad_phases.pybmad_prd_evolve.pybmad_queue.pybmad_rollback.pyShell helpers:
cron_trigger.shns-control.shclaude-wrapper.shREFERENCE.md — operational reference, setup notes, environment variables, and troubleshootingscripts/test_queue.py — queue behavior checksscripts/test_integration.py — end-to-end integration checks