Skip to main content

nightlane

nightlane checks what any agent did. Your coding agent says "done, all tests pass". nightlane reads git and runs the tests itself, and tells you which ticks are proven and which are only claimed.

For developers who let Claude Code, Codex, Cursor, Gemini CLI or any other agent work through a plan. The plan is a Markdown checklist: each item is a unit, and the agent ticks it when it says it is done. Python 3.9+, no dependencies, MIT licensed.

pipx install nightlane
nightlane demo              # 10 s, no API key: a fake agent's night, one bad tick caught and rejected
nightlane verify            # finds your agent's checklist (PLAN.md, TODO.md, …), any branch: is each tick in git?
nightlane init --action     # optional: the same check on every pull request

nightlane init --action writes a workflow with this GitHub Action step (no install step in CI):

- uses: actions/checkout@v4
  with: { fetch-depth: 0 }
- uses: Ayberkone/nightlane@v3
  with: { goal: '' }         # empty: it finds the plan itself; strict: 'true' also fails on suspicious ticks

An agent ticked both units of a small plan and said "done". nightlane verify exits 1 and says:

✗ 1/2 ticks proven by git, 1 only claimed, 1 suspicious
✓ VERIFIED U1  20428aa feat: U1 add a --dry-run flag  (matched by commit subject)
    ! suspicious: empty commit (touches no files)
✗ CLAIMED  U2  (no sha on the line; add `done: <sha>`)

One tick has no commit at all; the other has one, but it is empty. Add --run-verify --at-commit and each unit's own test (its verify: line) runs again at that unit's own commit.

nightlane demo: three lanes of a fake agent work one night on a toy repo; nightlane rejected one tick whose test failed, the lane fixed it, and the morning shows 7 of 8 units VERIFIED by git, 2 lanes ready to land and 1 question for you

Or let nightlane run the agent too. A lane is one Claude Code session working through one plan, unattended, in its own git worktree and branch. Every tick is checked as it happens: a tick whose test fails is rejected and goes back to the agent.

cd your-project
nightlane "fix the flaky login test" --for 8h   # plans it, shows the plan, starts on Enter
# go to sleep
nightlane report

A real morning report (nightlane working on itself, 1 Dec; trimmed):

▶️ NIGHTLANE-wave6-realrepo.md — still running, cycle 5/25
  VERIFIED (git): 24 commits · 42 files +2682/-100 · units proven by git: U1, U2, U3 · 401k tokens
  ✓ U1 VERIFIED 4890b25 feat: U1 fix the public-safety failure: the CHANGELOG and… · +3/-3, 2 files
      rules: U1 rejected — verify-all: Verify-all has a new failure: test_release_u29.Changelog.test_public_safe
      rules: U1 passed — commit ok, tests ok, kept-tests ok, lint ok, secrets ok, deps ok, verify ok, verify-all ok
  ✓ U2 VERIFIED b9ef81f feat: U2 dependencies in every checkout nightlane makes… · +577/-33, 10 files
  → Next: U4 — plan quality on real repos

The agent ticked U1 with a CHANGELOG line that named a private repo. nightlane ran the tests itself, one caught it, the tick was rejected, and the agent fixed it in the next cycle. Nothing is pushed.

1. Install

pipx install nightlane && pipx ensurepath   # then open a new terminal if `nightlane` isn't found

No pipx? uvx --from nightlane nightlane --help runs it without installing.

2. Watch a night of three lanes in about 10 s (no API key)

nightlane demo

A fake agent works three lanes at once on a toy repo, each in its own git worktree and branch: a bug fix, a small feature, and docs with tests. Every tick is a real commit, and nightlane checks each one itself. One agent ticks a rounding fix and says "fixed, all tests pass", but its test still fails: nightlane runs the unit's verify: command, rejects the tick live, and the next cycle commits the real fix. In the morning: one report across the lanes, and nightlane status listing every lane. From a real run (nightlane demo --fast --no-open, trimmed):

fix-rounding  U2 rejected by nightlane — verify: U2's verify command fails at ea1bec7 (exit 1): FAILED (failures=1)

☀️ nightlane morning report · Dec 2 02:33 · 3 lanes, 1 needs you: NIGHTLANE-docs-tests.md · 7 of 8 units VERIFIED by git · 2 ready to land

❓ NIGHTLANE-docs-tests.md — waiting on the owner (1 question)
  ➜ needs you: U3: publish to PyPI as tinyshop or tinyshop-demo?
  VERIFIED (git): 2 commits · 2 files +15/-1 · units proven by git: U1, U2 · 14k tokens

✅ NIGHTLANE-fix-rounding.md — done, all 2 units closed
  ➜ ready to merge
  VERIFIED (git): 3 commits · 2 files +13/-2 · units proven by git: U1, U2 · 15k tokens
  ✓ U1 VERIFIED 9ad9471 test: U1 failing test for total() rounding · +9/-0, 1 file · git show 9ad9471
  ✓ U2 VERIFIED 37767c9 fix: U2 total() rounds to cents · +4/-1, 2 files · git show 37767c9
      rules: U2 rejected — verify: U2's verify command fails at ea1bec7 (exit 1): FAILED (failures=1) | commit ok, judge ok, tests ok, kept-tests ok, lint ok, secrets ok…
      rules: U2 passed — commit ok, judge ok, tests ok, kept-tests ok, lint ok, secrets ok, deps ok, verify ok, verify-all ok
  Land it: nightlane land fix-rounding

▶ nightlane status — every lane in one table
finished  3/3 proven               cycle 3/8    last    0 min ago  NIGHTLANE-add-discount.md  model reported DONE
finished  2/2 proven               cycle 3/8    last    0 min ago  NIGHTLANE-fix-rounding.md  model reported DONE
finished  2/3 proven               cycle 3/8    last    0 min ago  NIGHTLANE-docs-tests.md  needs you: U3: publish to PyPI as tinyshop or tinyshop-demo?

Git proves 7 of the 8 units. Two lanes are ready to land, and "Land it" is offered only for those. The third lane stopped on a question only you can answer instead of guessing. The demo uses its own temp state and never touches your lanes, config or notifier; it removes its temp folder on exit (--keep keeps it to look around, --fast skips the pauses, --no-open skips the dashboard, --lanes 1 runs the older single-lane demo with a usage limit, about 14 s).

3. A real lane in 5 minutes

You need git and the claude CLI. In your project, one command:

nightlane "add a --json flag to export"     # also: nightlane '#42', an issue URL, nightlane -f task.md

It checks your setup and fixes what it can (hooks, permission rules; one fixed: line each), has claude plan the task into units (each with a verify: command that runs on your code today, the last one a review of the whole diff), shows the plan in about 10 lines and starts on Enter. The lane works in its own git worktree on branch nightlane/<task> (your checkout is not touched), in permission mode auto, never pushes, and stops when done or after 10 hours (--for 8h / --until 07:00 to change). --dry-run shows the plan and the exact run it would do; --yes starts without asking (needed when there is no terminal). A vague task gets at most 3 questions, each with a default Enter accepts. In the morning: nightlane report. Step by step on a toy repo: Your first night.

By hand

Want to write the goal file yourself? In your project:

nightlane init      # wires the hooks into .claude/settings.local.json (not committed; yours are kept, with a backup)
                    # and writes .claude/plans/active/NIGHTLANE-main.md + its PROGRESS file

Fill in the goal file, or let nightlane plan "add a --json flag to export" write one for you (also --from-issue 42). A goal file is plain Markdown:

- [x] U1 Parse the config file. done: 3fb69ae
- [ ] U2 Add the --json flag after:U1
  - verify: `python3 -m unittest tests.test_cli`
- [ ] U3 Pick the default output format after:U2
  - BLOCKED(owner): JSON or YAML? — since 2026-11-28

A tick only counts as proven when its done: <sha> is a real commit. A BLOCKED(owner) unit waits for you; the lane does not keep restarting on it. Commit the goal file, check your setup, and start:

git add .claude/plans/active && git commit -m "goal"
nightlane doctor    # read-only check of everything a lane needs, with a fix for each problem
nightlane run .claude/plans/active/NIGHTLANE-main.md --worktree --for 8h --permission-mode auto

run opens a new tab in your terminal (herdr, tmux or cmux) and starts claude there; with no terminal it runs headless in the background. Without --permission-mode the lane stops at every permission prompt; auto is the one we recommend. A lane can't git push unless you pass --allow-push, and it won't start on main/master without --worktree (the lane gets its own branch nightlane/<goal> in a separate git worktree; init and plan add it to the command they print when you are on one) or --allow-protected. See Safety.

4. In the morning

nightlane report                                   # per lane: what git proves, what is only claimed, questions for you
nightlane accept .claude/plans/active/NIGHTLANE-main.md U3 --sha 1a2b3c4   # you checked a claimed unit: point it at its commit
nightlane reject .claude/plans/active/NIGHTLANE-main.md U3 --note "no test"  # it is not done: untick it for the next run

accept is refused when git does not have the commit. reject unticks the unit and writes why under it, so the next nightlane run does it again.

Words

  • lane: one agent working through one goal file on its own branch, until done, the deadline or the cycle cap.
  • goal file: the Markdown plan a lane follows, a checklist of units (.claude/plans/active/NIGHTLANE-<name>.md).
  • unit: one checklist item (- [ ] U3 …), small enough for one cycle. The agent ticks it (- [x]) with done: <sha> of its commit.
  • [P]: on a unit, it may run in parallel with other [P] units (after:U1 names what it waits for).
  • cycle: one turn of the agent: fresh context, read goal + progress, do the next unit, commit, stop.
  • progress file: the lane's notebook next to the goal file (…-PROGRESS.md): what each cycle did, what is next.
  • VERIFIED: a tick git proves: its done: <sha> is a real commit and nightlane's checks passed.
  • CLAIMED: what the agent says it did (ticks, progress lines) that git does not prove.
  • rules gate: the checks nightlane runs on every tick itself; a failing tick is unticked, and blocked the second time.
  • Verify-all: the goal file's whole-suite command; a tick counts only when it adds no new test failure.
  • supervisor: a background loop with no model calls: resumes stalled lanes, waits out usage limits, sends the report.
  • manager: optional, a tab you pick (nightlane supervisor manager <tab>) where finished lanes report.

The same list in your terminal: nightlane help words. A whole first night on a toy repo, start to land: Your first night.

Why not just a while-loop?

When nightlane runs the agent too, a lane survives the night: one unit per cycle with a fresh context, for as long as you allow, through usage limits, stalls, a sleeping laptop and a lane stuck in a loop. while :; do cat PROMPT.md | claude -p; done gets surprisingly far. These are the things that go wrong around 3 am:

What breaks What nightlane does
The agent says "done", but nothing landed A tick counts only with a done: <sha> that git confirms. Unproven ticks are flagged in the report.
It loops on the same thing for hours 3 cycles with no commit, no tick and the same Next: stop the lane.
The context fills up and quality drifts Every cycle starts clean. The goal and PROGRESS files carry the state.
A usage limit hits mid-night The lane waits for the reset, never past your deadline.
The tab goes quiet (crash, a dialog, a lost prompt) A supervisor resumes the lane. It never types over your draft or into a busy tab.
The laptop sleeps Sleep is not counted as a stall, and a live lane keeps the machine awake.
It runs away with the budget A deadline, a cycle cap, and spend caps (--max-tokens 2M, --max-cost 5).

More in How it works.

How it compares

What it is Where nightlane differs
Ralph loop a bash loop that feeds the same prompt back until a completion phrase The same core idea, plus fresh context per cycle, git-verified ticks, limit handling and a report.
herdr, tmux, cmux keep your agent sessions alive nightlane runs inside them and makes a lane finish a goal and prove it.
firstmate, claude-squad, Conductor run a crew of agents in parallel worktrees nightlane runs one bounded lane per goal, unattended, and audits it against git.
Claude Code /loop, scheduled tasks re-run a prompt on an interval, or on a schedule in the cloud nightlane runs a goal file unit by unit on your machine and checks each tick against git.
Claude Code /goal keeps Claude working until a goal is met; a model judges that from the transcript nightlane's judge is not a model reading the transcript: it runs each unit's tests itself and reads git, and a tick that fails is rejected.
Claude Code agent view (claude agents) runs sessions in the background, keeps them going and lists them by state (needs input, working, done) nightlane adds the checking: each cycle's tick is judged by running its tests and reading git, and one report says what is proven. It can run its lanes on those sessions (--backend claude-bg, experimental).

Also works with

  • Any agent run, not only nightlane's: nightlane verify <goal.md> checks every tick against git (CLI), also as a CI check with the GitHub Action
  • Claude Code plugin with /nightlane:start, :status, :report, :verify: Claude Code plugin
  • herdr, tmux, cmux, or no terminal (headless): Backends · in cmux every lane of a project on one screen: Your tabs in cmux · herdr plugin
  • Codex CLI and Gemini CLI lanes, and a fallback agent during a usage limit: Backends
  • MCP clients (Claude Code, Cursor, Codex, Gemini): MCP server
  • Your phone: notifications by ntfy, Slack/Discord webhook, Telegram or desktop (Notifications); the dashboard, offline or --served (Dashboard)
  • A sandbox for bypassPermissions: Sandbox

Docs

Docs home · Your first night · How it works · CLI · Your tabs in cmux · The inbox page · Crash recovery · Goal file · Hooks · Configuration · Contributing · Changelog · Security

macOS and Linux, Python 3.9+. MIT licensed.

Metadata

Release files for nightlane 3.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nightlane 3.2.0
File Size Uploaded Provenance Actions
nightlane-3.2.0.tar.gz 1.1 MB Without provenance Details for nightlane-3.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nightlane 3.2.0
File Interpreter ABI Platform Actions
nightlane-3.2.0-py3-none-any.whl Python 3 none any Details for nightlane-3.2.0-py3-none-any.whl

Total release size: 1.6 MB

Release files / nightlane-3.2.0.tar.gz

Download URL nightlane-3.2.0.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
ebba8a1c32de76acd8f802495b71a2b7135019afa39e727c331f3cf15ba3363e
BLAKE2b-256 checksum
How to use checksums
d54aaac2b9e18d096521c9a32a6d93389fb2733f84966e1ee0b40f2e962d6f41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Release files / nightlane-3.2.0-py3-none-any.whl

Download URL nightlane-3.2.0-py3-none-any.whl
Size 504.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b0f971d7041aa0338ebf943ccaedd71594bc7009fb9e8be62644b97a1cfa1f44
BLAKE2b-256 checksum
How to use checksums
e7bd420a186b1af9416cea6a6681764b8f0ac5a4a91fa2280208cbff76911dac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Security for nightlane 3.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page