Sprite: stay awake with tmux

I want to use sprite with tmux and claude code. However, when I use tmux, the sprite doesn’t recognize activity and shuts down. Is there any way that sprite “sessions” and tmux can be integrated, or is there a solution to this otherwise? I’d like to be able to set claude to do something and leave for a few hours and come back to see the result

1 Like

Of note, through the Sprite CLI the sessions are detachable without running tmux. If you console or exec in, then you can detach with Ctrl+] (in the next CLI version this is changing to Ctrl+\.

You can then run sprite exec to see a list of sessions to reattach to. While any exec-ed process is producing stdout logs the Sprite is kept alive, so Claude will keep running to completion.

Yes, but then if you want to attach via termius on ios, how would you do this? You need an interactive shell to get the list of sessions.

I’m going to try the detach command. I’m using tmux with Claude Code right now and the results are oddly mixed. Claude clearly gets some work done while the session is detached, but then seems to stall out or freeze or something happens. Here’s an example from today:

● I'll conduct a thorough exploration of the [redacted] handling in this UI. Let me investigate all the relevant components, modals, and sidebars.

● Explore(Deep dive on HL handling in UI)
  ⎿  Done (41 tool uses · 67.8k tokens · 1h 50m 58s)

● Good start. Let me now read the key files directly to provide a more critical and detailed analysis.

Note that this deep dive took “1h 50m 58s”. I started it, detached, left my house, reattached when I got to my office. It was not running for the full 1h 50m, I can assure you the task was not that complicated (plus you’d see additional output for tool usage, compaction, etc., if this was actually a 2 hour task).

I will try the detach command you mentioned but I’m curious if the behaviour I’ve outlined here is expected?

Sprites stay awake when a process started via exec/console is writing stdout to its TTY. If that process exits, or it stops writing stdout, it will go idle.

If you attach with tmux, and then your attach process exits, the Sprite won’t know it’s active anymore. If you kill your local sprite client process while attached with tmux, that should detach in a way that keeps tmux hooked up to the proper tty.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.