Building Products at 2am (While You Sleep)
I set my AI agent to work overnight. By morning, I had working code, documentation, and a PR ready for review.
Last Tuesday, I went to bed at 11pm with a problem: I needed to build a notification system for a project, and I was out of time during the day.
So I did something different. I wrote up a detailed spec, pointed my AI agent at the codebase, and told it to work on it overnight.
When I woke up, there was a pull request waiting. Working code. Tests passing. Documentation written.
This isn't science fiction. This is Tuesday.
The Setup
I run an AI coding agent that has access to my development environment. It can read files, write code, run tests, and commit changes. It knows my codebase, my conventions, and my preferences.
When I give it a task, it works through it methodically. It asks clarifying questions if needed (I answer them before bed). Then it executes.
The key is good specs. The clearer I am about what I want, the better the output. Vague instructions get vague results. Detailed specs get production-ready code.
What Works Well
Boring but important work is perfect for this. Migrations, refactors, adding tests, building CRUD endpoints, writing documentation. The stuff that takes time but doesn't require creative breakthroughs.
Last month, I had it reorganize an entire component library while I slept. 40+ files touched, consistent patterns applied, imports updated. Would have taken me a full day. Cost me zero waking hours.
It's also good for exploration. "Look at these three libraries and write up pros and cons for our use case." By morning, I have a decision document instead of spending my own time on research.
What Doesn't Work
Anything requiring real judgment calls about product direction. Anything where the "right answer" is subjective. Anything where I need to see the work evolve and course-correct in real time.
The agent is a skilled implementer, not a product thinker. It executes specs, it doesn't invent them.
I also don't trust it with anything customer-facing that I haven't reviewed. It can write the code, but I'm approving every PR before it ships.
The Real Benefit
It's not about replacing myself. It's about expanding my capacity.
As a solo founder, my bottleneck is time. There's always more to build than hours in the day. The agent lets me parallelize. While I sleep, progress happens.
Some weeks, I'm effectively two developers. One working during the day (me), one working at night (the agent). Neither of us is slowing down the other.
How to Start
You don't need a complex setup. Start with Claude or another capable model. Give it access to your codebase. Start with small, well-defined tasks. See what works.
The biggest unlock is learning to write good specs. Think like you're briefing a capable but literal-minded contractor. Be specific. Provide examples. Anticipate edge cases.
Then go to sleep. Wake up to progress.
It sounds too good to be true until you try it. Then it just becomes how you work.
Zack Massey
Founder and operator in music technology.
Enjoyed this post?
Subscribe to The Ledger for essays on building durable businesses and long-term competitive advantage.