amux
Run dozens of Claude Code agents unattended.
Python 3 + tmux. No build step, no external services.
$ git clone https://github.com/mixpeek/amux && cd amux && ./install.sh $ amux register api --dir ~/Dev/api --yolo && amux start api $ amux serve # → https://localhost:8822
How it works
-
Self-healing background watchdog — a thread snapshots every running session every 60s and intervenes silently: context below 20% → sends
/compact(5-min cooldown).redacted_thinking … cannot be modifiedin output → restarts and replays the last user message. Session stuck waiting for input for 2+ snapshots → auto-responds based on prompt type. All three are broadcast as SSE toast alerts. -
Status from terminal output, not an API — amux parses Claude Code's actual tmux output after stripping ANSI escapes. Unicode dingbat spinners (U+2700–27BF) + trailing ellipsis = working; "Enter to select" / "❯ 1. Yes" = waiting for input; completed spinner + "for Xm Ys" = idle. No hooks, no patches, no modifications to Claude Code whatsoever.
-
YOLO auto-responder —
--dangerously-skip-permissionsdoesn't skip everything: Claude Code still shows blocking tool-approval prompts. amux detects them by matching the "Esc to cancel" marker in terminal output (that string never appears on open-ended model questions) and auto-answers with "1" — keeping fully headless sessions actually headless. -
Agent-to-agent orchestration — every session gets
$AMUX_SESSIONand$AMUX_URLinjected at startup. The global memory file — shared across all sessions viaGET /api/memory/global— contains the full REST API reference. Any agent can discover peers, peek their output, post tasks, and delegate work without being explicitly programmed to do so. -
Atomic task claiming — no lock broker —
POST /api/board/:id/claimuses SQLite 3.35+UPDATE … RETURNINGas a compare-and-swap: the row only moves todo → doing if it's still unclaimed. A dozen agents can race for the same task queue with no Redis, no queue broker, no duplicated work. -
Single Python file, zero build step — ~12,000 lines: Python
ThreadingHTTPServerwith manual routing + the entire dashboard (drag-and-drop, IndexedDB, GridStack, SSE, service worker) as inline HTML/CSS/JS. Requires only Python 3 and tmux. Edit the file; it restarts itself viaos.execvon save. -
Parallel agents, permanent conversation IDs — any number of Claude Code sessions running simultaneously, each isolated in its own tmux pane with a UUID that survives stop/start. Start, stop, and message any agent via REST or the dashboard.
amux exec myproject -- "implement the login endpoint"registers, starts, and sends in one shot. -
Conversation fork — clone any session's full Claude Code JSONL history into a new session on a separate branch. Branch an exploration without losing the original thread. Falls back to tmux scrollback capture as context seed when JSONL isn't available.
-
Multi-pane workspace — full-screen tiled layout: watch multiple agents' live output side by side, each with its own send bar. Drag to rearrange panes; layout persists across reloads. Save and restore named workspace profiles.
-
Live peek — including stopped sessions — scroll any agent's full scrollback, search output, click file paths to open syntax-highlighted previews, and fire quick-actions without attaching to a terminal. Sessions snapshot to disk every 60s (10MB cap) so output survives server restarts.
-
Token tracking from JSONL — reads Claude Code's conversation logs to show daily token spend per session,
cache_read_input_tokensbroken out separately. Deduplicates log entries by(input, cache_read, output)signature so session restarts don't double-count. -
Kanban board with iCal sync — SQLite-backed task board with auto-generated issue keys (PROJ-1), per-agent ownership, due dates, and custom columns. Emits an RFC 5545 iCal feed that auto-uploads to S3 — tasks with due dates appear in Google Calendar and Apple Calendar with STATUS mapped from board columns.
-
Built-in cron — no crontab, no systemd — schedule one-time or recurring (hourly/daily/weekly/monthly) commands in any session. A 30s polling loop computes next-run atomically in SQLite (handles weekday + time, missed-fire recovery) and delivers via tmux.
-
Git-aware conflict detection — warns when two sessions share the same working directory and branch. Surfaces a visual warning on both cards and offers a one-click helper to create an isolated
session/{name}branch so agents don't overwrite each other's work. -
Web dashboard + PWA — installable on iOS and Android. Triple-layer persistence: Service Worker Cache API, localStorage (full HTML backup), IndexedDB (issue mirror). Background Sync replays queued commands on reconnect even if the tab is closed. Accessible over Tailscale, LAN, or localhost with auto-provisioned TLS (Tailscale cert → mkcert → self-signed fallback).