Cocaine mode: close the lid, agents keep working
Cocaine mode keeps the computers you pick awake while your agents work. On a Mac that means lid closed. Windows and Linux too, where the laptop allows.

Contents
Close the MacBook. Put it down. The agents keep working.
Cocaine mode keeps the computers you pick awake while Claude Code, Codex and the rest do their thing. On a Mac it keeps running with the lid closed. On Windows and Linux it does the same wherever the laptop lets it, and tells you plainly where it doesn't. It's a laptop that refuses to go to bed. Hence the name.
Why it exists#
You start a long task, then life happens: a train, a meeting, dinner. You close the lid. The computer goes to sleep, the agent stops mid-step, and an hour later the chat is exactly where you left it. You paid for a plan that sat there.
macOS ships caffeinate, which is good at stopping idle sleep. Closing a MacBook's lid is a different trigger, and on a normal setup the Mac sleeps anyway. Some keep-awake apps have settings for the lid; we compared the keep-awake apps people use for this, fairly, if you'd like to see the options. We wanted it built into the place your agents already run, for every computer you have, without anyone opening Terminal.
Pick which computers stay awake#
Press the syringe button in the top bar. (Yes. We're committed.) You get your devices, this one and every other computer you've linked, each with a switch.
Turn one on, and it stays awake until you turn it off. It doesn't have to be the computer in front of you: left the office laptop on a long task? Switch it on from the computer you're at. When Cocaine mode is on for this computer, a pill in the sidebar says so, with Turn off right there. You won't forget it's on.
The devices you turn on keep running chats and the background service, also with the lid closed.
Cocaine mode and Keep awake#
Cocaine mode has a quieter sibling. Keep awake, on each device's page, stops the computer from dozing off by itself while the lid is open. It has two settings:
- While working. Held while an agent, the queue or a workflow runs. The computer sleeps when there's nothing to do.
- Always. The device stays awake all the time, so it stays reachable. The screen can still turn off.
There's no Off. A device never sleeps while something in Shuriken is working. A computer signed in to Shuriken starts on Always, so your other devices can always reach it. A signed-out one starts on While working. Change it whenever you like.
Keep awake is the everyday setting, lid open. Cocaine mode is the one for closing the lid and walking away: once it's on, it holds until you turn it off. (Small naming clash we own: in the Cocaine mode picker, each device's switch is labelled "Keep awake" too. That switch is Cocaine mode's.) More on what counts as "working" in Keep awake only while agents work.
On a Mac: one password, once#
Running with the lid closed needs one setting on macOS that only an administrator can change. So the first time, the picker says "With the lid closed, it needs a one-time permission" and offers Allow. macOS asks for your password once, on that Mac.
After that, it just works. Changed your mind? Revoke permission takes it back.
On Windows and Linux: what your laptop allows#
Laptops have opinions, so we don't promise lid-closed on every one. Each device in the picker gets one plain line, read from the machine itself:
- "Keeps running with the lid closed"
- "Stays awake with the lid open. With the lid closed, it needs a one-time permission"
- "Stays awake. No lid setting found on this computer"
- "No lid: stays awake" (a desktop)
- "Can't stay awake: this system has no systemd-logind" (some Linux setups)
Windows: while Cocaine mode is on, Shuriken tells Windows not to sleep and sets your power plan's lid action to Do nothing. It writes down your old settings first and puts them back when you turn it off. If Shuriken stops unexpectedly, a small guard puts them back anyway.
Linux: Shuriken asks systemd-logind to hold off sleep, idle and the lid switch while it runs. Nothing permanent changes. When Shuriken stops, the hold goes with it.
Firmware, docks and company-managed power rules can still overrule an app. Try it once with a short task before you trust it with a whole night.
Good to know#
The fun name comes with grown-up advice. A closed laptop has less room to breathe: a desk or a shelf is fine, a duvet is not. Don't put a laptop that's working hard in a zipped backpack, where it has nowhere to lose heat. Agents running for hours use power like any heavy work, so plug in for long runs, and switch Cocaine mode off when the job is done, so a finished task doesn't drain the rest.
When Shuriken isn't running, your computer sleeps as usual: Cocaine mode only holds it while Shuriken runs. Quit, and normal life resumes. With no network there is no progress either: on a train the Wi-Fi drops in tunnels; a chat waits and carries on when the connection is back, but nothing works without one.
For a machine that should never sleep at all, a server is the calmer option.
About the name#
It's a joke about your laptop, not advice for you. We could have called it "Extended Power Management Preferences" and nobody would remember what it does by Thursday. You'll remember this one. The longer story is in Yes, it's called Cocaine mode, and the Mac walk-through, free options first, is in keep Claude Code running with the lid closed.
Cocaine mode is on every plan. Download Shuriken, close the lid, and let the agents keep working.
Frequently asked questions
Is Cocaine mode safe for my laptop?
It keeps the computer from sleeping, which is what it would do with the lid open and someone working. The risk is heat: give a closed laptop a hard, open surface, and don't run it zipped in a bag.
What does it do to my battery?
Awake means using power, so the battery drains as it would with the lid open and the same work running. Plug in for long runs, and turn Cocaine mode off when the job is done.
Does it work with the lid closed on Windows and Linux?
Where the laptop allows it. Each device in the picker says what it can do. Windows gets its lid action set to Do nothing while Cocaine mode is on; Linux needs systemd-logind.
Do I need the background service too?
They do different jobs. Cocaine mode keeps the computer awake; the background service keeps agents running after you close the app. Together, you can close both the app and the lid.
Is Cocaine mode free?
Yes. It is part of every Shuriken plan, Free included.
Try Shuriken on your own computerYou're signed in
Add your Claude, Codex and Gemini accounts once. Shuriken switches between them so your agents keep working.Your accounts, projects and chats are in the app.
