nightlane 3.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. nightlane-3.0.0/LICENSE +21 -0
  2. nightlane-3.0.0/PKG-INFO +190 -0
  3. nightlane-3.0.0/README.md +145 -0
  4. nightlane-3.0.0/autopilot/__init__.py +6 -0
  5. nightlane-3.0.0/autopilot/__main__.py +7 -0
  6. nightlane-3.0.0/autopilot/agents.py +315 -0
  7. nightlane-3.0.0/autopilot/backends/__init__.py +161 -0
  8. nightlane-3.0.0/autopilot/backends/cmux.py +127 -0
  9. nightlane-3.0.0/autopilot/backends/fake.py +60 -0
  10. nightlane-3.0.0/autopilot/backends/herdr.py +298 -0
  11. nightlane-3.0.0/autopilot/backends/tmux.py +166 -0
  12. nightlane-3.0.0/autopilot/chain_status_page.py +515 -0
  13. nightlane-3.0.0/autopilot/cli.py +194 -0
  14. nightlane-3.0.0/autopilot/config.py +223 -0
  15. nightlane-3.0.0/autopilot/core.py +1423 -0
  16. nightlane-3.0.0/autopilot/dashboard_data.py +397 -0
  17. nightlane-3.0.0/autopilot/dashboard_page.py +704 -0
  18. nightlane-3.0.0/autopilot/dashboard_serve.py +224 -0
  19. nightlane-3.0.0/autopilot/demo.py +147 -0
  20. nightlane-3.0.0/autopilot/demo_agent.py +139 -0
  21. nightlane-3.0.0/autopilot/doctor.py +423 -0
  22. nightlane-3.0.0/autopilot/gha.py +132 -0
  23. nightlane-3.0.0/autopilot/goalfile.py +199 -0
  24. nightlane-3.0.0/autopilot/guard.py +83 -0
  25. nightlane-3.0.0/autopilot/headless.py +699 -0
  26. nightlane-3.0.0/autopilot/i18n.py +416 -0
  27. nightlane-3.0.0/autopilot/init.py +219 -0
  28. nightlane-3.0.0/autopilot/mcp_server.py +458 -0
  29. nightlane-3.0.0/autopilot/notify.py +243 -0
  30. nightlane-3.0.0/autopilot/plan.py +512 -0
  31. nightlane-3.0.0/autopilot/plugin.py +68 -0
  32. nightlane-3.0.0/autopilot/report.py +376 -0
  33. nightlane-3.0.0/autopilot/run.py +347 -0
  34. nightlane-3.0.0/autopilot/statusline.py +109 -0
  35. nightlane-3.0.0/autopilot/supervisor.py +978 -0
  36. nightlane-3.0.0/autopilot/templates/goal-template.md +43 -0
  37. nightlane-3.0.0/autopilot/verify.py +490 -0
  38. nightlane-3.0.0/autopilot/worktree.py +240 -0
  39. nightlane-3.0.0/nightlane.egg-info/PKG-INFO +190 -0
  40. nightlane-3.0.0/nightlane.egg-info/SOURCES.txt +102 -0
  41. nightlane-3.0.0/nightlane.egg-info/dependency_links.txt +1 -0
  42. nightlane-3.0.0/nightlane.egg-info/entry_points.txt +3 -0
  43. nightlane-3.0.0/nightlane.egg-info/top_level.txt +1 -0
  44. nightlane-3.0.0/pyproject.toml +39 -0
  45. nightlane-3.0.0/setup.cfg +4 -0
  46. nightlane-3.0.0/tests/test_agents.py +186 -0
  47. nightlane-3.0.0/tests/test_audit_u39.py +143 -0
  48. nightlane-3.0.0/tests/test_audit_u44.py +73 -0
  49. nightlane-3.0.0/tests/test_autopilot.py +358 -0
  50. nightlane-3.0.0/tests/test_autopilot_attention.py +213 -0
  51. nightlane-3.0.0/tests/test_autopilot_cycle_end.py +158 -0
  52. nightlane-3.0.0/tests/test_autopilot_events.py +184 -0
  53. nightlane-3.0.0/tests/test_autopilot_sidebar.py +194 -0
  54. nightlane-3.0.0/tests/test_autopilot_supervisor.py +300 -0
  55. nightlane-3.0.0/tests/test_autopilot_supervisor_u6.py +211 -0
  56. nightlane-3.0.0/tests/test_autopilot_supervisor_u7.py +186 -0
  57. nightlane-3.0.0/tests/test_autopilot_tokens.py +183 -0
  58. nightlane-3.0.0/tests/test_backends.py +220 -0
  59. nightlane-3.0.0/tests/test_budget_u32.py +214 -0
  60. nightlane-3.0.0/tests/test_chain_status_autopilot.py +168 -0
  61. nightlane-3.0.0/tests/test_ci_services_u42.py +62 -0
  62. nightlane-3.0.0/tests/test_cli.py +121 -0
  63. nightlane-3.0.0/tests/test_config.py +168 -0
  64. nightlane-3.0.0/tests/test_dashboard_data.py +273 -0
  65. nightlane-3.0.0/tests/test_dashboard_page.py +247 -0
  66. nightlane-3.0.0/tests/test_dashboard_serve.py +305 -0
  67. nightlane-3.0.0/tests/test_demo.py +115 -0
  68. nightlane-3.0.0/tests/test_doctor.py +292 -0
  69. nightlane-3.0.0/tests/test_fallback_u33.py +193 -0
  70. nightlane-3.0.0/tests/test_gemini.py +209 -0
  71. nightlane-3.0.0/tests/test_github_action.py +233 -0
  72. nightlane-3.0.0/tests/test_goalfile.py +196 -0
  73. nightlane-3.0.0/tests/test_guard.py +217 -0
  74. nightlane-3.0.0/tests/test_headless.py +329 -0
  75. nightlane-3.0.0/tests/test_heartbeat_u27.py +288 -0
  76. nightlane-3.0.0/tests/test_herdr_backend.py +394 -0
  77. nightlane-3.0.0/tests/test_herdr_events_u31.py +376 -0
  78. nightlane-3.0.0/tests/test_herdr_plugin.py +308 -0
  79. nightlane-3.0.0/tests/test_hygiene.py +65 -0
  80. nightlane-3.0.0/tests/test_i18n.py +124 -0
  81. nightlane-3.0.0/tests/test_init.py +176 -0
  82. nightlane-3.0.0/tests/test_launch.py +37 -0
  83. nightlane-3.0.0/tests/test_linux_parity.py +243 -0
  84. nightlane-3.0.0/tests/test_mcp.py +328 -0
  85. nightlane-3.0.0/tests/test_mcp_u37.py +122 -0
  86. nightlane-3.0.0/tests/test_milestone_u41.py +206 -0
  87. nightlane-3.0.0/tests/test_night_stats_u43.py +194 -0
  88. nightlane-3.0.0/tests/test_notify.py +245 -0
  89. nightlane-3.0.0/tests/test_plan.py +289 -0
  90. nightlane-3.0.0/tests/test_plugin.py +205 -0
  91. nightlane-3.0.0/tests/test_polish_u38.py +107 -0
  92. nightlane-3.0.0/tests/test_release_u29.py +64 -0
  93. nightlane-3.0.0/tests/test_report.py +234 -0
  94. nightlane-3.0.0/tests/test_report_pr_body_u36.py +111 -0
  95. nightlane-3.0.0/tests/test_run.py +244 -0
  96. nightlane-3.0.0/tests/test_sandbox_u35.py +232 -0
  97. nightlane-3.0.0/tests/test_speed_u40.py +95 -0
  98. nightlane-3.0.0/tests/test_standalone_overrides.py +35 -0
  99. nightlane-3.0.0/tests/test_tmux_backend.py +272 -0
  100. nightlane-3.0.0/tests/test_verify.py +224 -0
  101. nightlane-3.0.0/tests/test_verify_at_commit_u34.py +180 -0
  102. nightlane-3.0.0/tests/test_verify_u30.py +132 -0
  103. nightlane-3.0.0/tests/test_worktree.py +214 -0
  104. nightlane-3.0.0/tests/test_worktree_copy_u28.py +142 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ayberk Baytok
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,190 @@
1
+ Metadata-Version: 2.4
2
+ Name: nightlane
3
+ Version: 3.0.0
4
+ Summary: Run coding agents unattended overnight through bounded cycles, and wake up to progress git can prove.
5
+ Author: Ayberk Baytok
6
+ License: MIT License
7
+
8
+ Copyright (c) 2026 Ayberk Baytok
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/Ayberkone/nightlane
29
+ Project-URL: Issues, https://github.com/Ayberkone/nightlane/issues
30
+ Project-URL: Changelog, https://github.com/Ayberkone/nightlane/blob/main/CHANGELOG.md
31
+ Keywords: claude-code,coding-agents,autonomous-agents,automation,tmux,cmux,herdr
32
+ Classifier: Development Status :: 4 - Beta
33
+ Classifier: Environment :: Console
34
+ Classifier: Intended Audience :: Developers
35
+ Classifier: License :: OSI Approved :: MIT License
36
+ Classifier: Operating System :: MacOS
37
+ Classifier: Operating System :: POSIX :: Linux
38
+ Classifier: Programming Language :: Python :: 3
39
+ Classifier: Programming Language :: Python :: 3 :: Only
40
+ Classifier: Topic :: Software Development
41
+ Requires-Python: >=3.9
42
+ Description-Content-Type: text/markdown
43
+ License-File: LICENSE
44
+ Dynamic: license-file
45
+
46
+ # nightlane
47
+
48
+ **Run coding agents overnight. Wake up to commits, not claims.**
49
+
50
+ nightlane (the command is `autopilot`) drives Claude Code through a goal file one unit at a time, with a fresh context every cycle, for as long as you allow. It survives the night (usage limits, stalls, a sleeping laptop, a lane stuck in a loop), and in the morning it tells you what **git can prove** got done, separately from what the agent only **claims** it did.
51
+
52
+ It works with the terminal you already use (**herdr, tmux, cmux**, or no terminal at all) and needs nothing but Python 3.9+. No runtime dependencies.
53
+
54
+ ![autopilot demo: a fake agent works a 3-unit goal, hits a usage limit, and the morning report shows two units VERIFIED by git and one only CLAIMED](docs/assets/demo.gif)
55
+
56
+ ```text
57
+ $ autopilot demo # the morning report at the end of the run
58
+ ☀️ autopilot morning report · Nov 28 03:20
59
+
60
+ ⚠️ AUTOPILOT-demo.md — all units ticked, but 1 not proven by git
61
+ VERIFIED (git): 2 commits · 2 files +9/-0 · units proven by sha: U1, U2 · 14k tokens
62
+ CLAIMED (progress file): 3 units ticked this run (3/3) · unproven: U3 · last result: docs written, all tests pass (claimed: nothing was committed)
63
+ → Next: nothing left
64
+ ```
65
+
66
+ ## Install
67
+
68
+ ```sh
69
+ git clone https://github.com/Ayberkone/nightlane && cd nightlane
70
+ pipx install . # or, without installing: uvx --from . autopilot --help
71
+ autopilot demo
72
+ ```
73
+
74
+ Using Claude Code? The plugin wires the hooks and adds `/autopilot:start`, `/autopilot:status`, `/autopilot:report` and `/autopilot:verify` (the CLI above is still needed; the plugin calls it):
75
+
76
+ ```text
77
+ /plugin install autopilot --marketplace Ayberkone/nightlane
78
+ ```
79
+
80
+ That's the same as `/plugin marketplace add Ayberkone/nightlane`, then `/plugin install autopilot@autopilot`. See [Claude Code plugin](docs/reference/claude-plugin.md).
81
+
82
+ Using herdr? `herdr plugin install Ayberkone/nightlane/integrations/herdr` adds `autopilot.run`, `.status`, `.report` and `.verify` popups. See [herdr plugin](docs/reference/herdr-plugin.md).
83
+
84
+ Using an MCP client (Claude Code, Cursor, Codex, Gemini)? `claude mcp add autopilot -- autopilot mcp` gives any agent `status`, `report`, `verify`, `pause`, `resume` and `queue` tools. See [MCP server](docs/reference/mcp.md).
85
+
86
+ ## 30-second demo (no API key)
87
+
88
+ ```sh
89
+ autopilot demo
90
+ ```
91
+
92
+ A deterministic fake agent works a 3-unit goal in a throwaway git repo in about 12 seconds (`--fast`: about 5). It makes two real commits, hits a usage limit and waits for the reset, then ticks the last unit with a sha that no commit has. The morning report shows the first two as **VERIFIED** and the third as **CLAIMED** only, and the dashboard opens (`--no-open` skips it). The demo uses its own temp state and never touches your lanes, config or notifier.
93
+
94
+ ## A real lane in 5 minutes
95
+
96
+ You need `python3`, `git` and the [`claude`](https://code.claude.com/docs) CLI. In your project:
97
+
98
+ ```sh
99
+ autopilot init # wires the hooks into .claude/settings.json (yours are kept, with a backup)
100
+ # and writes .claude/plans/active/AUTOPILOT-main.md + its PROGRESS file
101
+ $EDITOR .claude/plans/active/AUTOPILOT-main.md # your units: ids, after: deps, verify: commands
102
+ # or let autopilot write one: autopilot plan "add a --json flag to export" (or --from-issue 42, --from-milestone v1.0)
103
+ git add .claude/plans/active && git commit -m "goal" # so `autopilot verify` can date every tick
104
+ autopilot doctor # read-only check of everything a lane needs, with a fix per problem
105
+ autopilot run .claude/plans/active/AUTOPILOT-main.md --for 8h --permission-mode acceptEdits
106
+ ```
107
+
108
+ `autopilot plan` writes a goal file for you: from a one-line idea or a GitHub issue (its task list becomes the units), with ids, `after:` deps and a `verify:` line using your repo's test command. It's a template by default, so no API call; `--agent claude` asks the agent to fill it in from the code and keeps the answer only if it validates.
109
+
110
+ `run` opens a new tab in the terminal you're in (herdr, tmux or cmux) and starts `claude` there. With no terminal, or with `--backend headless`, it starts a detached runner that uses one `claude -p` process per cycle, which works on a Linux server, in CI or from cron. Pick a `--permission-mode` you trust for the repo: without one, the lane stops at every permission prompt. A lane can't `git push` unless you pass `--allow-push`, and with `--worktree` it works on its own `autopilot/<goal>` branch in a separate `git worktree`, so your checkout isn't touched ([Safety](docs/reference/safety.md)). Without `--worktree` it won't start on `main`/`master` unless you pass `--allow-protected`. For `bypassPermissions`, use the bundled `Dockerfile` or dev container ([Sandbox](docs/reference/sandbox.md)).
111
+
112
+ In the morning:
113
+
114
+ ```sh
115
+ autopilot report # per lane: verdict, VERIFIED numbers, CLAIMED results, questions for you
116
+ autopilot report --pr-body --out body.md && gh pr create --body-file body.md # the same, as the lane's PR description
117
+ autopilot dashboard # offline HTML page (works from file://, fine on a phone)
118
+ autopilot dashboard --serve --host 0.0.0.0 # the same page over HTTP for your phone (LAN/Tailscale, token printed)
119
+ ```
120
+
121
+ A goal file is plain Markdown:
122
+
123
+ ```markdown
124
+ - [x] U1 Parse the config file. done: 3fb69ae
125
+ - [ ] U2 [P] Add the --json flag after:U1
126
+ - verify: `python3 -m unittest tests.test_cli`
127
+ - [ ] U3 Pick the default output format after:U2
128
+ - BLOCKED(owner): JSON or YAML? — since 2026-11-28
129
+ ```
130
+
131
+ A tick only counts as proven when its `done: <sha>` is a real commit. `BLOCKED(owner)` units go to your inbox, and a lane never restarts just to stare at them. See the [goal-file reference](docs/reference/goal-file.md) and [`examples/goal-template.md`](examples/goal-template.md).
132
+
133
+ ## Why not just a while-loop?
134
+
135
+ `while :; do cat PROMPT.md | claude -p; done` gets surprisingly far. These are the things that go wrong around 3 am, and what autopilot does about each:
136
+
137
+ | What breaks | What autopilot does |
138
+ |---|---|
139
+ | 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 and on the dashboard. |
140
+ | It loops on the same thing for hours | A no-progress breaker: 3 cycles with no commit, no tick and the same **Next:** stops the lane. |
141
+ | The context fills up and quality drifts | Every cycle starts clean (`/clear`, or a fresh process headless). The goal and PROGRESS files carry the state. |
142
+ | A usage limit hits mid-night | The reset time is parsed and the lane waits it out with jitter, never past your deadline. If two lanes hit a limit, everything pauses. A headless lane with `--fallback-agent codex` keeps working on Codex until the reset. |
143
+ | The tab goes quiet (crash, a dialog, a lost prompt) | A zero-token supervisor resumes the lane with backoff. It never types over your draft or into a busy tab, and it quarantines a lane that keeps restarting. |
144
+ | The laptop sleeps | Sleep is detected and timers shift instead of counting as a stall. `caffeinate` (macOS) or `systemd-inhibit` (Linux) keeps a live lane awake. |
145
+ | It needs a decision from you | Owner questions go to a needs-you inbox and, optionally, to your phone or desktop: ntfy, a Slack/Discord webhook, Telegram or a desktop notification. |
146
+ | It runs away with the budget | A deadline, a cycle cap and a subagent cap per cycle, plus spend caps (`--max-tokens 2M`, `--max-cost 5`). Tokens and cost are recorded per cycle. |
147
+
148
+ More in [How it works](docs/how-it-works.md).
149
+
150
+ ## Already running agents another way?
151
+
152
+ `autopilot verify` audits any repo and goal file, whoever ran the agent (firstmate, herdr, a hand-run session, a script). No lane, no state, nothing to install in the repo:
153
+
154
+ ```sh
155
+ autopilot verify docs/GOAL.md # ✓ VERIFIED U1 5bf5b25 … / ✗ CLAIMED U3 (sha deadbee is not a commit in this repo)
156
+ autopilot verify docs/GOAL.md --run-verify --json # also re-run each unit's `verify:` command
157
+ autopilot verify docs/GOAL.md --run-verify --at-commit --unit-age # …at the unit's own commit; date each tick by its line
158
+ ```
159
+
160
+ Each `[x]` unit is **VERIFIED** when its `done: <sha>` is a real commit no older than the goal file, and **CLAIMED** otherwise. A plain checklist works too: ids are optional, and a tick like `- [x] Add the parser (commit 3fb69ae)` is read as well. Ticks that share one sha, point at an empty commit, only touch the goal/progress files or are off `HEAD` are flagged as suspicious. Exit code 0 means every tick is proven, so it works as a CI check. There's a [GitHub Action](docs/reference/github-action.md) for that, with a job-summary table and a PR-comment output. Details in the [CLI reference](docs/reference/cli.md#verify).
161
+
162
+ ## How it fits with other tools
163
+
164
+ **autopilot works with herdr, tmux and cmux; it doesn't replace them.** A terminal or multiplexer keeps your agents *alive*. autopilot is the layer that makes an agent *finish a goal and prove it*. Run autopilot inside the terminal you like, or headless without one.
165
+
166
+ | | What it is (in its own words) | Where autopilot differs |
167
+ |---|---|---|
168
+ | [herdr](https://github.com/herdrdev/herdr) | "the runtime your coding agents live on": persistent sessions with working/blocked/idle state per pane | A first-class autopilot [backend](docs/reference/backends.md#herdr). autopilot reads herdr's agent state and adds the goal contract, git proof and the morning report. |
169
+ | [herdr-auto-pilot](https://github.com/0xGosu/herdr-auto-pilot) | a herdr plugin that supplies the next prompt or answer when an agent needs input, and can hand out checklist items | autopilot checks every tick against git and waits out usage limits. |
170
+ | [Ralph loop](https://ghuntley.com/ralph/) / [ralph-loop plugin](https://github.com/anthropics/claude-plugins-official/tree/main/plugins/ralph-loop) | a bash loop (or Stop hook) that feeds the same prompt back until a completion phrase or an iteration cap | The same core idea, plus fresh context per cycle, git-verified ticks, limit handling, stall recovery and a report. |
171
+ | [firstmate](https://github.com/kunchenguid/firstmate) | "an agent distro for running a crew of agents" in worktrees, returning PRs, with an away mode and status reports | firstmate orchestrates a crew. autopilot runs one bounded lane per goal and audits it against git. |
172
+ | [claude-squad](https://github.com/smtg-ai/claude-squad) / [Conductor](https://conductor.build) | run several agents in parallel, each in its own worktree, and review the diffs | Built for parallel, supervised sessions. autopilot is for unattended runs you review in the morning. |
173
+ | Claude Code [`/loop`, `/goal`, scheduled tasks](https://code.claude.com/docs/en/scheduled-tasks) | re-run a prompt in a session, judge a goal condition from the transcript, or run on a schedule in the cloud | autopilot runs on your machine against your repo and judges progress by git, not by the transcript. |
174
+ | [Codex cloud / `codex exec`](https://learn.chatgpt.com/docs/cloud) | cloud tasks that keep working while your computer sleeps, plus a non-interactive CLI | `--agent codex` runs a headless lane on `codex exec` ([details](docs/reference/backends.md#codex-cli---agent-codex)). `--agent gemini` does the same on Gemini CLI ([details](docs/reference/backends.md#gemini-cli---agent-gemini)). Git-verified progress doesn't depend on the agent. |
175
+ | [LifeOS](https://github.com/danielmiessler/LifeOS) | "The AI-Powered Life Operating System" (formerly PAI) | LifeOS / PAI-style setups steer how an agent thinks; autopilot checks what it actually finished, and they can run together. `autopilot init` keeps existing hooks intact. |
176
+
177
+ Descriptions are taken from each project's README or docs, as of 2026-11-28.
178
+
179
+ ## Docs
180
+
181
+ - [Docs home](docs/index.md)
182
+ - [How it works](docs/how-it-works.md): cycles, the supervisor, VERIFIED vs CLAIMED
183
+ - Reference: [CLI](docs/reference/cli.md) · [Backends](docs/reference/backends.md) (herdr, tmux, cmux, headless) · [Hooks](docs/reference/hooks.md) · [Configuration](docs/reference/configuration.md) · [Goal file](docs/reference/goal-file.md) · [Dashboard](docs/reference/dashboard.md) · [Claude Code plugin](docs/reference/claude-plugin.md) · [herdr plugin](docs/reference/herdr-plugin.md)
184
+ - [Contributing](CONTRIBUTING.md) · [Changelog](CHANGELOG.md) · [Security](SECURITY.md)
185
+
186
+ ## Status
187
+
188
+ v3 is pre-release: macOS and Linux, Python 3.9+, Claude Code first, Codex CLI and Gemini CLI headless (`--agent codex`, `--agent gemini`). Notifications via ntfy, Slack/Discord webhooks, Telegram or the desktop. The supervisor can run as a launchd agent (macOS) or a systemd user unit (Linux), and it restarts a headless runner that died.
189
+
190
+ MIT licensed.
@@ -0,0 +1,145 @@
1
+ # nightlane
2
+
3
+ **Run coding agents overnight. Wake up to commits, not claims.**
4
+
5
+ nightlane (the command is `autopilot`) drives Claude Code through a goal file one unit at a time, with a fresh context every cycle, for as long as you allow. It survives the night (usage limits, stalls, a sleeping laptop, a lane stuck in a loop), and in the morning it tells you what **git can prove** got done, separately from what the agent only **claims** it did.
6
+
7
+ It works with the terminal you already use (**herdr, tmux, cmux**, or no terminal at all) and needs nothing but Python 3.9+. No runtime dependencies.
8
+
9
+ ![autopilot demo: a fake agent works a 3-unit goal, hits a usage limit, and the morning report shows two units VERIFIED by git and one only CLAIMED](docs/assets/demo.gif)
10
+
11
+ ```text
12
+ $ autopilot demo # the morning report at the end of the run
13
+ ☀️ autopilot morning report · Nov 28 03:20
14
+
15
+ ⚠️ AUTOPILOT-demo.md — all units ticked, but 1 not proven by git
16
+ VERIFIED (git): 2 commits · 2 files +9/-0 · units proven by sha: U1, U2 · 14k tokens
17
+ CLAIMED (progress file): 3 units ticked this run (3/3) · unproven: U3 · last result: docs written, all tests pass (claimed: nothing was committed)
18
+ → Next: nothing left
19
+ ```
20
+
21
+ ## Install
22
+
23
+ ```sh
24
+ git clone https://github.com/Ayberkone/nightlane && cd nightlane
25
+ pipx install . # or, without installing: uvx --from . autopilot --help
26
+ autopilot demo
27
+ ```
28
+
29
+ Using Claude Code? The plugin wires the hooks and adds `/autopilot:start`, `/autopilot:status`, `/autopilot:report` and `/autopilot:verify` (the CLI above is still needed; the plugin calls it):
30
+
31
+ ```text
32
+ /plugin install autopilot --marketplace Ayberkone/nightlane
33
+ ```
34
+
35
+ That's the same as `/plugin marketplace add Ayberkone/nightlane`, then `/plugin install autopilot@autopilot`. See [Claude Code plugin](docs/reference/claude-plugin.md).
36
+
37
+ Using herdr? `herdr plugin install Ayberkone/nightlane/integrations/herdr` adds `autopilot.run`, `.status`, `.report` and `.verify` popups. See [herdr plugin](docs/reference/herdr-plugin.md).
38
+
39
+ Using an MCP client (Claude Code, Cursor, Codex, Gemini)? `claude mcp add autopilot -- autopilot mcp` gives any agent `status`, `report`, `verify`, `pause`, `resume` and `queue` tools. See [MCP server](docs/reference/mcp.md).
40
+
41
+ ## 30-second demo (no API key)
42
+
43
+ ```sh
44
+ autopilot demo
45
+ ```
46
+
47
+ A deterministic fake agent works a 3-unit goal in a throwaway git repo in about 12 seconds (`--fast`: about 5). It makes two real commits, hits a usage limit and waits for the reset, then ticks the last unit with a sha that no commit has. The morning report shows the first two as **VERIFIED** and the third as **CLAIMED** only, and the dashboard opens (`--no-open` skips it). The demo uses its own temp state and never touches your lanes, config or notifier.
48
+
49
+ ## A real lane in 5 minutes
50
+
51
+ You need `python3`, `git` and the [`claude`](https://code.claude.com/docs) CLI. In your project:
52
+
53
+ ```sh
54
+ autopilot init # wires the hooks into .claude/settings.json (yours are kept, with a backup)
55
+ # and writes .claude/plans/active/AUTOPILOT-main.md + its PROGRESS file
56
+ $EDITOR .claude/plans/active/AUTOPILOT-main.md # your units: ids, after: deps, verify: commands
57
+ # or let autopilot write one: autopilot plan "add a --json flag to export" (or --from-issue 42, --from-milestone v1.0)
58
+ git add .claude/plans/active && git commit -m "goal" # so `autopilot verify` can date every tick
59
+ autopilot doctor # read-only check of everything a lane needs, with a fix per problem
60
+ autopilot run .claude/plans/active/AUTOPILOT-main.md --for 8h --permission-mode acceptEdits
61
+ ```
62
+
63
+ `autopilot plan` writes a goal file for you: from a one-line idea or a GitHub issue (its task list becomes the units), with ids, `after:` deps and a `verify:` line using your repo's test command. It's a template by default, so no API call; `--agent claude` asks the agent to fill it in from the code and keeps the answer only if it validates.
64
+
65
+ `run` opens a new tab in the terminal you're in (herdr, tmux or cmux) and starts `claude` there. With no terminal, or with `--backend headless`, it starts a detached runner that uses one `claude -p` process per cycle, which works on a Linux server, in CI or from cron. Pick a `--permission-mode` you trust for the repo: without one, the lane stops at every permission prompt. A lane can't `git push` unless you pass `--allow-push`, and with `--worktree` it works on its own `autopilot/<goal>` branch in a separate `git worktree`, so your checkout isn't touched ([Safety](docs/reference/safety.md)). Without `--worktree` it won't start on `main`/`master` unless you pass `--allow-protected`. For `bypassPermissions`, use the bundled `Dockerfile` or dev container ([Sandbox](docs/reference/sandbox.md)).
66
+
67
+ In the morning:
68
+
69
+ ```sh
70
+ autopilot report # per lane: verdict, VERIFIED numbers, CLAIMED results, questions for you
71
+ autopilot report --pr-body --out body.md && gh pr create --body-file body.md # the same, as the lane's PR description
72
+ autopilot dashboard # offline HTML page (works from file://, fine on a phone)
73
+ autopilot dashboard --serve --host 0.0.0.0 # the same page over HTTP for your phone (LAN/Tailscale, token printed)
74
+ ```
75
+
76
+ A goal file is plain Markdown:
77
+
78
+ ```markdown
79
+ - [x] U1 Parse the config file. done: 3fb69ae
80
+ - [ ] U2 [P] Add the --json flag after:U1
81
+ - verify: `python3 -m unittest tests.test_cli`
82
+ - [ ] U3 Pick the default output format after:U2
83
+ - BLOCKED(owner): JSON or YAML? — since 2026-11-28
84
+ ```
85
+
86
+ A tick only counts as proven when its `done: <sha>` is a real commit. `BLOCKED(owner)` units go to your inbox, and a lane never restarts just to stare at them. See the [goal-file reference](docs/reference/goal-file.md) and [`examples/goal-template.md`](examples/goal-template.md).
87
+
88
+ ## Why not just a while-loop?
89
+
90
+ `while :; do cat PROMPT.md | claude -p; done` gets surprisingly far. These are the things that go wrong around 3 am, and what autopilot does about each:
91
+
92
+ | What breaks | What autopilot does |
93
+ |---|---|
94
+ | 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 and on the dashboard. |
95
+ | It loops on the same thing for hours | A no-progress breaker: 3 cycles with no commit, no tick and the same **Next:** stops the lane. |
96
+ | The context fills up and quality drifts | Every cycle starts clean (`/clear`, or a fresh process headless). The goal and PROGRESS files carry the state. |
97
+ | A usage limit hits mid-night | The reset time is parsed and the lane waits it out with jitter, never past your deadline. If two lanes hit a limit, everything pauses. A headless lane with `--fallback-agent codex` keeps working on Codex until the reset. |
98
+ | The tab goes quiet (crash, a dialog, a lost prompt) | A zero-token supervisor resumes the lane with backoff. It never types over your draft or into a busy tab, and it quarantines a lane that keeps restarting. |
99
+ | The laptop sleeps | Sleep is detected and timers shift instead of counting as a stall. `caffeinate` (macOS) or `systemd-inhibit` (Linux) keeps a live lane awake. |
100
+ | It needs a decision from you | Owner questions go to a needs-you inbox and, optionally, to your phone or desktop: ntfy, a Slack/Discord webhook, Telegram or a desktop notification. |
101
+ | It runs away with the budget | A deadline, a cycle cap and a subagent cap per cycle, plus spend caps (`--max-tokens 2M`, `--max-cost 5`). Tokens and cost are recorded per cycle. |
102
+
103
+ More in [How it works](docs/how-it-works.md).
104
+
105
+ ## Already running agents another way?
106
+
107
+ `autopilot verify` audits any repo and goal file, whoever ran the agent (firstmate, herdr, a hand-run session, a script). No lane, no state, nothing to install in the repo:
108
+
109
+ ```sh
110
+ autopilot verify docs/GOAL.md # ✓ VERIFIED U1 5bf5b25 … / ✗ CLAIMED U3 (sha deadbee is not a commit in this repo)
111
+ autopilot verify docs/GOAL.md --run-verify --json # also re-run each unit's `verify:` command
112
+ autopilot verify docs/GOAL.md --run-verify --at-commit --unit-age # …at the unit's own commit; date each tick by its line
113
+ ```
114
+
115
+ Each `[x]` unit is **VERIFIED** when its `done: <sha>` is a real commit no older than the goal file, and **CLAIMED** otherwise. A plain checklist works too: ids are optional, and a tick like `- [x] Add the parser (commit 3fb69ae)` is read as well. Ticks that share one sha, point at an empty commit, only touch the goal/progress files or are off `HEAD` are flagged as suspicious. Exit code 0 means every tick is proven, so it works as a CI check. There's a [GitHub Action](docs/reference/github-action.md) for that, with a job-summary table and a PR-comment output. Details in the [CLI reference](docs/reference/cli.md#verify).
116
+
117
+ ## How it fits with other tools
118
+
119
+ **autopilot works with herdr, tmux and cmux; it doesn't replace them.** A terminal or multiplexer keeps your agents *alive*. autopilot is the layer that makes an agent *finish a goal and prove it*. Run autopilot inside the terminal you like, or headless without one.
120
+
121
+ | | What it is (in its own words) | Where autopilot differs |
122
+ |---|---|---|
123
+ | [herdr](https://github.com/herdrdev/herdr) | "the runtime your coding agents live on": persistent sessions with working/blocked/idle state per pane | A first-class autopilot [backend](docs/reference/backends.md#herdr). autopilot reads herdr's agent state and adds the goal contract, git proof and the morning report. |
124
+ | [herdr-auto-pilot](https://github.com/0xGosu/herdr-auto-pilot) | a herdr plugin that supplies the next prompt or answer when an agent needs input, and can hand out checklist items | autopilot checks every tick against git and waits out usage limits. |
125
+ | [Ralph loop](https://ghuntley.com/ralph/) / [ralph-loop plugin](https://github.com/anthropics/claude-plugins-official/tree/main/plugins/ralph-loop) | a bash loop (or Stop hook) that feeds the same prompt back until a completion phrase or an iteration cap | The same core idea, plus fresh context per cycle, git-verified ticks, limit handling, stall recovery and a report. |
126
+ | [firstmate](https://github.com/kunchenguid/firstmate) | "an agent distro for running a crew of agents" in worktrees, returning PRs, with an away mode and status reports | firstmate orchestrates a crew. autopilot runs one bounded lane per goal and audits it against git. |
127
+ | [claude-squad](https://github.com/smtg-ai/claude-squad) / [Conductor](https://conductor.build) | run several agents in parallel, each in its own worktree, and review the diffs | Built for parallel, supervised sessions. autopilot is for unattended runs you review in the morning. |
128
+ | Claude Code [`/loop`, `/goal`, scheduled tasks](https://code.claude.com/docs/en/scheduled-tasks) | re-run a prompt in a session, judge a goal condition from the transcript, or run on a schedule in the cloud | autopilot runs on your machine against your repo and judges progress by git, not by the transcript. |
129
+ | [Codex cloud / `codex exec`](https://learn.chatgpt.com/docs/cloud) | cloud tasks that keep working while your computer sleeps, plus a non-interactive CLI | `--agent codex` runs a headless lane on `codex exec` ([details](docs/reference/backends.md#codex-cli---agent-codex)). `--agent gemini` does the same on Gemini CLI ([details](docs/reference/backends.md#gemini-cli---agent-gemini)). Git-verified progress doesn't depend on the agent. |
130
+ | [LifeOS](https://github.com/danielmiessler/LifeOS) | "The AI-Powered Life Operating System" (formerly PAI) | LifeOS / PAI-style setups steer how an agent thinks; autopilot checks what it actually finished, and they can run together. `autopilot init` keeps existing hooks intact. |
131
+
132
+ Descriptions are taken from each project's README or docs, as of 2026-11-28.
133
+
134
+ ## Docs
135
+
136
+ - [Docs home](docs/index.md)
137
+ - [How it works](docs/how-it-works.md): cycles, the supervisor, VERIFIED vs CLAIMED
138
+ - Reference: [CLI](docs/reference/cli.md) · [Backends](docs/reference/backends.md) (herdr, tmux, cmux, headless) · [Hooks](docs/reference/hooks.md) · [Configuration](docs/reference/configuration.md) · [Goal file](docs/reference/goal-file.md) · [Dashboard](docs/reference/dashboard.md) · [Claude Code plugin](docs/reference/claude-plugin.md) · [herdr plugin](docs/reference/herdr-plugin.md)
139
+ - [Contributing](CONTRIBUTING.md) · [Changelog](CHANGELOG.md) · [Security](SECURITY.md)
140
+
141
+ ## Status
142
+
143
+ v3 is pre-release: macOS and Linux, Python 3.9+, Claude Code first, Codex CLI and Gemini CLI headless (`--agent codex`, `--agent gemini`). Notifications via ntfy, Slack/Discord webhooks, Telegram or the desktop. The supervisor can run as a launchd agent (macOS) or a systemd user unit (Linux), and it restarts a headless runner that died.
144
+
145
+ MIT licensed.
@@ -0,0 +1,6 @@
1
+ """autopilot — run coding agents unattended through bounded cycles and keep only the progress git can prove.
2
+
3
+ The modules stay importable as plain files too (the hook commands run `python3 …/core.py`), so the package has no
4
+ import-time side effects here.
5
+ """
6
+ __version__ = '3.0.0'
@@ -0,0 +1,7 @@
1
+ """`python -m autopilot …` = the `autopilot` console script."""
2
+ import sys
3
+
4
+ from autopilot.cli import main
5
+
6
+ if __name__ == '__main__':
7
+ sys.exit(main())