← Reddit

Keeping a Claude Code session running 24/7 (and accessible from my phone) without leaving the terminal

Reddit · edc1591 · May 5, 2026
Leo is a process supervisor and scheduler for the Claude CLI that enables persistent terminal sessions to run continuously, featuring tmux-based process management, integration with multiple messaging channels like Telegram, and cron-driven scheduled tasks. The tool allows users to spawn ephemeral coding agents from templates and manage them via a web dashboard and HTTP API, with support for personality and operating rules stored in custom configuration files. Leo is available for macOS and Linux and requires only an authenticated Claude CLI and tmux installation.

Detailed Analysis

A developer operating under the handle blackpaw-studio has released Leo, an open-source process supervisor and task scheduler built specifically around Anthropic's Claude Code CLI. The tool addresses a fundamental limitation of terminal-based AI agent workflows: session persistence. When a terminal window closes, any active Claude process terminates with it. Leo solves this by running Claude instances inside managed tmux sessions with automatic restart logic, effectively transforming what is normally an interactive command-line tool into a continuously available background service. The project ships with a web dashboard, a token-authenticated HTTP API, an MCP server, and a thin SSH client layer, allowing users to manage remote agent sessions from any machine without leaving the terminal environment.

The architecture reflects a deliberate philosophy of composability over integration. Leo does not ship its own messaging layer; instead it exposes a channel plugin system through which users can wire third-party communication surfaces — Telegram, iMessage, Discord — to their persistent Claude agents via the `--channels` flag already present in the Claude Code CLI. This design means Leo's core remains messaging-agnostic while still enabling rich use cases: answering queries from a phone via Telegram, firing daily briefings through cron-scheduled prompts loaded from files, or spawning ephemeral coding agents pre-cloned into specific Git worktrees. The cron scheduler accepts standard syntax and supports file-based prompt injection with optional failure notifications through any configured channel.

The project speaks directly to a growing class of power users who treat Claude not as a chatbot to visit but as a persistent computational collaborator embedded in their existing infrastructure. The author explicitly notes that running Claude in tmux preserves shell environment, dotfiles, and MCP server configurations — context that would otherwise need to be re-established or synchronized across the web and desktop surfaces Anthropic maintains. Identity and operating rules defined in a CLAUDE.md or custom subagent file travel consistently into every session Leo manages, removing the friction of maintaining parallel configurations across surfaces.

Broader patterns in the Claude developer ecosystem are visible here. Anthropic's decision to ship Claude Code as a CLI with extensible flags like `--channels` has enabled third-party tooling authors to build infrastructure layers that were not part of Anthropic's own roadmap. Leo is one of several community-built wrappers that treat the claude binary as a headless process to be orchestrated rather than a terminal UI to be used interactively. This mirrors historical patterns in developer tooling, where Unix-composable CLIs eventually attract supervisory layers — systemd for daemons, tmux and screen for terminal sessions, cron for scheduling — and the AI agent era appears to be producing analogous infrastructure at an accelerating pace.

The release also highlights the emerging demand for ambient AI agents that operate on schedules and respond to asynchronous triggers rather than waiting for synchronous human prompts. Use cases like inbox sweeps, daily briefings, and on-demand coding agents launched against specific repository branches represent a shift from conversational AI toward agentic AI infrastructure. The fact that a single developer built and has been running this system reliably for weeks suggests the Claude CLI's stability has matured to a point where persistent, unsupervised deployments are practical — a precondition for the broader category of always-on personal AI infrastructure to develop outside of Anthropic's own managed surfaces.

Read original article →