/agent-session-monitor:agent-session-monitorfrom agent-session-monitor
Monitors and steers terminal coding agents (Claude Code, Codex) running in tmux panes. Detects idle/blocked/context-boundary states, sends approved commands, and coordinates multi-agent workflows.
Ships in agent-session-monitor. 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.
Read when SKILL.md points to them; scripts run unread.
Use this skill to act as a meta agent for terminal agents running inside tmux. It is intentionally platform-neutral: the skill body uses the open Agent Skills format, and product-specific behavior lives in small references.
Keep one versioned source of truth:
agent-session-monitor/
.claude-plugin/plugin.json
skills/agent-session-monitor/
SKILL.md
scripts/
references/
Expose skills/agent-session-monitor to host-specific discovery paths with
symlinks or plugin installation. Do not copy the skill body into separate Claude
and Codex versions.
Read references/platforms.md when you need install-path or command details.
Read references/gsd.md only when monitoring GSD workflow panes.
List panes:
tmux list-panes -a -F '#{session_name}:#{window_index}.#{pane_index} | #{pane_title} | #{pane_current_command} | #{pane_current_path}'
Use real tmux targets such as session:0.0. Version strings like 2.1.170
in a pane title or command are agent versions, not tmux targets.
If the user gave fuzzy targets, resolve them from pane title, current command, and working directory. Ask only when two or more panes match equally well.
From this skill directory:
scripts/watch-tmux-agents.sh --once --include-idle <target> [<target>...]
For each target, also capture recent output directly when making a decision:
tmux capture-pane -t <target> -p -S -80
Classify the pane:
WORKING: busy, compacting, streaming, or not safely interruptible.IDLE: at a prompt with no actionable boundary.ASKING_IDLE: waiting for a decision or guidance.CONTEXT_REQUESTED_IDLE: agent says to clear, compact, resume, or start a
fresh context.THROTTLED_IDLE: provider throttling or quota limit while idle.PLAN_DONE_IDLE / REVIEW_DONE_IDLE: workflow-specific boundary.ERROR: crash, rejected command, unknown command, or other visible
non-throttle failure.GONE: tmux target disappeared.Choose the monitor execution surface explicitly for the current host and user request. Common choices are:
Monitor tool, when the user wants a Claude-managed persistent
task.For an inspectable tmux monitor:
tmux new-session -d -s agent-session-monitor 'cd <skill-dir> && scripts/watch-tmux-agents.sh <target> [<target>...]'
When the watcher emits an event:
tmux capture-pane.Use the helper so text and Enter are sent separately:
scripts/send-to-tmux-agent.sh <target> '<text to send>'
For manual sends:
tmux send-keys -t <target> '<text to send>'
sleep 1
tmux send-keys -t <target> Enter
If the pane rejects the command, stop. Do not retry with a guessed alternative.
Use this only when the user explicitly approves switching a throttled Claude Code pane to Codex, or when the current workflow explicitly authorizes that handoff.
Trigger signals include:
THROTTLED_IDLE from scripts/watch-tmux-agents.sh.AIProvider::Errors::RateLimited.Before switching:
Then run:
scripts/claude-to-codex-handoff.sh --target <target> --prompt-file <handoff-prompt-file>
The helper sends exit, waits for the pane to return to a shell, then starts
Codex in the same working directory with:
codex --sandbox danger-full-access --ask-for-approval on-request
That is "no sandbox, not YOLO": filesystem/network sandboxing is disabled, but Codex still asks for approval when its policy requires it. If the user wants the full bypass mode, they must explicitly ask for that variant.
If exit does not return to a shell, the helper stops. Do not try /exit,
Ctrl-C, or another alternate exit unless the user approves that specific next
attempt.
Claude Code and Codex both use /clear for starting a fresh conversation in the
same terminal session. Codex also has /compact to summarize the visible
conversation and free tokens.
Use context commands only when:
If the watched agent says "ask what the next step is" or asks a question, do not clear first. Surface the question to the user.
Keep the user informed with concise status:
Never hide uncertainty. A meta agent that sends the wrong command into a live agent pane can mutate work the user did not intend to touch.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
tmux, agent-monitoring, multi-agent, session-management, automation
npx claudepluginhub yorrick/agent-skills --plugin agent-session-monitorOther plugins' skills for the same job