Launch Day — My Sleep Book For Entrepreneurs
Sharing the behind-the-scenes on how I utilized Claude Code to publish the book.
Today is the day my sleep book comes out. You can buy it on my website or on Amazon. It’s available as an audiobook, paperback, hardcover and ebook.
I started writing this book in 2024 after a year of digging into all sorts of things to improve my sleep. When we started our venture fund in 2023, I noticed that my sleep started getting really bad. It was an extremely exciting time; I had never felt so excited in my entire life before about starting a new company like this, but at the same time the daunting unknowns were hitting me in a way that they hadn’t done before. I believe partially it is due to my burnout in 2019 that I had developed a more sensitive nervous system for stress, which meant that when stress was high it was higher than previously whenever I had been a founder, like during the times when I started my previous two games companies, Ironstar Helsinki and Next Games.
There were many realizations along that journey of understanding how to better my sleep. From sleeping environments to wind-down routines to supplements, apps, mattresses, and earplugs.
When I look back now on what I wrote in the book and all the experiences, I do feel that good sleep is then achieved by paying a price of leading a less stressful life. Now that I’m back in the entrepreneur’s role after several years building my AI startup, I feel that I had to make the decision of constant good sleep versus the startup, and I have now picked the startup. This book tells you that you can make those choices. But there’s also the possibility that you’re the person who can get enough benefits to enjoy being a crazy entrepreneur and still sleep well.
How I used AI to publish my book
I finished my sleep book manuscript early this year. I had 44,000 words and it was a lot of work ahead to get this out. My first book, which came out in 2020, was something where I hired at least three people to help me out with different self-publishing tasks which were very time-consuming. This time around I felt that we have AI capabilities to do a lot of the heavy lifting which comes after the manuscript is ready. Here’s a list of things that I applied with AI to publish my book.
I used Claude Code for all of this. I had the ideas, wrote the prompts and it implemented it the best way it could.
1. Markdown as the Foundation
The first decision I made was to convert the entire manuscript into plain text markdown files, one per chapter, managed in Obsidian. No Word documents, no Google Docs, no proprietary formats. Markdown is simple enough that an AI agent can read, search, and edit it without any compatibility issues. Every chapter, every endnote, every appendix lives in its own file. That meant Claude Code could operate on any part of the book at any time without me having to copy and paste text back and forth. It sounds like a small thing, but it made everything else on this list possible.
2. EPUB Creation (ebook)
I didn’t use Vellum or Atticus or any of the standard book formatting tools. Claude Code built the entire ebook pipeline from scratch. It wrote a preprocessor that converts my chapter files into Kindle-compatible HTML, handling epigraphs, section breaks, drop caps, and a custom table of contents. It took 12 rounds of iteration to get right. Kindle strips CSS classes, ignores small-caps, overrides text alignment on paragraph tags. Each of those was a dead end that Claude Code hit, diagnosed, and rewrote around. The final output is a 163KB EPUB with embedded fonts and bidirectional endnote links.
3. Print Interior
The print interior went through four proof cycles. The first version looked fine on screen but the body text was rendering at 9.68pt instead of 11pt in print, because neither Claude nor I knew that we had done something wrong: Chrome’s headless PDF generator, which we were using, was silently scaling the content to fit the page. Claude Code found the bug, constrained the viewport width to the exact content area, and regenerated. Every time the page count changed, it recalculated the spine width, updated both cover templates, and produced new PDFs. The final interior is 277 pages with industry-standard margins.
4. Audiobook
The audiobook was generated using ElevenLabs text-to-speech. Claude Code managed the entire production. It split each chapter into chunks, generated dual takes for each one, ran spectral analysis to pick the cleaner generation, then verified the output against the source text using Whisper transcription. If a chunk had artifacts or word errors, it flagged it and regenerated. The final audiobook is 30 tracks, just under 5 hours. It’s included in the website bundle.
5. Cover Design
I started with an AI image for the book cover from Google’s Nano Banana Pro and spent weeks dialing in the typography, based on what Nano Banana had picked for the book cover, since gen AI doesn’t really tell you that this is the font to use.
Claude Code built a 54-font specimen page so I could compare capital letterforms side by side. I picked Cormorant for its flared serifs on the A and its thick-thin contrast. From there it built HTML-to-PDF cover templates for KDP paperback and Lulu hardcover, each with precise bleed and spine calculations. Every time the page count shifted, the spine width changed, and the covers had to be regenerated. By the end I had print-ready PDFs for three formats: paperback, hardcover case wrap, and ebook.
6. Consistency Audit
Before locking the text, I needed to know whether the book contradicted itself. I felt like the text was fine and had read it multiple times, but I still had this nagging feeling that maybe there was too much repetition, or inconsistencies I was blind to.
Claude Code extracted 746 factual claims from all 33 files, cross-referenced them, and flagged 38 potential issues. After verification, 18 turned out to be real. Three were critical: a market size number that didn’t match its source, an alcohol timing recommendation that conflicted between chapters, and a heart rate threshold that was off. The rest were moderate things like meal timing inconsistencies and duplicate paragraphs. All fixed before text lock.
7. Endnote System
The book has 87 endnotes. I had most of the citations listed already, but I wasn’t confident I’d caught every claim that needed a source. Claude Code went through each chapter systematically, found the gaps, matched claims to the right studies, and wrote full academic-style citations for the ones I’d missed. It numbered them sequentially across the entire book, built a master mapping document, and added bidirectional hyperlinks in the EPUB so readers can tap a superscript to jump to the endnote and tap back to return.
8. Website
Sleepagain.co is a static HTML/CSS site. Claude Code built all of it. The homepage, the about page, the chapter list, the FAQ, and a podcast guest landing page. It handled all the technical plumbing to make the site discoverable by search engines and AI: structured data, social card previews, a sitemap, and crawler permissions. Later it added a free chapter lead magnet funnel, a Lemon Squeezy checkout for launch day, and a launch-day branch that I’ll merge on April 9.
9. TikTok and Instagram Carousels
I wanted to promote the book on TikTok and Instagram using carousel posts, the swipeable slide format that works well for short, visual content. I picked the topics, the humor styles, and the visual direction for each one. Claude Code handled the rest. It built the slides as HTML, screenshotted them in the right aspect ratios for each platform, and scheduled the posts via API. Over the course of a month we produced more than 30 carousels, over 240 slides total. I couldn’t have done that volume manually in the time I had. See on of the carousels here.
10. Sales Analytics Pipeline
I wanted a single daily KPI email that told me everything: site traffic, subscriber counts, and sales across every platform. Claude Code built it. It wrote a fetcher that pulls data from five APIs every morning: Kit for subscribers, Umami for analytics, Lemon Squeezy for direct sales, Apple Books, and Lulu. For platforms without APIs, like KDP, it built Chrome browser scrapers that log in and extract the numbers. Everything gets pushed to Supabase, and a GitHub Action assembles the daily email at 10 AM Helsinki time. I open my inbox and the full picture is there.
11. Google Drive Backups
I used Obsidian and Github as backups for the project, but I also wanted a third one. So I asked Claude Code to help me out.
I had over 200 files across the project: covers, audio tracks, research, marketing docs, distribution paperwork. Claude Code created a structured folder hierarchy on Google Drive, uploaded everything in two passes, and built a manifest-based sync script that detects new or modified files and pushes them. The manifest tracks each file’s Drive ID and last sync timestamp. I run one command and everything is current.
12. Finnish Translation
I’m publishing a Finnish edition in June. Claude Code built the translation pipeline. Each chapter goes through DeepL first (which is a text language translation tool), then Claude reviews the output against a locked glossary of Finnish terms that I’ve created. It highlights every change with == markers and writes a separate review file with a markdown table explaining each edit. I open both files side by side in Obsidian and go through them. Twenty-two chapters are done. The quality has been improving steadily. Early chapters had over ten flags each. Recent ones only average two or three, so it’s getting better over time.
13. ARC Campaign and Email Automation
The advance reader campaign ran entirely through Kit’s API. Claude Code tagged subscribers, scheduled broadcast emails, and sent reminders at each milestone. I drafted the email: the initial ask, the weekly check-ins, and the final “post your review on April 9” reminder. Then Claude scheduled them. When I needed to update a broadcast that was already scheduled, it hit the API to swap the content. No logging into dashboards, no clicking through forms. Just Claude talking with Kit’s API.
Final words
This book wouldn’t exist without the people around me. My family, for their patience through the early mornings and late nights. The founders who shared their sleep stories for the book: Julia Palatovska, Jenny Xu, Vlad Rannik, Emily Yim, Anders Leicht Rohde, Kristian Metzger, Martial Valery, and Robin Squire. Their honesty made it better.
The biggest thing I learned from this process is that the hard part of publishing a book isn’t any single task. It’s the sheer number of them. AI didn’t replace my judgment, but it let me act on it at a pace I couldn’t have matched alone.
Go get it: https://sleepagain.co







