codex-tmux-echo

codex-tmux-echo is a skill for Claude Code, Codex from okwinds/miscellany. It costs 45 tokens per session (2,438 once invoked), scanned C, original, MIT.

A toolkit for safely controlling interactive command-line programs inside tmux, a terminal tool that keeps programs running in separate panes.

In plain words
What is it for?
Use it to drive Codex, Claude Code, a REPL, or another interactive terminal program, while checking pane targets and command risks.
Why use it?
It reduces timing problems when starting sessions, sending keys, waiting for output, and returning results between panes.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/okwinds/miscellany/codex-tmux-echo
Any agent
npx skills add okwinds/miscellany --skill codex-tmux-echo
Clone the repo
git clone --depth 1 https://github.com/okwinds/miscellany

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for codex-tmux-echo

README.md
[![agentmods](https://agentmods.dev/badge/skills/okwinds/miscellany/codex-tmux-echo.svg)](https://agentmods.dev/skills/okwinds/miscellany/codex-tmux-echo)
Your own site
<a href="https://agentmods.dev/skills/okwinds/miscellany/codex-tmux-echo"><img src="https://agentmods.dev/badge/skills/okwinds/miscellany/codex-tmux-echo.svg" alt="Measured on agentmods" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,438 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00045 $0.02438
Opus 5 $0.00023 $0.01219
Sonnet 5 $0.00009 $0.00488
Haiku 4.5 $0.00005 $0.00244

Measured 3d ago against content hash bff5a89088d3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

codex-tmux-echo scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

The scan reads SKILL.md. This mod also ships 5 executable files (scripts/dispatch.sh, scripts/interactive_runner.sh, scripts/selftest.sh, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- `--risk auto`:遇到高风险操作(如 `sudo`、写系统目录、`rm -rf /` 等)会**先回传给调度者并阻断执行**。
agent/skills/codex-tmux-echo/SKILL.md · 193 lines

How it starts

The opening of the file, as written. The whole thing — 193 lines — stays where its author put it; the contents beside it link to each section on GitHub.

codex-tmux-echo

Overview

这个 skill 提供一套“通用的 tmux 交互编排工具链”,用于稳定控制任意交互式 CLI(Codex/Claude Code/REPL/TUI 等):

  • 可靠创建/复用 tmux session(避免 shell 初始化提示抢输入)
  • 发送文本与按键序列(支持 Tab/Enter/Escape+Enter 等)
  • 轮询抓取 pane 输出,等待 “ready / progress / done” 特征出现(避免靠 sleep N 猜时序)
  • 支持 backchannel 回传:worker 完成后把摘要回传到 controller 的 pane(支持“仅注入草稿”与“自动提交为对话消息”两种模式)

注意:本 skill 不默认为 Codex 附加 --yolo / --full-auto 等参数;是否开启由调用方传入 --cmd 决定。

⚠️ 风险提示(必读)

本 skill 的核心能力是 tmux send-keys:它可以把文本/按键“打到”任意 tmux pane。这个能力非常强,也意味着一旦 target 选错,就可能在错误窗口里执行命令

请在使用前理解并接受以下风险与边界:

  • 误投递风险(高):如果 controller/target 识别错了,回传或按键可能落到别的 pane(甚至是生产 shell)。
  • “按键=执行”风险(高)--report-submit keys(尤其带 Enter)可能直接触发 shell 执行;只有在你明确知道 controller 是什么、并且明确指定 --scheduler-target 时才建议使用。
  • 显式覆盖更危险--report-submit 会覆盖 --report-mode 的安全策略;请把它当成“高级/危险开关”。
  • 读取屏幕内容的隐私风险(中):脚本会 capture-pane 用于探测 Codex pane/等待输出;避免在 controller pane 里显示 secrets(token、私钥、敏感日志)。
  • worker --cmd 是任意命令(高)dispatch.sh 会在 worker session 里执行你传入的 --cmd(默认是 codex --no-alt-screen)。如果你传入了高权限/破坏性命令,风险由你承担。
  • 风控仅是启发式(中)risk-gate 只做简单模式匹配,不是安全沙盒;它只能“提醒/挡第一道”,不能保证绝对安全。

推荐的安全使用方式(强烈建议)

  1. 用专用 scheduler pane:单独开一个 tmux session/window 专门跑调度侧 Codex,不要混用你日常的 shell pane。
  2. 优先使用默认回传策略--report-mode auto(Codex controller 自动发送;非 Codex 自动降级为仅注入草稿)。
  3. 需要更稳时,显式绑定 controller pane:在 scheduler pane 内执行派发;或设置 CODEX_TMUX_ECHO_CONTROLLER_TARGET;或直接传 --scheduler-target %<pane_id>
  4. 除非你明确知道自己在做什么,否则不要用--report-submit keys --report-keys Enter

Socket Strategy

--socket auto(默认):

  • 如果你当前就在 tmux 里(存在环境变量 TMUX):复用当前 tmux server(这样 worker 才能回传到你的 pane)
  • 如果不在 tmux:使用隔离 socket(默认路径在 ${TMPDIR:-/tmp} 下),避免污染系统 tmux

Scripts

  • scripts/tmuxctl.sh:tmux 控制器(new/send/wait/capture/report/whoami)
  • scripts/interactive_runner.sh:通用 runner(启动 worker → 发送 prompt → 自动提交 → 等待 done)
  • scripts/start_scheduler.sh:一键启动“调度侧 Codex”(system tmux)
  • scripts/dispatch.sh:一键派发自然语言任务到 worker,并回传到调度侧(对话式协同;支持自动识别 scheduler/controller pane)
  • scripts/codex-tmux-echo:更短的 wrapper(直接把参数当成自然语言任务)
  • scripts/selftest.sh:离线自测(不依赖网络/账号)

Read the full file on GitHub · 193 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 193 lines · 45 tokens per session scan C bff5a89088d3

Subscribe to this mod's changes

codex-tmux-echo is a skill published in the GitHub repository okwinds/miscellany (50 stars, last pushed 3mo ago), licensed MIT. It adds 45 tokens to every session and 2,438 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.