/emux:nested-managerfrom emux
Push a noisy or long-running drive loop DOWN a level so it doesn't fill your context. Spawn a manager session that itself spawns and drives a sub-session; you only talk to the manager. Use when driving a session would generate lots of capture/send churn (a long TUI task, a chatty remote build, a multi-step agent job) — especially on a remote box.
Ships in emux. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Driving a session directly means every tmux_capture and every screen of
output lands in your context. A long or chatty task drowns you in churn you
don't need — you only care about milestones and blockers.
So don't drive the leaf. Spawn a manager: a claude session that has emux,
and tell it to spawn and drive the sub (the leaf). The manager runs the
tight observe/act loop against the sub — that churn lives in the manager's
context. You exchange only high-level goals and status with the manager.
you (this context) ──manage──▶ MANAGER (has emux) ──drive──▶ SUB (the leaf)
holds: goals, status holds: the drive-churn holds: the work
Each layer absorbs the verbosity of the layer below. Your context stays bounded no matter how noisy or deep the real work gets. The manager can do the same to its subs — it's a tree, and every node filters detail for its parent.
Reach for it when the drive loop is expensive to watch:
Do NOT reach for it when driving the thing yourself is cheap: a one-shot
command, a single tmux_goal, a quick capture. Nesting has a cost (a whole
extra claude); don't pay it to save three captures. Ponytail applies to
orchestration too — the flattest thing that works wins.
Spawn the manager with emux + a brief, and declare the edge. The
command is a claude seeded with the manager brief (below). manages
records the manager→sub edge up front so emux web draws the tree.
tmux_spawn(
name="mgr-migrate",
host="eidos@box", # omit for a local manager
command='claude "<manager brief — see below>"',
manages=["sub-migrate"], # the sub it will create
description="manages the DB migration sub",
)
Drive the manager, not the sub. Talk to it at a high level. Either converse:
tmux_send(target="mgr-migrate", keys="status? one line.", by_registry_name=True)
tmux_capture(target="mgr-migrate", by_registry_name=True)
or hand it a whole goal and let it run its own loop against the sub:
tmux_goal(target="mgr-migrate",
goal="Drive your sub to finish the migration; report only milestones and blockers.",
by_registry_name=True)
You never touch the sub. No tmux_capture on sub-migrate from up here —
that would pull its churn back into your context, defeating the point. If you
need detail, ask the manager for it.
claude with)Bake the manager's job into the command so it knows it is a manager the moment
it boots:
You are a MANAGER session. You have emux. Spawn a sub-session named
sub-migrateand drive it to accomplish:<the real task>. Run the tight capture/send loop against the sub yourself — keep its output in YOUR context. Report UP to your parent tersely: only milestones, decisions that need a ruling, and blockers. Never dump raw sub output upward unless asked. When the task is done, say so in one line.
The manager then does, in its own context:
tmux_spawn(name="sub-migrate", command="<the work>") →
tmux_capture/tmux_send/tmux_goal against sub-migrate until done.
claude on its PATH. That's what lets it spawn
and drive the sub. If the box doesn't have emux, the manager degrades to a
plain session you drive directly — no second level, no offloading. Check the
host has emux before you count on nesting.tmux_spawn returns
spawn_failed with a hint if it can't.manages edge is what you record, not what
emux watches. If the manager drives something else, the tree in emux web
won't know unless you (or it) register that edge too.claude to pay for.emux already drives existing sessions and reaches across ssh. The nested-manager
pattern is just those primitives arranged so context cost stays flat as work
grows. The spawn that makes it possible is an explicit lifecycle act
(tmux_spawn under direct invocation) — the autonomous loop (navigate/goal)
still never spawns on its own. See ADR-002.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub eidos-agi/eidos-marketplace --plugin emux