Sleeping chats: less memory, same history
Idle Shuriken chats sleep after 20 minutes: the agent process closes to free memory, and your next message wakes it. What 5.1 adds to sleep.
Contents
A chat in Shuriken that has sat idle for 20 minutes goes to sleep. Its agent process closes and gives its memory back. The chat stays where it was, with every message, and your next message wakes it on the same session. Chats that are running, waiting for you or holding a queue never sleep. Sleep has been in Shuriken since 29 September, the day of the first prereleases; 5.1 adds an on/off switch, reading without waking, and a cap on what sleeping chats keep in memory.
The problem: forty chats, all of them awake#
Any chat can work on its own branch and worktree, and Shuriken puts no cap on how many you run. We took ourselves up on that first. A normal afternoon of building Shuriken turned into twenty or forty chats across a few projects, most of them finished an hour ago and still sitting there.
Every one of those chats had a live agent process behind it: a Claude Code, Codex or Gemini CLI waiting for its next prompt. One idle CLI doesn't weigh much. Forty of them do, and your laptop's fan is the first to tell you. "Why is this using so much memory when nothing is happening?" had one honest answer: because nothing was ever let go.
So sleep was one of the first things we built, back in September. In 5.1 we went back and finished the job.
What sleeping does#
Once a minute, the background service looks for chats that may sleep. A chat goes to sleep when all of this is true:
- nothing has happened in it for 20 minutes (no messages, no output, not opened);
- it isn't running a turn;
- it isn't waiting for your approval or an answer;
- it has nothing in its queue;
- its subagents and background commands (a dev server it started, a test run) have finished;
- it isn't the chat on your screen;
- its agent can pick up a saved session later.
That last rule matters. A chat whose agent can't resume a session stays awake, because closing it would lose the thread. Sleep only happens when waking is safe.
When a chat sleeps, Shuriken closes its agent process. That's all. The chat's record, its history and the agent's saved session stay on your computer. The chat's tab and the sidebar say Sleeping, and hovering it tells you the rest: "wakes on your next message".
Waking up#
Send a message and the chat wakes. The agent starts again on the same session it had, so it remembers the conversation, the files it read and the plan it was following. You'll notice a short pause while the agent starts. That's the whole price.
New in 5.1: reading doesn't count. You can open a sleeping chat, scroll its history and copy something out of it, and it stays asleep. Only a message wakes it. The exception is a chat whose history the service no longer holds in memory, after a restart or on a very busy day (more on that below): opening it wakes it to read the history back.
Change the time, or turn it off#
Sleep is on by default. In 5.1, Settings › Chat has it as a switch. Like the other settings there, it applies to all your computers and servers:
- Sleep idle chats: the switch. Off means no chat sleeps, ever.
- Sleep after: 10, 20, 30, 60 or 120 minutes. 20 is the default.
Turn it off and later back on, and Shuriken brings back the time you had before.
If you run a big server with memory to spare, a longer time is fine. On a 16 GB laptop with a browser, an editor and a dozen chats, 10 or 20 is kinder.
How this relates to "Connection lost"#
In October, Shuriken 5.0 could stall chats on "Connection lost" while the app reloaded. We wrote up the cause in Why chats said "Connection lost": loading one very long chat's history could freeze the background service, and its restarts interrupted running agents.
Sleeping chats are a separate change, but they share the theme. The service keeps a sleeping chat's messages in memory so that opening it is instant and doesn't wake it. Before 5.1, nothing capped the total of what all sleeping chats kept. In 5.1 there is a total: past it, the chats that have slept longest let their copy go, and the next time you open one it wakes and reads its history back. Together with history that now loads in bounded memory, that's why the background service no longer runs out of memory on a big day.
So, two kinds of memory, two fixes:
| What held memory | What 5.1 does |
|---|---|
| An idle agent process per chat | Closes it after 20 idle minutes (you choose) |
| Messages kept for sleeping chats | Keeps them within one total; the longest asleep let go first |
| Loading a very long history | Reads it in bounded memory, with a guard that stops before the service runs out |
Why not just close chats?#
We could have asked you to clean up. We don't think a tool should make you manage its memory. Finished chats are useful: you come back to them, fork them, ask a follow-up a day later. Sleeping keeps every chat one message away, without paying for forty idle processes in the meantime.
It also fits how Shuriken is built. Agents run on your own computers and servers, through the background service, so memory on those machines is yours to spend. We'd rather it go to the chats that are working.
Sleeping chats work on Mac, Windows, Linux and servers, and the switch, reading without waking and the memory cap come with Shuriken 5.1. If you run a lot of chats at once, running agents in parallel has more on keeping a big setup calm. New to Shuriken? Try it here.
Frequently asked questions
Do I lose anything when a chat sleeps?
No. Only the agent's process closes. The chat, its history and its saved session stay, and your next message picks the same session back up.
Which chats never sleep?
A chat that is running, waiting for your answer, has messages in its queue, has subagents or commands still going, or is open on your screen stays awake.
Can I change when chats sleep, or turn it off?
Yes. Settings › Chat has a Sleep idle chats switch and a Sleep after choice of 10, 20, 30, 60 or 120 minutes. The default is 20 minutes.
Can I read a sleeping chat without waking it?
Usually, yes. In 5.1, opening a sleeping chat shows its history and leaves it asleep. A chat that slept through a restart, or let its copy go on a busy day, wakes to read its history back.