eighteyes/universal-backchannel/tree/main/mod/ubc
关于这个 mod
universal-backchannel
"Slip a note under the door"
ubc 是通往 Claude Code 的后门通道。任意 shell 都可以丢下一条消息,目标会话会用它开始一轮工作。
ubc "the build is green, go ahead and tag it"
在 shell 中运行 ubc,它会找到该 shell 所属的会话:同一个 herdr 标签页、同一个项目文件夹,或你指定的名称。传入 --agent <uuid> 可以跳过猜测。如果匹配到多个会话,ubc 会列出它们并以 3 退出,因此绝不会擅自猜测。可以使用 /ubc name api 为会话命名;每条消息都会先从收件箱移出,再进行读取,以保证只投递一次。工作阶层中途到达的消息会排队,等工作阶层结束后合并成一条提示词送达。
安装
git clone https://github.com/eighteyes/universal-backchannel
cd universal-backchannel
ln -s "$PWD/bin/ubc" ~/.local/bin/ubc # the CLI
claude --plugin-dir "$PWD/mod/ubc" # a session with the mod loaded
要在每个会话中加载模组,请将 mod/ubc 路径加入 ~/.claude/settings.json 的 env 块中的 CLAUDE_CODE_PLUGIN_DIRS。
需要:bash、jq(仅在没有 --agent 时用于寻找会话),以及会加载 hooks-module 模组的 Claude Code 构建。
模组不会绘制任何内容:它轮询收件箱并开始工作阶层。/ubc 会打印会话 id 和一行可以直接粘贴的发送命令。状态存放在 ~/.ubc 下(inbox、read、sessions),设置 UBC_DIR 可以移动整棵目录树。
安装
请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。
claude plugin marketplace add eighteyes/universal-backchannel claude plugin install ubc
原文 / README
universal-backchannel
"Slip a note under the door"
Your Claude Code sessions are islands. A build script, a cron job, another agent or you in a spare shell can't reach a session without typing into its window. To reach one from outside we need an address and a mailbox: anything writes, the session reads.
ubc is a backchannel into Claude Code. Any shell drops a message, and the session it's meant for starts a turn with it.
ubc "the build is green, go ahead and tag it"
The ubc plugin sent a message:
ubc message from my-repo:
the build is green, go ahead and tag it
Features
no uuid needed
Run ubc from a shell and it finds the session that shell belongs to: same herdr tab, same project folder, or a name you gave it. Pass --agent <uuid> to skip the guessing.
never guesses
When more than one session matches, ubc lists them and exits 3. Pick one with --agent or --to.
names
/ubc name api in a session, then ubc --to api "deploy done" from anywhere.
delivered once
The mod claims each message by moving it out of the inbox before it reads it. Two polls or two sessions can't deliver the same message twice.
queues behind a busy turn
A message that lands mid-turn waits for that turn to finish. Several waiting messages arrive as one prompt.
pipes
make test 2>&1 | tail -20 | ubc sends the output. --from ci signs it.
no pane
The mod draws nothing. It polls an inbox and starts turns. /ubc prints the session's id and a ready-to-paste send line.
It's a folder of text files and a 1.5 second poll, but it's replaced a lot of copy-pasting between my windows.
Installation
git clone https://github.com/eighteyes/universal-backchannel
cd universal-backchannel
ln -s "$PWD/bin/ubc" ~/.local/bin/ubc # the CLI
claude --plugin-dir "$PWD/mod/ubc" # a session with the mod loaded
To load the mod in every session, add the mod/ubc path to CLAUDE_CODE_PLUGIN_DIRS in the env block of ~/.claude/settings.json.
Needs: bash, jq (only for finding a session without --agent), and a Claude Code build that loads hooks-module mods.
Incomplete Implementations
Codex, Desktop, others: nothing yet. The mod needs Claude Code's $.prompt.submit to start a turn.
Hot reload: a mod folder under ~/.claude/dev-mods/ that's a symlink loads once and then ignores edits. Copy it in, or use --plugin-dir.
Implementation
CLI
ubc "hi there from ubc" # to the session this shell belongs to
ubc --to api "deploy done" # to a session named with /ubc name api
ubc --agent <uuid> "hi" # by id
echo "build failed" | ubc # message from stdin
ubc --from ci "deploy done" # sign it (default: this folder's name)
ubc --who # which session a send would reach
ubc --list # live sessions
Finding the session
With no --agent, the first rule that matches wins:
rule matches
--to <name> a live session named with /ubc name <name>
$CLAUDE_CODE_SESSION_ID set in shells Claude itself starts (Bash tool, hooks)
$HERDR_TAB_ID a live session in the same herdr tab
$HERDR_WORKSPACE_ID a live session in the same herdr workspace
$PWD a live session whose cwd is this folder, above it or below it
Several matches narrow to those whose cwd nests with $PWD, then to an exact cwd. A session is live for 150s after its last heartbeat (UBC_LIVE_SECS).
Mod
event does
session.start registers /ubc; polls the inbox every 1.5s; heartbeats every 60s
command.run /ubc prints id, send line and waiting count; /ubc name <x> names it, /ubc name - drops it
/ubc can't deliver: Claude Code doesn't allow a prompt submit from a command hook, so delivery always comes from the poll.
Layout
~/.ubc/inbox/<uuid>/*.msg waiting; the CLI writes a dotfile and renames it
~/.ubc/read/<uuid>/*.msg delivered; never pruned
~/.ubc/sessions/<uuid>.json heartbeat: cwd, herdr ids, name, time
A message is from: <name>, a blank line, then the body. UBC_DIR moves the tree; UBC_FROM sets the default sender.
Trust
Nothing is authenticated. Anything that can write to ~/.ubc can prompt your sessions, the same as anything that can type into your terminal.
Tests
claude plugin test mod/ubc
Contributions
Are welcome. I wanted agents and scripts to tap each other on the shoulder without a server, a socket or a pane, and a mailbox on disk turned out to be enough.