← back to Lifestyle Asset Intel

.yolo/README.md

64 lines

# `.yolo/` — overnight autonomous loop

## What this is

A launchd-driven autonomous yolo loop that fires every 30 minutes and runs
ONE small focused tick on this project. Each tick is an independent
`claude --print` session — no memory of prior fires; reads `git log` for
history.

## Files

| Path | Purpose | Tracked |
|---|---|---|
| `tick-prompt.md` | What each fire should do — standing rules, candidate tasks, exit conditions | yes |
| `run-tick.sh` | Shell wrapper: lock + claude CLI + log append | yes |
| `yolo-loop.log` | Per-fire stdout+stderr + start/end markers | NO (gitignored) |
| `launchd-out.log` / `launchd-err.log` | launchd-level stdout/err | NO |
| `.lock.d/` | mkdir-atomic single-fire lock; auto-stolen after 12 min | NO |

## launchd plist

`~/Library/LaunchAgents/com.steve.lai-yolo.plist` (NOT in this repo;
~/Library is per-machine config).

Fires on `StartCalendarInterval` at minute `15` and `45` of every hour.
Default cooldown between fires = 30 minutes.

## Operate

```bash
# Status
launchctl list com.steve.lai-yolo

# Pause for the night
launchctl unload ~/Library/LaunchAgents/com.steve.lai-yolo.plist

# Resume
launchctl load ~/Library/LaunchAgents/com.steve.lai-yolo.plist

# Watch the log live
tail -f ~/Projects/lifestyle-asset-intel/.yolo/yolo-loop.log

# Force one tick now (respects the lock)
~/Projects/lifestyle-asset-intel/.yolo/run-tick.sh
```

## Why launchd over ScheduleWakeup

`ScheduleWakeup` requires the active Claude Code session to be alive —
closing the terminal kills the loop. launchd survives session close,
machine reboot (via the LaunchAgent registry), and any pm2 restart.
Mac sleep still pauses launchd; use `caffeinate -di` if you need
literal-overnight uninterrupted runs.

## Safety

- `--max-turns 12` per fire caps each tick's compute
- `unset ANTHROPIC_API_KEY ANTHROPIC_AUTH_TOKEN` per Steve's standing rule
  (Claude Max plan only, never the metered API)
- Lock prevents two fires from racing on git
- Each tick exits before the next fire window so commits don't pile up
- `tick-prompt.md` enumerates the standing-rule guardrails (no DNS,
  no email, no scraping non-public sources, etc.)