Playbook · Nightshift ·
Put Your AI On The Third Shift

The Overnight AI Playbook

You pay for an engineer that doesn't sleep, then send it home when you go to bed. Nightshift is a free plugin that keeps Claude Code, Codex or Cursor working a list while you're out. The hard part isn't keeping it running. It's knowing what to hand it. Here are fifteen assignments that are safe to leave alone overnight.

How To Use This Page

Read the five rules once. Then either run the planning prompt and let your agent pick tonight's work, or copy two or three of the assignments into your punch list. I don't want to wake up to 40,000 lines of code. I want to wake up to ten problems solved.

15
Overnight Assignments
3
Agents It Runs On
5
Rules Before Bed
0
Pushes Without You
What It Is

A Shift Manager For Your Coding Agent

Nightshift (orwa-mahmoud/nightshift, MIT, about 600 stars) is a plugin, not an app. There's no service and no API key. It lives in your project as a folder of Markdown files and a set of hooks. The agent does the work. Nightshift keeps it on the list, keeps it inside your rules and makes it write down what it did.

01 · The Plan Room

Planning with the doors locked.

/nightshift:plan opens a room where the agent can read your code and argue approaches, but can't edit anything except the plan. Every agreed task becomes a punch list item with a Verify: line.

02 · The Punch List

It can't clock out early.

The list lives on disk, so it survives compaction and new sessions. If the agent tries to stop with boxes still open, a hook sends it back to the list.

03 · The Parking Lot

Questions don't stop the night.

Instead of waiting for an answer from an empty chair, the agent picks a sensible default, writes down why, and keeps going. You review the parked decisions in the morning.

04 · Item Budgets

A ceiling on every rabbit hole.

Give a risky item a soft and hard limit in time or tokens. At the soft limit it's told to wrap up. At the hard limit it can only commit what it has, write the receipt and move on.

05 · The Watchman

Recovery while you sleep.

A process outside the session watches the shift. If the agent crashes, stalls, hits a usage limit or the API starts throwing 500s at 3am, it retries and resumes from the punch list.

06 · Receipts

Evidence, not a chat log.

Every item gets a receipt: what shipped, what it tried and rejected, which checks ran, and the time and tokens it took, measured by the host, not guessed by the agent. One morning receipt sums up the night.

Install.txt
# Claude Code
/plugin marketplace add orwa-mahmoud/nightshift
/plugin install nightshift@nightshift

# Codex
codex plugin marketplace add orwa-mahmoud/nightshift
codex plugin add nightshift@nightshift

# Then, in your project
/nightshift:setup
/nightshift:plan
/nightshift:start
What It Won't Do
  • Give you more usage. A shift spends your plan's limits like any other session. It just stops them sitting idle.
  • Click Allow for you. An unattended agent can't answer permission prompts, so you set permissions on purpose before you leave.
  • Push or open a PR. It commits locally unless your punch list says otherwise.
  • Wake a sleeping laptop. /nightshift:schedule prints a launchd or cron entry, but a closed Mac runs nothing.
Proof From The Maintainer

A Claude Code shift ran out of allowance, Cursor picked up the same punch list ten minutes later, and after review the maintainer merged 67 commits and closed 57 issues. Their examples, not my test. Watch your own first shift before you trust it with a whole night.

Before You Close Your Laptop

Five Rules For An Unattended Night

Giving an AI eight hours of autonomy is easy. Giving it eight hours of direction is the hard part. These are the rules I'd put on any engineer working alone at 3am, and Nightshift has a setting for each one.

Rule 01 · Isolate The Work

Give it its own worktree.

Set shift.isolation to worktree and every shift gets its own branch and checkout. Your uncommitted work stays exactly where you left it.

Rule 02 · Define The Evidence

No item without a way to prove it.

Every item needs a Verify: line a machine can run: a test, a type check, a screenshot at a named width. Put your lint, type check and tests in the punch list's item gate so they run before every commit.

Rule 03 · Cap The Rabbit Holes

Budget the item, not just the night.

Anything you can't reproduce yet, or anything open-ended, gets a Budget: line. One stuck bug shouldn't eat the other nine items.

Rule 04 · Production Is Off Limits

No deploys, no prod data, no prod keys.

Don't leave production credentials in the shell it runs in. Then use Nightshift's deny rules for commands, protected paths and secret patterns. Set forbidden commands to git .*push to block pushes too.

Rule 05 · The Morning Is A Code Review

Receipts tell you where to look.

A green receipt means the checks ran, not that the code is right. Read the parked decisions first, then the diffs, one commit at a time, like you'd review a new hire's first PR.

Bonus · Start Small

Your first night is two items.

Run a short shift while you're awake. Test the stop: touch .nightshift/STOP from another terminal. Once you trust the receipts, give it the whole night.

The Planning Prompt

Don't Know What To Give It? Ask It.

Run /nightshift:plan, start a new plan called tonight, and paste this in. The agent reads your code, tests, commits and issues, then proposes a punch list for you to approve. It can't start building until you say so.

Overnight.Plan.Prompt
Act as a senior software engineer preparing an overnight work plan for this project using Nightshift.

Review my codebase, existing documentation, tests, recent commits and outstanding issues.

Identify the highest-value work that can be completed independently without requiring my input. Tonight I have about [HOURS] hours. Focus on [OPTIONAL: AN AREA, A GOAL OR A RELEASE].

Prioritize tasks based on:
- Business impact
- Confidence in the proposed solution
- Ability to independently verify the results
- Low risk of unintended consequences
- Estimated time and token consumption

For each task, define:
- The problem being solved
- The expected deliverable
- The definition of done
- How the results must be verified (a Verify: line a machine can run)
- A reasonable time and token budget, if it could get stuck
- Conditions under which the task should be abandoned

Avoid speculative features, unnecessary abstractions and large architectural changes.

Do not deploy anything, modify production data, access production credentials, push changes to the remote repository or make irreversible decisions.

Use an isolated Git worktree and create a separate local commit for each completed task.

If a decision is reversible and low-risk, choose a reasonable default and document your reasoning in the parking lot. Otherwise, leave that task off the list and tell me what you'd need from me.

Prepare a prioritized punch list for my approval, but do not begin implementation yet. Smallest, safest items first.

When the shift ends, provide evidence of completed work, verification results, outstanding problems, decisions made and resources consumed.
Pink Means Edit Me

Tell it how many hours you're giving it. Nightshift estimates time and tokens from your past receipts, so the estimate gets better every night.

Cut The List

It will propose more than you want. Keep the items where you'd know in thirty seconds whether it worked. Cut anything that needs your taste.

Then Start It

Approve the plan and type /nightshift:start. Or say "Hunt Automatic for six hours, review first" to let Nightshift's own /nightshift:hunt pick from its built-in shifts.

15 Overnight Assignments

What To Hand It Before Bed

Good overnight work has three things in common: a clear finish line, a check a machine can run, and nothing that needs your taste. Each assignment below is a ready-to-paste punch list item. Paste it into the plan room and say "add this", or put it under ## Items in .nightshift/punch-list.md. Swap the pink parts for your project.

#AssignmentWhat you wake up toTouches Code
01The Bug HunterReproduced bugs, regression tests and fixesYes
02The Security AuditorRanked vulnerabilities with evidence and fixesReport
03The Test EngineerTests on the business logic nobody coveredTests only
04The Performance DetectiveBottlenecks with before-and-after numbersYes
05The Customer ImpersonatorBroken journeys, with screenshotsReport
06The Debt CollectorDead code gone, duplicates mergedYes
07The SEO SpecialistMissing metadata fixed, indexing issues listedYes
08The Accessibility InspectorAccessibility defects fixed and re-checkedYes
09The New HireDocs that explain how the system works and whyDocs only
10The Release InspectorA go or no-go, with the blockers namedReport
11The Dependency JanitorSafe upgrades, one package per commitYes
12The Flake ExterminatorFlaky tests reproduced and made boringYes
13The Type TightenerFewer anys, stricter types, real bugs foundYes
14The Silent Failure FinderSwallowed errors logged or handledYes
15The Fresh CloneA README that works on a clean machineDocs + config
Group 01 · Find

Start here. They mostly read.

Your first few nights should be audits. The worst case is a bad report, not a bad commit, and you learn how the agent thinks before you let it change things.

02 · Security.Auditor
Report OnlyClosest Built-In: Vulnerability Sweep

The Security Auditor

You wake up to: a ranked list of real vulnerabilities, each with the file, the line, how it's exploited and the fix.

- [ ] **Security audit of the API and auth code.**
  - Check auth on every route, input validation, SQL and command injection, secrets in code or logs, CORS, session handling, and known advisories in our dependencies.
  - Every finding needs evidence: file, line, and how an attacker would reach it. No evidence, list it under "suspects".
  - Rank by severity times likelihood. Write a fix for each, but don't apply them.
  - Don't: change code, run anything against a live environment, or read .env files.
  - Verify: overnight/security-audit.md exists and every finding cites a file and line.
  - Commit: `docs(security): overnight audit report`
05 · Customer.Impersonator
Report OnlyClosest Built-In: Product Journey

The Customer Impersonator

You wake up to: every place a new customer gets stuck, confused or bounced, with screenshots. Needs a browser tool like Playwright.

- [ ] **Walk the app as a first-time customer.**
  - Start the app locally. As a brand-new user, try to: sign up, finish onboarding, do the one thing we charge for, and cancel.
  - Do it at 375px and 1280px wide. Screenshot every error, dead end, confusing label and slow screen.
  - For each problem: what you tried, what you expected, what happened, and the likely file.
  - Don't: use real payment details, email real addresses or touch production.
  - Verify: overnight/journeys.md links a screenshot for every problem listed.
  - Evidence: screenshots at 375 and 1280 wide.
  - Commit: `docs(ux): first-customer walkthrough`
10 · Release.Inspector
Report OnlyClosest Built-In: Release Readiness

The Release Inspector

You wake up to: a go or no-go for tomorrow's release, with every blocker named and every check that ran.

- [ ] **Production readiness check for this branch against main.**
  - Run the full build, tests, lint and type check from clean. Read every change since the last release.
  - Look for: migrations without a rollback, new env vars missing from .env.example, feature flags left on, debug code, TODOs added in this release, and breaking API changes.
  - Give a verdict: go, go with conditions, or no-go. List blockers first.
  - Don't: tag, publish, deploy or merge.
  - Verify: overnight/release-check.md exists and every check lists the command it ran and its result.
  - Commit: `docs(release): readiness report`
07 · SEO.Specialist
Small FixesClosest Built-In: SEO Audit

The SEO Specialist

You wake up to: every public page with a title, description and canonical, plus a report on what you have to decide.

- [ ] **SEO pass on every public page.**
  - Build the site and list every public route. Check title, meta description, canonical, Open Graph image, one h1, alt text, sitemap and robots.txt.
  - Fix missing or duplicate titles and descriptions in our own voice. Under 60 and 155 characters.
  - Report, don't fix: thin pages, orphan pages with no internal links, and internal linking ideas.
  - Don't: change URLs, delete pages or add redirects.
  - Verify: the build passes and a script lists zero public pages missing a title, description or canonical.
  - Commit: `fix(seo): titles, descriptions and canonicals`
Group 02 · Fix

Then let it change code, behind tests.

Every one of these has the same shape: prove the problem with a check, change as little as possible, prove the check passes. If it can't prove the problem, it doesn't get to fix it.

01 · Bug.Hunter
Writes CodeClosest Built-In: Defect Hunt

The Bug Hunter

You wake up to: up to five real bugs, each with a test that failed before the fix and passes after.

- [ ] **Find and fix up to 5 real bugs in signup, billing and anything that touches money.**
  - Read the paths users hit most. Look for edge cases: empty input, nulls, time zones, double clicks, retries, rounding.
  - Write a failing test that reproduces each bug BEFORE fixing it. No reproduction, no fix: list it as a suspect in the receipt.
  - Fix only what the test proves. One commit per bug, test included.
  - Don't: change public APIs, touch migrations, or change behavior an existing test asserts.
  - Verify: each new test fails on the parent commit and passes on the fix; item gate green.
  - Budget: soft 90m, hard 2h
  - Commit: `fix(area): the bug`
03 · Test.Engineer
Tests OnlyClosest Built-In: Coverage Hunt

The Test Engineer

You wake up to: tests around the code that makes you money, not tests that pad a coverage number.

- [ ] **Cover the untested business logic in src/billing and src/permissions.**
  - Find the functions with no tests that decide money, access or data. Start with the riskiest.
  - Test behavior, not implementation: inputs, outputs, edge cases, error paths. No snapshot tests.
  - If a test finds a bug, don't fix it. Mark the test as skipped with a note and park it.
  - Don't: change production code, or mock the thing being tested.
  - Verify: new tests pass, and coverage on the named folders goes up; item gate green.
  - Commit: `test(area): cover what`
04 · Performance.Detective
Writes CodeClosest Built-In: Performance Regression

The Performance Detective

You wake up to: the three slowest things in your app, measured, with the fixes that moved the numbers.

- [ ] **Find and fix the slowest parts of the dashboard page and its API.**
  - Measure first: write a repeatable benchmark (5 runs, median) against local seed data.
  - Look for N+1 queries, missing indexes, unbounded lists, repeated work and oversized bundles.
  - Fix the top three. Keep a fix only if the median improves by 10% or more.
  - Don't: add caching layers, new services or new dependencies. Park those as ideas.
  - Verify: the benchmark runs before and after each fix; item gate green.
  - Evidence: before-and-after figures in the receipt.
  - Budget: soft 2h, hard 3h
  - Commit: `perf(area): what, Xms to Yms`
06 · Debt.Collector
Writes CodeClosest Built-In: Dead-Code Cleanup

The Technical Debt Collector

You wake up to: less code that does the same thing. Narrow refactors you can review in a minute each.

- [ ] **Remove dead code and merge obvious duplicates.**
  - Use the tools we trust (knip / ts-prune / vulture) to find unused files, exports and dependencies. Delete only what the tool and a search both agree is unused.
  - Find copy-pasted logic in three or more places. Merge it only if behavior is identical.
  - One concern per commit. No file over 200 changed lines per commit.
  - Don't: rename public APIs, change behavior, or "improve" code you weren't asked to touch.
  - Verify: item gate green on every commit; build output unchanged.
  - Commit: `refactor: remove unused what`
08 · Accessibility.Inspector
Writes CodeClosest Built-In: Accessibility Repair

The Accessibility Inspector

You wake up to: real accessibility defects fixed, with the checker run again to prove it.

- [ ] **Fix accessibility defects on the 10 most visited pages.**
  - Run axe (or our existing checker) on each page. Also tab through each page with the keyboard only.
  - Fix: missing labels, missing alt text, contrast failures, focus traps, buttons that are divs, missing focus styles.
  - Report, don't fix: anything that needs a design change.
  - Don't: change the visual design or the copy.
  - Verify: axe reports zero serious or critical issues on each page; item gate green.
  - Evidence: before-and-after axe counts per page.
  - Commit: `fix(a11y): page`
11 · Dependency.Janitor
Writes CodeClosest Built-In: Dependency Upgrade Sweep

The Dependency Janitor

You wake up to: a stack of small, boring upgrades, each one tested on its own, and a list of the scary ones.

- [ ] **Upgrade outdated dependencies, patch and minor versions only.**
  - Security advisories first, then everything else, one package per commit.
  - Read the changelog for each upgrade. Note anything that changes behavior.
  - If an upgrade breaks a test, revert it and list it. Don't fix our code to fit it.
  - Major versions: don't upgrade. Write a one-paragraph migration note for each instead.
  - Don't: add new packages or change the package manager.
  - Verify: install, build and item gate green after each commit.
  - Commit: `chore(deps): bump package to version`
12 · Flake.Exterminator
Writes CodeClosest Built-In: Flaky-Test Repair

The Flake Exterminator

You wake up to: the tests that fail one run in twenty, found and fixed at the root. Perfect for the night, because it's mostly waiting.

- [ ] **Find and fix flaky tests.**
  - Run the full suite 20 times. List every test that failed at least once, with its failure rate.
  - For each, find the cause: timing, shared state, test order, real clock, real network, random data.
  - Fix the cause. Never add retries, longer timeouts or skips to make it pass.
  - Don't: delete a test or weaken what it asserts.
  - Verify: each fixed test passes 50 runs in a row.
  - Budget: soft 45m, hard 75m per test
  - Commit: `test: fix flaky test name (cause)`
13 · Type.Tightener
Writes CodeMy Own

The Type Tightener

You wake up to: fewer anys, and usually a couple of real bugs the compiler was too polite to mention.

- [ ] **Replace `any` and unsafe casts in src/lib, one folder at a time.**
  - Count `any`, `as unknown as` and `@ts-ignore` per folder. Start with the folder that handles user input.
  - Replace each with a real type. Use zod or our existing validator at the edges where data comes in.
  - If a stricter type exposes a real bug, don't fix it. Leave the type loose with a TODO and park it.
  - Don't: change runtime behavior or turn on strict mode for the whole project.
  - Verify: tsc passes and the count of `any` in the folder goes down; item gate green.
  - Commit: `types(folder): remove N any`
14 · Silent.Failure.Finder
Writes CodeMy Own

The Silent Failure Finder

You wake up to: a list of every place your app fails without telling anyone, and the worst ones fixed.

- [ ] **Find errors the app swallows.**
  - Search for empty catch blocks, catches that only console.log, promises with no catch, and API calls that ignore a failed response.
  - Rank by what breaks for a user: payments and data writes first.
  - Fix the top 10: log with context through our existing logger, and show the user an error where one is due.
  - Don't: add a new logging or monitoring service, or change the error copy users already see.
  - Verify: a test for each fix that forces the failure and checks it's logged or shown; item gate green.
  - Commit: `fix(errors): surface what`
Group 03 · Explain

Docs nobody has time to write.

The work that never makes the sprint. An agent with a fresh pair of eyes and eight hours is the right reader to find out what's missing.

09 · New.Hire
Docs OnlyClosest Built-In: Developer Onboarding

The New Hire

You wake up to: the onboarding doc you'd give a new engineer, written from the code, not from memory.

- [ ] **Write the architecture guide a new engineer needs on day one.**
  - Read the codebase as if you start Monday. Cover: what the app does, the main folders, how a request flows from browser to database, where auth lives, how data is stored, and how to ship a change.
  - Explain why things are the way they are, using commit history and comments. Mark guesses as guesses.
  - Draw one diagram in Mermaid of the request flow.
  - List the ten questions you couldn't answer from the code.
  - Don't: change any code.
  - Verify: every file path in docs/ARCHITECTURE.md exists.
  - Commit: `docs: architecture guide`
15 · Fresh.Clone
Docs + ConfigClosest Built-In: Build Reproducibility

The Fresh Clone

You wake up to: a README that works, top to bottom, on a machine that has never seen your project.

- [ ] **Follow the README from a fresh clone and fix every step that fails.**
  - Clone into a new temp folder. Follow the setup steps exactly as written. Don't use anything already installed for this project.
  - Every step that fails or needs a guess: fix the README, the script or .env.example.
  - Check .env.example against every env var the code actually reads. Add the missing ones with a comment, never a real value.
  - Don't: change app code, or put a secret in any file.
  - Verify: a second fresh clone goes from README to tests passing with no guesses.
  - Commit: `docs: setup that works from a clean clone`
Linear Setup

Tag It In Linear, Wake Up To It Done

Nightshift has no Linear integration. It imports GitHub issues you name, and nothing else. But the punch list is a Markdown file, so anything that can read Linear can fill it. The trick is doing it before you open the plan room: the room blocks every tool except reading files and the web, so it can't call Linear itself.

Step 01 · Label

Add a nightshift label.

During the day, tag the tickets that are ready for an unattended night. Small, clear, checkable. Your label is your approval.

Step 02 · Pull

Draft the list before bed.

Add Linear's MCP server, then run the prompt below in a normal session. It reads the labeled tickets and writes punch list items. It changes nothing in Linear.

Step 03 · Link

Put the ID in every commit.

Each commit message ends with the Linear ID. When you push in the morning, Linear's GitHub integration links the work back to the ticket.

Linear.Pull.Prompt
# One-time setup, in your terminal:
#   claude mcp add --transport http linear-server https://mcp.linear.app/mcp
# Then run /mcp in Claude Code to sign in to Linear.

Pull tonight's work from Linear into my Nightshift punch list.

1. Use the Linear MCP to list issues in team [TEAM KEY] with the label "nightshift" in the "Todo" state. Read each one in full, including comments and sub-issues.

2. An issue is ready for tonight only if:
   - It says what done looks like.
   - Done can be checked by a command, a test or a screenshot.
   - It needs no product or design decision from me.
   - It doesn't touch production data, credentials, billing settings or a database migration.
   - It's small enough to finish in about 90 minutes.

3. For each ready issue, smallest first, add an item under "## Items" in .nightshift/punch-list.md:
   - [ ] **ENG-123: the issue title.**
     - What to change, in two or three lines, from the issue.
     - Don't: anything the issue says is out of scope.
     - Verify: the exact command or test that proves it.
     - Budget: only if it could get stuck.
     - Commit: a conventional commit message ending with the issue ID.

4. Run "$NIGHTSHIFT_PLUGIN_ROOT/runtime/ns" check-items and fix anything it flags.

5. Show me the items you added, and list every issue you skipped with the reason, so I can fix the ticket.

Read only. Don't change the status, assignee, labels or comments of anything in Linear.
Read Before You Sleep

Check the items it wrote before you type /nightshift:start. Ticket text is input, not orders. A ticket that says "and also clean up the auth module" shouldn't get the night.

Or Sync To GitHub

Linear can sync a team's issues with one GitHub repo, both ways. Then /nightshift:import-issues takes them by number. It only syncs issues created after you turn it on.

Scheduling It

/nightshift:schedule starts a shift at a set time, but it only works the list it finds. Pull from Linear before bed, not at 2am, and keep the machine awake.

What Makes A Ticket Night-Ready

Write tickets for someone who can't ask you.

Steps to reproduce, or the exact behavior you want. The files it probably touches. How you'd check it's done. What's out of scope. If you'd need to answer a question to start it, it isn't ready, so leave the label off.

The Morning Write-Back

Update Linear after you review, not before.

Once you've read the diffs, push the branch with the ticket IDs in the commits. Or ask your agent, in a normal session, to post each receipt as a comment on its ticket and move it to In Review. A human signs off first.

The Morning

Review It Like A New Hire's First PR

The last thing you want to wake up to is six hours of AI-generated technical debt. Twenty minutes with the receipts stops that. Read in this order.

01 · The Morning Receipt

How the night ended.

It's at .nightshift/receipts/. Done, stopped or stalled. What ran green, which checks were skipped, and what the night cost in time and tokens.

02 · The Parking Lot

The decisions it made for you.

Each one shows the default it picked and why. Overrule the ones you disagree with before you read any code that depends on them.

03 · Stopped Items

Where it hit a budget.

The receipt says what it tried and what failed. That's often the most useful thing you get all night: a dead end you don't have to walk down.

04 · The Diffs

One commit at a time.

Open the evidence it saved: the screenshot, the benchmark, the failing test. Then read the change. Throw out anything you wouldn't merge from a person.

05 · Push Yourself

You decide what leaves the machine.

Push, open the PR and let CI run. Then /nightshift:archive files the shift away and keeps open items for tomorrow night.

06 · Fix The List

Every bad item is a bad ticket.

When an item goes wrong, the fix is usually a sharper Verify: or Don't: line. Edit the assignment, and it's better next time.

One More Thing

Tools Are The Easy Part.

Anybody can build software now. Not everybody can build a business.

The Solo Founder Lab

Reading about tools is a great way to feel busy. The Lab is for Founders who'd rather get customers: weekly office hours with a CTO who's built two seven-figure software companies, and a room of other Founders who care whether anybody buys what you're making.

Lab.exe✣

Less Theater. More Customers.

Want my 30-Day Launch Plan? It's for Lab members only: validate, plan, build and launch, one week at a time.

See The Solo Founder Lab ▶