Context
For Claude Code, publishing a session is done in-session by typing:
>share --dangerously-skip-permissions my-cool-session
This works because agent-tunnel ships a Claude Code UserPromptSubmit plugin hook (plugins/agent-tunnel/hooks/share_hook.py, registered via hooks.json). When you submit that prompt, the hook fires, receives session_id + cwd + transcript_path, writes the registry, and returns {"decision":"block","reason":"…"} so the prompt is intercepted (never reaches the model) and the handle is printed. That block-and-reply behavior is what makes >share feel like a slash command.
For Codex CLI, PR #102 publishes via the terminal instead: agent-tunnel share --agent codex <name>. There is no in-session >share today.
Why this is worth investigating (it may be achievable)
Codex actually has a Claude-compatible plugin/hook system. On this machine ~/.codex/config.toml contains, e.g.:
[hooks.state."ralph-loop@claude-plugins-official:hooks/hooks.json:stop:0:0"]
trusted_hash = "sha256:…"
i.e. codex loads Claude-plugin hooks.json files and keys them by event (stop here) + a per-invocation trust hash. codex plugin / codex features (hooks is a stable feature) manage this. So an in-session >share for codex is plausibly just a matter of wiring, not a hard "codex can't".
agent-tunnel's share_hook.py already defensively detects a codex-shaped transcript_path and labels the record agent=codex, so if the hook ever fires inside codex it does the right thing.
Open questions to answer
- Does codex fire a
UserPromptSubmit-equivalent hook event (or any pre-turn user-input event)?
- Does codex honor the
{"decision":"block","reason":…} protocol to suppress the prompt and surface a message? (Claude's >share needs this; without it, the >share text would still reach the model.)
- Does the hook payload include
session_id / cwd / codex rollout path (so the hook can register the right session)?
- What's the install/trust path — publish agent-tunnel to a codex plugin marketplace, or a manual
~/.codex/config.toml hook entry + trust?
Outcome
If (1)–(3) hold, wire the existing share_hook.py into codex (register the plugin/hook, document the trust step) so codex users get the same >share --… my-cool-session in-session shortcut. If codex lacks block-decision support, document agent-tunnel share --agent codex as the permanent codex path.
Refs: PR #102, plugins/agent-tunnel/hooks/share_hook.py (_detect_agent), plugins/agent-tunnel/hooks/hooks.json.
Context
For Claude Code, publishing a session is done in-session by typing:
This works because agent-tunnel ships a Claude Code
UserPromptSubmitplugin hook (plugins/agent-tunnel/hooks/share_hook.py, registered viahooks.json). When you submit that prompt, the hook fires, receivessession_id+cwd+transcript_path, writes the registry, and returns{"decision":"block","reason":"…"}so the prompt is intercepted (never reaches the model) and the handle is printed. That block-and-reply behavior is what makes>sharefeel like a slash command.For Codex CLI, PR #102 publishes via the terminal instead:
agent-tunnel share --agent codex <name>. There is no in-session>sharetoday.Why this is worth investigating (it may be achievable)
Codex actually has a Claude-compatible plugin/hook system. On this machine
~/.codex/config.tomlcontains, e.g.:i.e. codex loads Claude-plugin
hooks.jsonfiles and keys them by event (stophere) + a per-invocation trust hash.codex plugin/codex features(hooks is a stable feature) manage this. So an in-session>sharefor codex is plausibly just a matter of wiring, not a hard "codex can't".agent-tunnel's
share_hook.pyalready defensively detects a codex-shapedtranscript_pathand labels the recordagent=codex, so if the hook ever fires inside codex it does the right thing.Open questions to answer
UserPromptSubmit-equivalent hook event (or any pre-turn user-input event)?{"decision":"block","reason":…}protocol to suppress the prompt and surface a message? (Claude's>shareneeds this; without it, the>sharetext would still reach the model.)session_id/cwd/ codex rollout path (so the hook can register the right session)?~/.codex/config.tomlhook entry + trust?Outcome
If (1)–(3) hold, wire the existing
share_hook.pyinto codex (register the plugin/hook, document the trust step) so codex users get the same>share --… my-cool-sessionin-session shortcut. If codex lacks block-decision support, documentagent-tunnel share --agent codexas the permanent codex path.Refs: PR #102,
plugins/agent-tunnel/hooks/share_hook.py(_detect_agent),plugins/agent-tunnel/hooks/hooks.json.