Skip to content

About

Stop babysitting your agents. A workflow builder like n8n, where a step can be an agent and a choice a decision model. Night Shift runs it on your own machines, for any kind of work, and asks you only what needs you.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

2,185 Commits

Folders and files

The moon of tonight

Night Shift

Stop babysitting your agents.
Draw once how your AI agents and you work together. Night Shift runs it on your own computers, day and night, and asks you only what needs you.

License: Apache-2.0 Status: pre-alpha Built with Bun TypeScript Platform: macOS · Linux

Quick start · How it works · Flows to run · User guide · Contributing

The watch-logs flow in the Night Shift editor. A rule reads the logs, an agent finds the cause, and a Gate asks you before a fix. On the right, the agent's cascade: Sonnet first, then Opus.

What Night Shift does

An AI agent, such as Claude Code or Codex, can research a market, watch a service, write a newsletter, or fix a bug. But you still start each agent, check its work, and choose what comes next.

Night Shift does that part for you. You draw a flow: the steps of a job, which agent does each step, and where you want to decide. Night Shift then runs the flow when you click Run, on a schedule, or when another tool calls it. It asks you only at the points that you marked.

Some examples:

  • Each morning, read the news on a topic and write a short brief.
  • Each night, check your logs. When there is a new error, find the cause and ask you before a fix.
  • Find five candidates for a podcast host, let you pick one, and write a report on it.

Night Shift works like n8n or Zapier, but a step can be an agent that works for an hour.

  • Your computers, your logins. Runs, files, and logins stay on your own computers. The agents use the subscriptions that you already pay for.
  • You stay in control. An agent never adds a step or changes your flow. Every loop has a maximum. Each run shows what each step cost.

Quick start

You need:

  • A Mac with Apple silicon, or a Linux computer (x64).
  • An account for Claude or ChatGPT. Night Shift installs the agent for you.

Then:

  1. Download the desktop app from the nightly release.
  2. Open the app. On macOS, the first start needs one extra step. Open System Settings > Privacy & Security, and choose Open Anyway.
  3. Follow Get started on Home. It installs an agent, signs you in, and adds your first project.
  4. Run a starter flow. Open scout-and-pick, and give it a topic that you care about. Night Shift asks you to pick a candidate, and an agent writes a report on it.

Get started in the user guide shows each step. Then build your first flow.

How it works

Word Means
Project A place for one body of work. It holds the flows, runs, and knowledge of that work. It can have a folder on your computer.
Flow The steps of a job, drawn as boxes and arrows.
Node One box in a flow: an agent, a shell command, a web request, a choice, a wait.
Run One time that a flow runs, from start to end.
Gate A question that waits for you in the inbox, such as "Send this email?".
Schedule When a flow runs without you, for example each weekday at 22:00.

How Night Shift works in the user guide tells more.

Two ladders

In a flow, each job goes to the cheapest helper that does it well.

  • Work climbs. A cheap agent tries first. When its try fails a check, a strong agent tries again with the failure. The last rung can be you.
  • Choices climb. A rule makes the choices that it can. A small decision model makes the next ones. It is fast and cheap, and it can only pick one of the options that you gave. A large model or you make the rest.

A Gate is where a ladder reaches you. It has two jobs. It catches what a ladder cannot do. And it asks for your approval before an act that you cannot undo, such as a sent email, a published post, or a merge.

This is the watch-logs starter flow. A rule wakes an agent only for a new error, and a Gate asks you before Night Shift acts:

flowchart LR
  read["⚙ Read the logs<br/><sub>a rule: anything new?</sub>"]
  quiet["⏹ Nothing to do"]
  investigate["🤖 Find the cause<br/><sub>Sonnet, then Opus</sub>"]
  decide["✋ Gate<br/><sub>fix or ignore?</sub>"]
  fix["⤵ Fix and check<br/><sub>implement-and-check</sub>"]
  remember["⚙ Remember these errors"]

  read -- quiet --> quiet
  read -- new --> investigate
  investigate -- noise --> remember
  investigate -- found --> decide
  decide -- fix --> fix
  decide -- ignore --> remember
  fix -- pass --> remember
Loading

The same shape can watch a feed, a price, or a status page. Flows and nodes in the user guide tells each node type.

Flows to run

These flows come with Night Shift. When you add a project with a folder, you choose which of your agents runs each part.

Flow What it does
implement-and-check Builds one task. A cheap agent tries, your check proves each try, and a strong agent rescues it.
plan-and-build Splits a goal into tasks, then builds and checks each task.
per-file Applies one instruction to each file that matches a pattern.
watch-logs Reads your logs. Wakes an agent only for a new error, and asks you before a fix.
scout-and-pick Finds candidates on a topic, lets you pick one, and writes it out as a report.
draft-slides Turns notes into a slide deck, and revises it after your review.
review-learnings Asks you which notes from your agents to keep. Agents read what you keep.

People share more flows in community/. These need an account or a tool beyond your agent:

Flow What it does
review-pr Reviews a pull request, and posts the review when you agree.
figma-to-code Reads a Figma frame, updates the matching components, and shows you the change.

More flows wait on the Ideas page. Build one and share it.

Next to n8n and Zapier

Night Shift has no app catalog. A flow reaches an app through its CLI, an HTTP call, a webhook, or the agent's own tools. You can use n8n or Zapier together with Night Shift. They can start a flow with a signed webhook, and a Command step can send the result back.

Other ways to run it

Way For
The desktop app Your own computer. See Quick start. It updates itself.
The Docker image A Host on a server, which runs your schedules when your laptop sleeps: ghcr.io/xiduzo/nightshift:nightly. See docs/deploy/.
From source Work on Night Shift itself. You need macOS or Linux, Bun 1.3, and git. See CONTRIBUTING.md.
git clone https://github.com/xiduzo/nightshift.git
cd nightshift
bun install
bun run dev            # web UI on :3001, API on :3000

Status

Night Shift is pre-alpha and built in public. It has run a real project every night since 2026-10-16. Expect breaking changes to the flow format and the database. The goals are in VISION.md.

Usage data

A released build sends anonymous usage events to the Night Shift team. A run from source sends nothing. The events have no names, paths, prompts, or file contents. To stop them, use the switch in Settings, or set NIGHTSHIFT_USAGE=off or DO_NOT_TRACK=1. docs/usage-data.md lists every event.

Documentation

Document What is in it
User guide Install Night Shift, build your first flow, schedule runs, and answer Gates.
docs/deploy/ Run a Host on a server, webhooks, local models, and monitoring.
docs/PLAN.md The concept, the decisions, and the architecture.
docs/glossary.md One name for one thing.
docs/adr/ The architecture decisions, one record each.
docs/steering/ The vision, and the rules that every change follows.

Built with

Bun · TanStack Start · React Flow · LangGraph · Yjs · Hono · oRPC · Drizzle · Better Auth · shadcn/ui · Electrobun · Expo

Contributing

Read CONTRIBUTING.md before you open a pull request. To report a security problem, see SECURITY.md.

License

Apache-2.0

The logo follows the phase of the moon. The moon icons are from OpenMoji, the open-source emoji and icon project, under CC BY-SA 4.0.

About

Stop babysitting your agents. A workflow builder like n8n, where a step can be an agent and a choice a decision model. Night Shift runs it on your own machines, for any kind of work, and asks you only what needs you.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages