GitHub - openslop/nightshift: Your repo gets better while you sleep. Nightly agent jobs and PR review for any repo.

GitHub

6 min read Original article ↗

Nightshift

GitHub stars License: MIT Join the Nightshift Discord Runs on macOS, Linux, and Windows Works with any coding agent

中文 · 日本語 · 한국어 · Español · Français · Português

Your code gets better while you sleep.
A helper that wakes your coding agent at night, gives it one small job, and leaves pull requests by morning.

Set it up in one sentence

Nightshift works at night and leaves pull requests by morning

What is this?

Nightshift is a helper that works at night.

It wakes up your coding agent. It gives the agent one small job. The agent looks at your code and does the job. If it finds something worth fixing, it opens a pull request for you to look at. Then it moves to the next job.

In the morning, you read what it did. Many nights it finds nothing. That is fine. Nothing is better than a bad change.

Every two hours, it also reads any open pull requests and leaves a short review.

Features

One small job at a time

Ten jobs, run one after another. Security, bugs, readability, maintainability, performance, conventions, architecture, smoke tests, and issues. Each gets the whole agent for one job and nothing else.

The jobs →

Eight jobs run one after another; each row ends in PR OPEN or NO-OP

Pull requests by morning

It only ever opens pull requests. Nothing pushes to main. Nothing merges by itself. You read them with coffee and merge what you like.

Is it safe? →

A clock runs from 05:12 to 07:31 while four pull requests appear

A reviewer every two hours

A second timer reads your open pull requests and leaves a short review. It is quiet unless it finds something.

How the reviewer acts →

A day-long timeline ticks every two hours; most ticks are quiet, two leave a note

Stays out of your way

Before it pushes, a guard checks every file against every open pull request. If a teammate is already in a file, the job drops that change and says so.

The rules every job follows →

The guard marks a file touched by an open pull request as off limits

The console

Every night and every job on one screen. A clock, a radar of the last forty nights, and a grid of what each job did. Needs Node and nothing else.

Open the console →

Three console panels: a clock, a radar sweep, and a job-by-night dot matrix

Pick up the conversation

Press c on any job and the console reopens that night's transcript. Ask the agent why it did what it did. Tell it what to do next.

Continue a conversation →

Pressing c opens a terminal with claude --resume and the agent picks up where it stopped

Also in the box:

  • Plain-English jobs — Every job is one page of plain words. Read them. Change them. Add your own.
  • Learns your taste — Jobs read what you said on past pull requests before they start.
  • Runs your checks — Lint, typecheck, tests. Every job must make them pass before it opens anything.
  • Skips your workday — If your laptop was asleep, the night is skipped. It never runs in the middle of your day.
  • Logs outside your repo — Everything it does is written to a folder on your computer, not in your code.

The jobs

Job What it looks for
security Real holes a bad actor could use. Not "maybe someday" worries.
bugs Bugs a user would notice. Only clear ones.
readability Names that say nothing. Code that takes a second read. Fewer lines, not more.
maintainability Code that is hard to change. It makes it simpler.
performance Slow spots people feel. It measures first.
conventions Places that break your own written rules. Safe fixes only.
conventions-followup The rule breaks that need a real change. One theme a night.
architecture The one big way the code could be simpler.
smoke-tests A few calm tests that check the app still opens. Usually does nothing.
issues One small, clear GitHub issue. Leaves the easy ones for new people.
review Reads open pull requests every two hours. Quiet unless it finds something.

Every job follows the same rules. They are in jobs/_common.md. In short:

  • Read the repo's own guide files first. They win.
  • Read what the owner said on past pull requests. Learn their taste.
  • Never touch a file that someone else's open pull request touches.
  • Run the repo's checks. Fix what breaks.
  • Open a pull request, or say why not. Never push to the main branch.

Supported agents

Works with any coding agent that can run from a terminal without asking questions. Pick the matching AGENT line in nightshift.conf.example.

Claude Code logo Claude Code   Codex logo Codex   Cursor logo Cursor   Gemini CLI logo Gemini CLI   GitHub Copilot logo GitHub Copilot   Hermes Agent logo Hermes   OpenClaw logo OpenClaw   OpenCode logo OpenCode   Aider logo Aider   Amp logo Amp   Goose logo Goose   Qwen Code logo Qwen Code   Droid logo Droid   Cline logo Cline   + any agent with a "yes to everything" flag


How to start

Tell your coding agent this:

Get github.com/openslop/nightshift and set it up for my code at ~/code/my-app. Read SETUP.md there and follow it.

That is it. Your agent will ask you a few questions, set two timers on your computer, and show you where the notes go.

Works on macOS, Linux, and Windows. If you would rather do it by hand, SETUP.md is the page your agent follows.

Watch it

The Nightshift console

Tell your coding agent:

Open the Nightshift console. Read ~/nightshift/tui/README.md and start it.

It needs Node. Press c on a job to talk to the agent about what it did. Press ? for the rest.

What is inside

  • jobs/ has one page per job, in plain English. Read them. Change them if you want.
  • jobs/_common.md has the rules every job follows.
  • review/SKILL.md says how the reviewer acts.
  • nightshift.conf.example is the settings page. Your agent fills in a copy.
  • SETUP.md is the page your agent follows to set things up.
  • bin/ has three small scripts the timers run. You do not need to read them.
  • tui/ is the console. tui/README.md says how to open it.

Is it safe?

  • It only ever opens pull requests. You decide what gets merged.
  • It never touches a file that another open pull request touches.
  • It runs your checks before it opens anything.
  • It runs once a night. If your computer was asleep, it skips that night instead of running in the middle of your day.
  • Everything it does is written to a log on your computer, outside your repo.

Change it

  • Turn a job off by taking its name out of the JOBS line in your settings.
  • Change how a job thinks by editing its page in jobs/. Keep the words plain.
  • Add a job by adding a new page in jobs/ and putting its name in JOBS.
  • Use a different agent by picking a different AGENT line in your settings.

Turn it off

Tell your agent: "Turn off Nightshift." It removes the two timers. Your code is not touched.


Community & support

  • Discord: Join the community on Discord.
  • Ideas and bugs: Missing a job? Found a night that went wrong? Open an issue.
  • Share a job: Wrote a job page that works well? Open a pull request and put it in jobs/.
  • Show support: Star this repo to follow along.

Developing

Want to add a job, fix a script, or work on the console? See CONTRIBUTING.md.

Nightshift is shell scripts, plain-text job pages, and a Node console with no dependencies. There is no build step.

Nightshift contributors

Star history

GitHub star history chart for openslop/nightshift

License

Nightshift is free and open source under the MIT License. Use it, copy it, change it.