Agents that do not start after a boot or a cutover
The symptom is always the same: after a reboot, or after the agents' folders were moved, some or all agents are missing from tmux, or their panes sit at a shell prompt, or a pane shows a bwrap error and exits. The causes are few. Check them in this order, because each one hides the next: nothing after the tmux restore runs if the restore itself failed.
Read-only checks first. Starting or restarting an agent is the user's call where agents are shared or long-running; say what you found and which command would fix it.
Contents
- 1. Did the tmux restore run at all?
- 2. Did
start-agents.shlook in the right folder? - 3. Was the agent skipped on purpose?
- 4. Does the profile point at the old path?
- 5. Is a bind-mount source missing?
- 6. Did it start, then stop?
- After a fix
1. Did the tmux restore run at all?
systemctl --user status tmux-session.service
journalctl --user -u tmux-session -b --no-pager | tail -40
- The unit failed.
start-agents.shis normally anExecStartPost=of the restore unit, and systemd does not runExecStartPost=when the start fails. So one restore failure means no agent starts, and nothing in the agents' own logs says why. width invalidor a layout error. Newer tmux (3.8 and later) writes window layouts in a format older restore scripts cannot read back, so the restore stops at the first window. Update tmux-persist to a version that handles the new format, then re-run the restore orstart-agents.sh.no space for new pane. Too many agents for oneagentswindow at the terminal's size. Use--layout windows(orSTART_AGENTS_LAYOUT=windows) so each agent has its own window.- The unit is fine but no
ExecStartPost=line ran. Check the drop-in is installed:systemctl --user cat tmux-session.serviceshould show thestart-agents.shline.
2. Did start-agents.sh look in the right folder?
start-agents.sh --dry-run
The dry run lists each agent it would start or skip, and why. An empty list means it found no agent folder, which is a path fault, not a healthy state.
- Shared repo with a
hosts/map. The agents live in~/sandboxes/hosts/<host>/, and<host>comes from the map entry foruname -n. An unlisted hostname is an error. After a rename or a new machine, add the map line. - An older copy of the script. Versions before the host map only scanned
~/sandboxes/*/. After a cutover to the per-host layout, an old installed copy beside the runner finds nothing. Compare the installed copy with the skill'sscripts/start-agents.shand reinstall withnew-agent.shor a copy. - A stale environment. The drop-in may set
SANDBOXESorTMUX_SESSION_NO_AUTOSTART_DIRto the old folder. Read both fromsystemctl --user cat tmux-session.service.
3. Was the agent skipped on purpose?
- A
.no-autostartfile in the agent's folder skips it at boot. An explicitstart-agents.sh <name>overrides it. - Its group starts on request: a
<group> no ...line in thegroupsfile.start-agents.sh --statusshows each agent's group and when it starts;start-agents.sh --group <group>starts it. - The memory gate deferred it: the drop-in's
START_AGENTS_GATEfailed forSTART_AGENTS_GATE_WAIT_S. The journal of the restore unit hasdeferred <name>: <reason>. Start it later withstart-agents.sh <name>. - The launcher refused:
<name>-agent: refused. Start it with start-agents.sh. Something other thanstart-agents.shran it, such as an old tmux-persist allowlist that still lists<name>-agent, or a hand-written fallback. Remove that route;start-agents.shis the one way an agent starts. - "Running" means a
<name>-agentlauncher process exists anywhere, sostart-agents.shwill not start a second copy of an agent running outside tmux. Look for it withpgrep -af '<name>-agent'before assuming it is missing.
4. Does the profile point at the old path?
After the agents' folders move (for example from ~/sandboxes/<name> to ~/sandboxes/hosts/<host>/<name>), three things can still name the old place:
- the profile (
ROOT,AGENT_HOME,EXTRA_RO,EXTRA_RWlines); - the launcher
~/.local/bin/<name>-agent, which names its profile by path; - the agent's config (
CLAUDE_CONFIG_DIRand any absolute paths in its settings or hooks).
grep -n -- "$HOME/sandboxes/" ~/.local/bin/*-agent ~/sandboxes/hosts/*/*/profile
Any line naming the old layout is the fault. Fix the profile and launcher together, then restart only that agent. A symlink from the old path to the new one hides the fault and is easy to forget; prefer fixing the paths.
5. Is a bind-mount source missing?
sandbox.sh names a missing bind source and stops, instead of the bare bwrap error:
sandbox: bind source '<path>' does not exist; create it first
- After a path move in a shared tree (for example a skills folder moved into group folders), an
EXTRA_ROentry still names the old location. Update the profile to the new path. - A spool or socket a host service creates (an
EXTRA_RWspool, a gateway socket) is missing because that service did not start, or starts after the agents. Check the service first, then order it before the tmux restore (After=andWants=on the restore unit). - An older
sandbox.shwithout the check shows onlybwrap: Can't find source path. The fix is the same.
6. Did it start, then stop?
- Signed out. The agent's credentials expired or were never written into its config directory. The pane shows a login prompt or exits. Log in interactively (
<name>-sandbox shell, then the agent's own login), never by copying the host's credentials in. - Proxy mode with no proxy. With
NET=proxythe agent needs the allowlist proxy's socket. If the proxy unit is down, the agent starts but every request fails. Seeproxy.md. - The agent binary moved. The sandbox binds only the agent's install directory. A runtime upgrade that changed the path leaves
command not foundinside. Re-run the launcher install.
After a fix
- Start only what is missing:
start-agents.sh(all gaps) orstart-agents.sh <name>. - Restart an agent only after a profile or hook change, with
restart-agents.sh <name>; hooks load at start. Never restart the pane you are running in. - Re-run
start-agents.sh --dry-runand confirm the list is empty of starts, and that each skip has the reason you expect. - Record the cause and fix wherever the user keeps an ops log.