Black Friday Deals For Authors Are On Now!

Leanpub Header

Skip to main content

Sleep-Driven Development

Master Claude Code in 21 Days and let your agent work the night shift, safely

Sleep-Driven Development
This book is 15% completeLast updated on 2026-12-01

Your coding agent can work while you sleep. This book teaches you to let it, without waking up to a disaster: 21 short days, one real project, and the guardrails that make autonomy safe.

Minimum price

$15.00

$19.00

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

EPUB
About

About

About the Book

Your coding agent can work while you sleep. The question is whether you can sleep while it works.

I run a Claude Code routine that wakes up at 1:47 every night, picks the next task from a plan, implements it, runs the tests and opens a pull request. Some mornings are great. Some mornings teach me something. Those lessons are in this book.

Sleep-Driven Development is a 21-day path from "I've tried Claude Code a few times" to "it works unattended, and I trust it", in any programming language.

WEEK 1, PAIR

The agentic loop, context, CLAUDE.md and memory, plan mode, tests as a leash, git and checkpoints, permissions.

WEEK 2, DELEGATE

Custom commands, skills, subagents, agents in parallel, MCP servers, hooks that enforce rules no prompt can override, and what it all costs.

WEEK 3, AUTOMATE

Headless runs, CI and automated review, scheduled routines, prompt injection, secrets, sandboxes and network rules, plugins for your team, and your own playbook.

WHAT MAKES IT DIFFERENT

- One project that grows every day: Ledger, a small expenses API and CLI that you build in the language you prefer from a one-page spec.

- Safety is not a chapter, it's the thread: every day ends with a "Guardrail of the day".

- A public companion repository with reference implementations and a kit of ready-to-copy CLAUDE.md files, skills, subagents, hooks and routines.

- Every day states the Claude Code version it was verified on, and the book is updated as the product changes. Updates are free for readers.

- A case study: one complete night shift on Ledger, from the issue to the pull request, with the rules, the logs, the costs and what went wrong.

WHO IT'S FOR

Working developers and tech leads, in any language, who want an agent to do real work without babysitting it, and without handing it the keys to everything.

This book is an independent publication and is not affiliated with, sponsored by, or endorsed by Anthropic, PBC. "Claude" and "Claude Code" are trademarks of Anthropic, PBC.

Author

About the Author

Matt

Hi, I'm Matt. I've been writing .NET since 2016 and work as a senior backend software engineer, mostly on e-commerce platforms and business management systems: the kind of software nobody notices when it works, and everybody notices when it leaks.

I write practical, code-first books for .NET developers who have a pentest report on their desk and a deadline on their calendar. Every vulnerability is reproduced, fixed and locked in with a test.

When I'm not at the keyboard, I'm at a different one: piano, or a guitar.

Contents

Table of Contents

  1. How to use this book
  2. Day 0: Why sleep-driven development
  3. Day 1: The agentic loop
  4. Day 2: Context is a budget
  5. Day 3: CLAUDE.md and memory
  6. Day 4: Plan mode (coming soon)
  7. Day 5: Tests are the leash (coming soon)
  8. Day 6: Git, checkpoints and worktrees (coming soon)
  9. Day 7: Permissions and settings (coming soon)
  10. Day 8: Custom slash commands (coming soon)
  11. Day 9: Skills (coming soon)
  12. Day 10: Subagents (coming soon)
  13. Day 11: Agents in parallel (coming soon)
  14. Day 12: MCP (coming soon)
  15. Day 13: Hooks (coming soon)
  16. Day 14: Models, cost and ergonomics (coming soon)
  17. Day 15: Headless mode (coming soon)
  18. Day 16: CI and automated review (coming soon)
  19. Day 17: Cloud sessions and scheduled routines (coming soon)
  20. Day 18: Prompt injection (coming soon)
  21. Day 19: Secrets, sandbox and network (coming soon)
  22. Day 20: Plugins and sharing (coming soon)
  23. Day 21: Your operating system (coming soon)
  24. Case study: One night shift, start to finish (coming soon)
  25. Appendix A: Cheat sheet (coming soon)
  26. Appendix B: Agent Smells
  27. Appendix C: Index of rules (coming soon)
  28. Appendix D: What changed (coming soon)

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub