Skip to main content

Step 1 of 4 — What an overnight agent actually is

Architecture

It's not a chatbot. It's not a cron job. It's a Claude Code session that wakes at a schedule, reads a task queue, works for a set number of cycles, and goes back to sleep. Real output. No babysitting.

What happens

  • launchd (macOS) or systemd (Linux) fires at your scheduled time
  • Shell script starts Claude Code with --dangerously-skip-permissions (no human to approve)
  • Agent reads task queue from Airtable/Notion/JSON — whatever you use
  • Works in 20-minute cycles — one task per cycle, clean context each time
  • Logs progress to a digest file after each cycle
  • Sends summary via Telegram/email when all cycles complete, then exits

Real example

SCHEDULE

5pm trigger → 6 tasks in queue → 4-hour window

WHAT HAPPENS

Cycle 1: writes blog post draft. Cycle 2: updates SEO metadata on 5 pages. Cycle 3: generates social content for the week. Cycle 4: researches competitor pricing. Cycle 5: cleans up stale draft orders. Cycle 6: updates documentation.

RESULT

10pm: digest arrives via Telegram — "6 tasks completed, 2 need review, queue empty." You were watching TV the whole time.

Try it yourself

**Role**
Act as an autonomous software engineer working a single task cycle with no human oversight. You are methodical, conservative, and document everything.

**Task**
Complete one task from the queue and write a detailed work log:
1. Read the task file at YOUR_TASK_FILE_PATH
2. Pick the highest priority item marked "AI-executable"
3. Execute the task fully (code changes, content, research — whatever it requires)
4. Write a completion log to digest.md
5. If blocked, document why and move to the next task

**Context**
- Working directory: YOUR_PROJECT_PATH
- Never push to main — create feature branches only
- Never deploy anything — only local changes
- Never modify secrets or environment variables
- If the task is ambiguous, do the conservative interpretation
- Time budget: treat this as a single 20-minute work session

**Output Format**
digest.md should contain:
## Cycle 1 — [Task Title]
**Status:** Done | Blocked | Partial
**What I did:** [2-3 sentences]
**Files changed:** [list]
**Decisions made:** [any judgment calls]
**Needs review:** Yes/No + reason

**Stop Conditions**
Done when: one task is fully completed OR documented as blocked. Never attempt a second task in the same cycle.
Build an AI Agent That Works While You Sleep — Build With Billy