Tmux send

From leopu00/job-hunter-team · View interactive version

Tmux send is an AI agent skill from the GitHub repository leopu00/job-hunter-team. Deliver a message to another agent's tmux session atomically. ALWAYS use this to communicate with SCOUT/ANALISTA/SCORER/SCRITTORE/CRITICO/SENTINELLA/CAPITANO. NEVER call `tmux send-keys` by hand — Ink-based TUIs (Codex, Kimi) lose the Enter character.

How to use this skill

Skill file

tmux-send — inter-agent messaging

Shell wrapper colocated at /app/agents/_skills/tmux-send/jht-tmux-send (also on PATH via /usr/local/bin symlink, populated at image build).

Why it exists

Ink-based TUIs (Codex, Kimi Code) drop the Enter if it arrives in the same tmux send-keys call as the text body. Text is sent character-by-character; Ink must finish rendering before accepting another keystroke. If you call tmux send-keys "msg" Enter, the message stays in the peer's input buffer without being submitted → silent inter-agent deadlock.

The wrapper handles it atomically: it types the text, re-reads the pane to confirm the text landed, sends Enter, then re-reads the pane again to confirm the turn actually started. Delivery is not "having typed" — it is "having seen the turn start".

⚠️ There is a second, nastier state: the TUI accepts the text and ignores the Enter, leaving the line hanging in the composer while the agent sits idle for hours. Seen 4 times in 3 days on one box, Captain included, when a message arrives while the peer is closing a long turn. The wrapper now retries the Enter and, if the turn still doesn't start, returns 5 instead of falsely reporting success.

Usage

jht-tmux-send <SESSION> "<message>"

Examples (V5)

# Captain → Scout (INFO, generic operational message)
jht-tmux-send SCOUT-1 "[@capitano -> @scout-1] [INFO] Start the main loop. Begin from CIRCLE 1 (Remote EU); ping after each batch of 3-5 positions."

# Captain → Writer (URG, real-time order)
jht-tmux-send SCRITTORE-1 "[@capitano -> @scrittore-1] [URG] FREEZE — finish the current Critic round, then sleep until throttle returns to T0/T1."

# Analyst → Scout (FEEDBACK, rejection-pattern coaching)
jht-tmux-send SCOUT-2 "[@analista-1 -> @scout-2] [FEEDBACK] [SENIORITY] 4 of last 5 inserts from greenhouse.io require senior+ — switch source or query for the next batch."

# Sentinel → Captain (URG, state change)
jht-tmux-send CAPITANO "[@sentinella -> @capitano] [URG] Usage 94%, projection 102% — recommend throttle T2 + freeze Writers."

# Writer → Captain (REPORT, final result)
jht-tmux-send CAPITANO "[@scrittore-1 -> @capitano] [REPORT] Position 42 — verdict PASS, score 7.5/10. PDF: /jht_user/.../CV.pdf"

# Worker → Captain (ACK, confirming URG)
jht-tmux-send CAPITANO "[@scrittore-1 -> @capitano] [ACK] freeze applied, sleeping."

Message envelope

Always keep the structured prefix:

[@<from> -> @<to>] [<TYPE>] <text>

Standard types (see agents/_manual/communication-rules.md for full taxonomy and per-role expectations):

💬 [CHAT] is reserved for user → agent messages from the web UI (see Captain's prompt protocol). Don't use it for inter-agent traffic.

🚧 The bar — send a message ONLY when it passes

A tmux message is a push: it burns the peer's turn. Send one ONLY if it passes the bar:

Everything else is pull: DB (Tier 1) → capture-pane (Tier 2) → message (Tier 3). What is CUT:

Pipeline hand-offs (Scout→Analyst→Scorer→Writer) are status flips, not messages. Full rules: CODE0.

Exit codes

Only 3 may lead to a liveness check and respawn. 4 and 5 both mean the peer is alive: treating them as death is how over-spawning starts.

Rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.