The Captain's Log
Every night at 4am, while I'm asleep, Claude Code writes my diary.
I call it the captain's log. It's a scheduled job on my Mac that runs Claude in headless mode, reads the git history across six of my projects, checks which files changed, skims the day's AI session transcripts so it knows what I was trying to do and not just what got committed, then reads its own previous entries so the story stays continuous. And it writes the day up in first person. As me.
What it writes
The window it covers runs 4am to 4am, not midnight to midnight, because my days don't end at midnight. One recent entry opens with an events-page redesign in the morning and closes with a six-way branch split at 2:50am. A calendar day would cut that story in half.
A real opener from March reads, "Long session. Three projects, zero commits. Everything moved forward, nothing is merged." Then it tells the story. What I was trying to build, where I pivoted, the 20-minute bug that felt like an hour, and where everything stood when I finally went to bed. No cheerleading is a standing instruction. If I spent an hour debugging something stupid, the log says that.
The prompt that writes it carries the same style guide as everything I publish. No em dashes, no aphorism endings, no anaphora. My diary has an editor.
Why I keep it running
The obvious reason to do this is memory. The pivots, the frustrations, the dead ends that never make it into a commit message. That's the stuff you'd never write down yourself but wish you had, and it evaporates by the weekend if nobody catches it.
It also doubles as a recovery file. When I've pushed too far on a project without updating its CLAUDE.md and everything's spaghetti, the last few entries are what I hand the next agent to get up to speed. The diary is documentation that wrote itself.
The part I didn't expect is that it compounds. The essay I published today, Direction Is the Only Scarce Variable, came from reading June's entries back and noticing that the building barely registers anymore, the entries are all verdicts. 81 entries in, the log stopped being a diary and became source material.
Set it up yourself
Paste this into Claude Code and answer its three questions. Takes a few seconds.
Set up a persistent daily captain's log via macOS launchd that runs at 4am every day:
1. Create a launchd plist at ~/Library/LaunchAgents/com.captains-log.plist
2. Find my claude binary path with `which claude`
3. Every day at 4am, run claude in headless mode (-p flag) with this prompt:
"Write a captain's log for the previous 24 hours. Look at the git log for
the last 24 hours (all branches), read any existing log files in [LOG_DIR],
and check recent file modifications across my projects. Write it in first
person, as me. Narrative style, not bullet points. Tell the story of the
day: what I was trying to do, what worked, what didn't, where I pivoted,
where I got stuck. Capture the momentum and the frustrations. Include
specific details: file names, feature names, the actual problems I hit.
Structure it roughly chronologically but group related work together.
Start with a one-line summary of the day's vibe. End with where things
stand, not what to do next, just the state of play. Keep it honest and
concise. No filler, no cheerleading. If I spent an hour debugging
something stupid, say that. If I shipped something cool, say that too.
Save it as [LOG_DIR]/YYYY-MM-DD.md"
4. Use --allowedTools "Read,Write,Edit,Bash,Glob,Grep" so it runs unattended
5. Log stdout/stderr to /tmp/captains-log-*.log
6. Load it with launchctl
Before starting, ask me:
- Which project directory to run in (cd into before running claude)
- Where to save the log files
- My name (for the first-person voice)
Make it a dashboard
The log has a sibling. A second job runs before I wake and turns yesterday into a morning brief, a page I open with coffee. A two-sentence headline of where things stand, a plan for the day split into housekeeping and build-next, one green card for what went right, one red card for what could be better, and the insights underneath.
The recipe is short. Give a second scheduled job the same evidence, yesterday's log plus the git history, but ask for structured JSON instead of narrative, with fields for the headline, the plan, the two cards, and the insights. Save one file per date. Then ask Claude Code to build a single local page that reads the folder and renders it with a date switcher, headline on top, plan as two columns, green card, red card. Mine took one prompt to build. Nothing is deployed, it runs on localhost, and the log stays the source of truth.
Tonight at 4am it runs again. Tomorrow's entry will say I spent part of the day writing about it.