Always-on workers

An always-on worker is a Claude Code session that keeps running on a server. You talk to it over Telegram from your phone. systemd restarts it after a crash, an out-of-memory kill or a reboot. Several workers can share one box, each with its own bot.

The full setup guide is docs/cli/ALWAYS-ON.md. This page is the overview and the things to decide first.

Before you start

  • Plan. Workers use your own Claude account. A Max plan is the realistic minimum for always-on use, or an API key. A Pro plan will hit limits fast. See FAQ.md.
  • Box. Ubuntu 22.04 or 24.04, 4 vCPU and 8 GB RAM or more. Gradle builds are the heavy part, and only one runs at a time per box (gradle-slot). More workers need more RAM, not more builds.
  • Safety. Workers run with skip-permissions. The guard hook must be active first. Read SAFETY.md.
  • Bots. One Telegram bot per worker, made with BotFather. You type the token into the terminal, never into a chat.

The short path

# as root
bash /opt/app-army/kit/installer/setup-vps.sh --user army --kit /opt/app-army/kit --firewall

# as the army user
claude                                   # sign in once, then /exit
bash /opt/app-army/kit/cli/army-init     # answer yes to Telegram; this wires the guard first
kappmaker-army doctor
kappmaker-army worker add main                     # paste the BotFather token at the hidden prompt

Then DM your bot. It answers with a pairing code. Run kappmaker-army worker attach main, type /telegram:access pair <code>, and leave with Ctrl-b d.

The worker runs claude --channels plugin:telegram@claude-plugins-official (the official Telegram plugin) inside tmux, under the systemd unit army-worker@main.service.

Day to day

Command Does
kappmaker-army worker list every worker: running, waiting or stopped; token present; paired
kappmaker-army worker status main one worker in detail
kappmaker-army worker attach main open the live session (Ctrl-b d leaves it running)
kappmaker-army worker logs main 100 journal plus the last lines of the live pane
kappmaker-army worker restart all restart through systemd
kappmaker-army worker add second a second worker with its own bot
kappmaker-army worker remove second --yes stop and disable (--purge also deletes the token and pairing)
kappmaker-army status load, build slot, claims, apps
kappmaker-army board link one-time link to the read-only project board

From inside a worker, "restart the bots" runs the bot-restart skill (kappmaker-army restart all --yes).

Several workers

Workers share ~/projects. They do not see each other's sessions. Three things keep them apart:

  • kappmaker-claim take <worker> <project> records who is on which app. If another worker had it, the new one asks you before it carries on. kappmaker-claim list shows the board.
  • gradle-slot lets one build run per box.
  • shared-write locks and commits writes to the shared factory and concepts folders.

worker-route handles front-desk routing: a message about an app another worker owns gets passed along.

Without systemd

On macOS, or a box where you are not root: kappmaker-army worker add <name> --no-service, then kappmaker-army worker start <name>. A small background supervisor restarts the session when it ends. It does not survive a reboot.

Notifications and routines

  • Routines (nightly health, weekly idea scout, weekly retro) run with $ARMY_HOME/factory/routines/bin/run-routine.sh <name>. Try --dry-run first. Put them in cron when you like them.
  • Messages go to ARMY_NOTIFY_CHAT_ID, or to your own command with ARMY_NOTIFY=cmd.
  • bot-limit-watchdog (cron, every 5 minutes) unsticks a worker frozen on Claude Code's usage-limit dialog by choosing only the free "wait" option. Check it with bot-limit-watchdog --status.

One rule to remember

Never run a bare claude, claude mcp list or claude -p inside a worker's shell. It starts a second Telegram poller and the bot goes deaf. The guard blocks it. If you really need it, prefix TELEGRAM_STATE_DIR=~/.claude/channels/telegram-headless.

Docs for the App Army kit. The Claude Code plugin has its own page.