# Background service: agents run with the app closed

> Close the app and Claude Code, Codex and your other agents keep running in Shuriken's background service. Install it once in Settings › Devices.

Source: https://shuriken.sh/features/background-service

Close the app and Claude Code, Codex and your other agents keep running in Shuriken's background service. Install it once in Settings › Devices.

By Shuriken Updated 27 October 2026 4 min read

**Contents**

A coding agent started in a terminal usually lives as long as that terminal does. That's why people keep tmux sessions around or leave a window open "just until it finishes". Shuriken has a background service instead: your agents run in it, and the app is just the window you look at. Close the app, and Claude Code, Codex and the rest keep working.

## What it does #

Shuriken always ran your agents in a small program next to the app (a daemon, if you like the word), separate from the window. The background service makes that program part of your computer rather than part of the app.

So when you close the app, chats, the queue and every running turn carry on, and when you open it again everything is where it was. The service is already there when you sign in to your computer, and if it stops, it restarts by itself. Your phone and your other computers reach it through Shuriken like before, so a chat that's running with the app closed is a chat you can read and answer from the [web app](https://shuriken.sh/features/phone).

We kept hearing the same story: you quit the app to get your screen back, come back an hour later, and the refactor stopped where you left it. Shuriken 3.2 fixed that, on 17 October 2026.

## Closing the last window never stops running work #

Even without the service installed, closing Shuriken's last window doesn't stop anything. It hides the app, and running work carries on. Quitting is the one thing that would stop agents the app runs itself, and Quit asks first.

With the service installed, even Quit leaves your agents alone: they belong to the service, not to the app.

## Turn it on in Settings › Devices #

- Open Settings › Devices. The first card is This device.
- Under Background service, press Install. Shuriken may also offer it once with "Keep agents running when Shuriken is closed?"
- Watch four short steps: Downloading, Installing, Starting, Checking it runs. The card then says "This computer's agents keep running when Shuriken is closed".

The download is checked: if the service doesn't pass its signature check, nothing is installed, and the card says so. Installing moves this computer's agents to the service, so running agents restart once and the turns running at that moment stop. Shuriken asks first whether to install anyway or wait until they finish. If the install fails, nothing changes: Shuriken puts things back and runs as before.

## How it runs on each system #

| | macOS | Windows | Linux |
| --- | --- | --- | --- |
| Runs as | You, with your own sign-ins | You, with no window | You, as a user service |
| Starts | When you sign in to the Mac | When you sign in to Windows | With the computer, where allowed |
| If it stops | Restarts by itself | Restarts by itself | Restarts by itself |

On Linux, keeping agents running after you sign out needs a setting called lingering. Shuriken turns it on when your system lets it. When it needs an administrator, Shuriken shows you the one command to run.

## It updates itself, politely #

When a new version is ready and no agent is in the middle of a turn, the service updates and restarts. When agents are running, it waits: "Update for this computer is ready. Agents are running; it restarts when they finish." You can press Update now if you'd rather not wait.

## One computer is one device #

Installing the service doesn't turn your laptop into a second device. It runs the app's own setup: the same sign-ins, the same chats, the same projects. Your device list still shows one card for the computer, and it says "Background service" on it.

If the computer already runs Shuriken as a [server](https://shuriken.sh/server), the app attaches to that instead, and there's nothing to install.

## Add Cocaine mode to keep the computer awake #

The service keeps agents running while the computer is on. It can't stop the computer from going to sleep, and a sleeping computer runs nothing.

That's the job of Cocaine mode, which keeps the computers you pick awake. On a Mac that includes running with the lid closed ([why it's called that](https://shuriken.sh/blog/cocaine-mode-yes-really)). Put the two together and you get the scene we built this for: close the app, close the lid, and the agents are still typing. Our guides to [keeping Claude Code running with the lid closed](https://shuriken.sh/guides/keep-claude-code-running-lid-closed) and [running Claude Code overnight](https://shuriken.sh/guides/run-claude-code-overnight) walk through the rest, like power and the network.

## Good to know #

The computer has to be on: turned off, asleep or out of battery means no agents. For a machine that should always answer, a [server](https://shuriken.sh/server) is the calmer choice.

The service uses your agents' memory: it runs the same agents the app would. Since Shuriken 5.1, chats idle for 20 minutes go to sleep and free their memory, and one very large chat no longer runs the service out of memory. There is one service per computer: a service set up for another Shuriken folder on the same computer is reported, not replaced.

If you've ever left an app open on the desk "just so the agent finishes", [download Shuriken](https://shuriken.sh/download) and close it instead.

Share

[X](https://x.com/intent/post?url=https%3A%2F%2Fshuriken.sh%2Ffeatures%2Fbackground-service&text=Background%20service%3A%20agents%20run%20with%20the%20app%20closed)[LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fshuriken.sh%2Ffeatures%2Fbackground-service)[Hacker News](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fshuriken.sh%2Ffeatures%2Fbackground-service&t=Background%20service%3A%20agents%20run%20with%20the%20app%20closed)[Reddit](https://www.reddit.com/submit?url=https%3A%2F%2Fshuriken.sh%2Ffeatures%2Fbackground-service&title=Background%20service%3A%20agents%20run%20with%20the%20app%20closed)[E-mail](mailto:?subject=Background%20service%3A%20agents%20run%20with%20the%20app%20closed&body=https%3A%2F%2Fshuriken.sh%2Ffeatures%2Fbackground-service)

## Frequently asked questions

**Does the background service use more memory?**

It runs your agents, so it uses the memory they use, as the app did before. It doesn't add a second copy: one computer runs one service, and the app attaches to it instead of starting its own.

**I already run Shuriken as a server on this computer. Do I need it?**

No. A server already keeps agents running without the app. Shuriken sees it, attaches to it and shows one card for the computer instead of two.

**How do I stop it?**

Settings › Devices, on This device: Remove. Agents then stop when Shuriken is closed, and the computer stays the same device with its chats and projects. Restart is on the same card.

**Does it keep my computer awake?**

No. It keeps agents running while the computer is on. To stop the computer from sleeping, even with a MacBook's lid closed, turn on Cocaine mode.

**Is it on the Free plan?**

Yes. The background service is part of every plan.

## Try Shuriken on your own computer

Add your Claude, Codex and Gemini accounts once. Shuriken switches between them so your agents keep working.

[Download](https://shuriken.sh/download)
[Pricing](https://shuriken.sh/pricing)

Coming soon

## Keep reading

- [Claude Code agent view: run background sessions: Guide 27 Oct 2026 8 min read Claude Code's agent view (claude agents) lists every background session. They survive a closed terminal and sleep; a reboot stops them until you reply.](https://shuriken.sh/guides/claude-code-agent-view)
- [Claude Code background tasks: dev servers and Ctrl+B: Guide 27 Oct 2026 7 min read Ask Claude Code to run a dev server in the background, or press Ctrl+B while it runs. List and stop it with /tasks; exiting Claude Code stops it.](https://shuriken.sh/guides/claude-code-background-tasks)
- [What's new in Shuriken 5.1: Update 27 Oct 2026 16 min read Shuriken 5.1 adds sign-in with Google, Apple or an email code, passkeys, Allow and Always allow at a MacBook's notch, and billing and fuel in Sources.](https://shuriken.sh/blog/shuriken-5-1)
- [Keep awake only while agents work: Update 27 Oct 2026 3 min read Keep your computer awake while an agent, the queue or a workflow runs, then let it sleep. Shuriken's two settings: While working and Always.](https://shuriken.sh/blog/keep-awake-while-working)
