Guides

Let Claude Code work overnight: the prompt, the setup, and the morning check

Claude Code can keep working while you sleep, but only if three things are settled before you go: a plan you both agreed on, permissions that let it run the plan and nothing it can’t undo, and a prompt that says when to stop and what to leave you. In the morning, ask for a short report before you read any code. Both prompts are below, word for word, with the checks that decide whether you wake up to finished work or to a session that stopped at its first question.

The prompt I send before I go to bed

Send it after the plan is agreed, in the same session. Change nothing, or change the tone; the structure is what works.

I'm done for today. You're not.

Keep working through the night. Follow the plan step by step, and run the tests after each one.

Stop only if it's critical: something you can't undo, or a change to the plan itself. Then write the question at the top of your notes and wait for me.

Everything else, decide yourself and write down why.

Commit what works. Leave what doesn't on a branch, with a note.

In the morning, show me what you finished, what broke, and where to start, small enough to start with a coffee.

Thanks. See you tomorrow.

Before you go to bed: five checks

  1. A plan with a check for every step. Agree on it in plan mode first. “Done when the tests pass” is a check; “make it better” isn’t. A night without a plan is a night of guessing.
  2. Its own worktree. Start the night’s session with claude --worktree night-run: a separate checkout on its own branch. Nothing it does at 3 a.m. touches the code you open in the morning, and throwing the night away is one command.
  3. Permissions for the plan, and nothing more. A session that stops at its first permission prompt waits there all night. Auto mode is the simplest fix: a separate model reviews each action before it runs, so routine steps go through without you. Since version 2.1.283 it’s where interactive sessions start; Shift+Tab switches to it otherwise. Anthropic’s own docs say it reduces prompts but doesn’t guarantee safety, so add deny rules for what must never happen (below).
  4. A Mac that stays awake. A sleeping Mac stops the session. In the Claude desktop app, turn on Keep computer awake (Settings → Desktop app). In a terminal, run caffeinate -i in a second tab and stop it in the morning. Either way, leave the lid open and the charger in: closing the lid puts the Mac to sleep anyway.
  5. Room in your limits. A night uses your plan’s usage like any other session. On a subscription, an open session that hits the 5-hour limit waits and carries on by itself once the window resets, up to three times. If the Mac slept more than about half an hour past the reset, it waits for you to press Enter (how the limits work).

Deny rules beat every allow rule, in every mode. Put them in the project’s .claude/settings.json:

.claude/settings.json

{
  "permissions": {
    "allow": [
      "Bash(npm test *)",
      "Bash(npm run build *)"
    ],
    "deny": [
      "Bash(git push *)",
      "Bash(npm publish *)",
      "Edit(/migrations/**)"
    ]
  }
}

A rule matches the command as it’s written: Bash(git push *) won’t catch git -C . push. So a deny rule is a guardrail, not a lock. And skip --dangerously-skip-permissions on your own Mac: the docs say to use it only in containers or virtual machines.

Last thing before you leave, run /status. Since version 2.1.327 it lists the permission settings Claude Code ignores and hook matchers that never match. A rule it ignores protects nothing, and tonight is the time to find out.

Where to run it

If you leave the session open, Remote Control lets you see it and answer it from the Claude app on your phone: type /remote-control in the session before you go. Use it for the one question that would otherwise cost the whole night, not to keep checking. The point of the night is that you sleep through it.

What not to leave it overnight

The prompt I send in the morning

Before you open a single file, ask for the report. It’s faster to read than the diff, and it tells you where to look first.

Good morning. Before I read the code:

What you finished, one line each.

What broke, and what you tried.

Every important decision you made without me, and why.

The one thing I should look at first.

Keep it short enough to read with a coffee. Don't start anything new until I reply.

Then check it the way you’d check a colleague’s work:

Where Meowdoro fits

We built Meowdoro, a focus timer around the MacBook notch for people who work with Claude Code and Codex. In the morning the notch shows each session at a glance: which one finished, which one failed, and which one has been waiting for your answer, with the question it’s waiting on. A click takes you to it. Try it and tell us what’s missing.

Questions

Can Claude Code run overnight?

Yes. Leave the session open on an awake Mac with an agreed plan, auto mode or allow rules for the plan, deny rules for what it must never do, and a prompt that says when to stop. Or use a cloud scheduled task, which runs with your laptop closed.

Does Claude Code keep running when my Mac sleeps?

No. Turn on Keep computer awake in the Claude desktop app, or run caffeinate -i in the terminal, and leave the lid open.

What happens when it hits the usage limit at night?

On a subscription, an open session waits and continues by itself after the 5-hour window resets, up to three times. If the Mac slept long past the reset, press Enter in the morning.

Is it safe to use --dangerously-skip-permissions overnight?

Anthropic recommends it only in containers or virtual machines. On your own Mac, use auto mode with deny rules for anything you can’t undo.

What if Claude has a question at 2 a.m.?

It waits for your answer. The bedtime prompt keeps those questions to the critical ones, at the top of its notes. Answer in the morning, or from your phone with Remote Control.

How permission modes and rules, worktrees, the wait at a usage limit, scheduled tasks, Remote Control and checkpoints work: the Claude Code documentation on permission modes, permissions, cloud scheduled tasks, desktop scheduled tasks, Remote Control, interactive mode and checkpointing, read on November 18, 2026. What /status lists: the Claude Code changelog, version 2.1.327, read on November 19. caffeinate is a standard macOS command. The two prompts are the ones from our Instagram reels.