@mostlyhuman/nightswatch
v0.3.12
Published
An autonomous agent to hold your fort while you're asleep
Readme
Night's Watch
Autonomous overnight GitHub maintenance agent powered by Claude. Finds TODOs, outdated dependencies, failing CI, and open issues — fixes them while you sleep, then sends a morning summary.
How it works
Night's Watch runs inside GitHub Actions on a schedule. It uses two Claude agents — an implementer and a reviewer — with GitHub Issues as the work queue and labels as the state machine.
scan (hourly)
→ finds TODOs, outdated deps, failing CI, open issues
→ creates GitHub Issues labeled nightswatch:queued
implementer (triggered by label)
→ reads issue, creates branch nightswatch/issue-<N>
→ writes fix, runs tests
→ opens PR labeled nightswatch:reviewing
→ if stuck → labels nightswatch:blocked, pings you
reviewer (triggered by PR)
→ reads diff + original issue
→ approves or requests changes
→ after max cycles without resolution → escalates to blocked
on approval:
auto_merge → merges the PR automatically
request_review → pings you, leaves PR open for final sign-off
report (7am daily)
→ posts a GitHub Issue with overnight summarySetup
npx @mostlyhuman/nightswatch@latest initThis creates .github/workflows/nightswatch.yml in your repo. Then:
- Add
ANTHROPIC_API_KEYas a GitHub Actions secret - Optionally add
.nightswatch.ymlto customize behavior - Commit and push
Configuration
Create .nightswatch.yml in your repo root:
max_issues_per_run: 3 # cap issues created per scan (default: 5)
scanners:
todos: true # find TODO/FIXME comments
dependencies: true # find outdated npm packages
ci: true # find failing GitHub Actions workflows
issues: true # pick up open GitHub issues
agents:
implementer_model: claude-opus-4-6
reviewer_model: claude-opus-4-6
max_review_cycles: 3 # escalate to blocked after N cycles
on_approval: auto_merge # auto_merge | request_review
# Per-scanner override:
# on_approval:
# todos: auto_merge
# issues: request_review
notify: "@your-github-username" # who to ping on blockers
report:
create_issue: true # post morning summary as a GitHub IssueLabels
Night's Watch creates these labels automatically on first run:
| Label | Meaning |
|---|---|
| nightswatch:queued | Issue is queued for implementation |
| nightswatch:implementing | Agent is actively working |
| nightswatch:reviewing | PR is open, reviewer running |
| nightswatch:changes-requested | Reviewer left comments, reimplementing |
| nightswatch:approved | Reviewer approved |
| nightswatch:blocked | Human intervention needed |
Requirements
- GitHub Actions enabled
ANTHROPIC_API_KEYsecret set in your repo- Node.js 20+
License
MIT
