nightshift

Your AI agents don’t clock out.

Recurring automations that behave like reliable operators — not stateless prompts that re-do work, collide, and forget.

# clone & self-install into every agent it finds
git clone https://github.com/shanemhamilton/nightshift.git
cd nightshift
python3 scripts/install_skill.py

Scheduled prompts have amnesia

A cron job that fires the same prompt every night is stateless. It can’t tell what changed, whether it already did the work, or whether another job is mid-flight. nightshift fixes that.

โœ— A bare scheduled prompt

  • Re-analyzes everything from scratch, every run
  • Two jobs trample the same branch at 2 a.m.
  • No memory of what it tried or learned
  • Fails silently, or auto-merges something risky
  • You can’t tell what it actually did

โœ“ The same job under nightshift

  • Change-detection short-circuit — skips when nothing moved
  • Concurrency lock — one writer, no collisions
  • Persistent memory + an append-only run ledger
  • Failure taxonomy, stop rules, human-approval queue
  • Verified safe-merge closeout, fully auditable

Three modes, one skill

Pick the mode from the request — the skill routes itself.

๐Ÿ› ๏ธ

Optimize

Inject a versioned operating protocol into an existing automation — idempotently, with backups. Turns a fragile prompt into a reliable operator.

“harden this job”
๐Ÿงฉ

Compose

Propose & scaffold a new coordinated suite from an adaptive 9-pattern library — including a daily self-reflection that keeps CLAUDE.md/AGENTS.md current and a documentation-sync ratchet that keeps your README/docs/ in step with merged code — wired so jobs cooperate with exactly one merge authority.

“set up a nightly suite”
๐Ÿ”ญ

Discover

Read-only inventory of every automation already installed across each agent on the machine — with protocol-compliance flags.

“what do I have?”

And a lifecycle front door — setup, add, remove, update — to manage one automation over time on any agent. Every verb is the same pipeline (mutate the manifest → validate the fleet → gate on approval → materialize per agent); remove disables reversibly by default, and exactly one merge authority is preserved even across agents.

The operating protocol it injects

Every hardened job starts with this managed block, before its own task-specific instructions.

Persistent memory
Run ledger (append-only)
Concurrency lock
Tool preflight
Change-detection short-circuit
Idempotency guarantee
Retry / backoff
Cost & runtime budget
Failure taxonomy
Stop rules
Multi-agent execution
Human-approval queue
Verified safe-merge closeout

Runs across four agents

Capability-driven templates detect what each project supports and degrade gracefully — they never guess commands.

Codex CLInative file
automation.toml ยท rrule
Claude Codenative daemon
scheduled-tasks
Gemini CLIexternal cron
gemini -p
Cursorcloud
dashboard / API

Safe by construction

๐Ÿ›ก๏ธ What it will never do while optimizing

Never deploys, publishes, sends external messages, changes secrets / billing, rewrites git history, or deletes data. Composer install is approval-gated; writing into ~/.<agent> needs an explicit flag. For cron and cloud schedulers it emits the command for you to apply — it never edits cron or creates cloud resources itself.