agentleFS
ppikkuahoppikkuaho/claude-skills/skills/agent-bus/SKILL.md

agent-bus

Skill0 starsChanged 6 months agoMITView on GitHub

Use when a Codex session needs to discover, enable, inspect, or use the inter-agent bus to message live Claude or Codex sessions. Covers on-demand registration, identity lookup, session status, and agent-to-agent sends via the local `bus` command.

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. 0 are common, 4 are distinctive, and 11 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 11

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this skill when the task involves live inter-agent messaging over a local agent bus exposed through a global bus command.

    line 8
  2. Very specific:

    Run bus enable --name ... --description ...

    line 38
  3. Distinctive:

    Use first. It tells you whether the session is enabled, which adapter it is using, the current participant id if enabled, the …

    line 55
  4. Distinctive:

    Use the live-session send path when this session should be the real sender:

    line 65
  5. Very specific:

    Use plain bus send <participant-id> "message" only when the sender should be an ephemeral CLI identity.

    line 73
  6. Very specific:

    If bus send --from-session ...

    line 77
  7. Very specific:

    If bus send --from-session ...

    line 78
  8. Very specific:

    If bus status shows a last_error, quote that error back to the user and include the log= path in your reasoning.

    line 79
  9. Very specific:

    If bus whoami returns bus_disabled, enable the session first.

    line 80
  10. Very specific:

    If Codex reports awaiting_thread, submit or ask for a real prompt first, then retry bus enable.

    line 81
  11. Very specific:

    If Codex Desktop is not listed by default, check launchctl print gui/$(id -u)/com.agentbus.codex-desktop-bus-autostart and then run bus …

    line 82
  12. Very specific:

    If bus list only shows stale hashed ids and named sessions are missing after a code update, the broker may still be running older code.

    line 83
  13. Distinctive:

    When asked to connect two live sessions, prefer this order:

    line 87
  14. Distinctive:

    When debugging, do not guess.

    line 94
  15. Very specific:

    If you explicitly want the old always-listed behavior for a test, launch with AGENT_BUS_AUTO_ENABLE=1.

    line 99

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Agent Bus

Use this skill when the task involves live inter-agent messaging over a local agent bus exposed through a global bus command.

This skill documents the bus command surface (a local broker that lets wrapped Claude/Codex sessions message each other). The broker and its launch wrappers are separate local infrastructure and are not bundled here.

Typical triggers:

  • The user wants this session to message another Claude/Codex session.
  • The user wants to know whether this session is registered on the bus.
  • The user wants this session to opt in to coordination and name itself in the participant list.
  • bus send --from-session ... failed and you need to diagnose whether the session is disabled, unwrapped, or errored.

Quick Start

From inside a normal wrapped session:

bus status
bus enable --name "task-short-name" --description "What this session is doing"
bus whoami
bus send --from-session <participant-id> "message"

From Codex Desktop, recent Desktop threads are enabled by default by the local com.agentbus.codex-desktop-bus-autostart LaunchAgent. Start with:

bus status
bus whoami
bus send --from-session <participant-id> "message"

Run bus enable --name ... --description ... only if the Desktop status is disabled/error or you want to rename the default address (codex-desktop-<thread-id>).

Success criterion: the command exits 0. Treat any non-zero exit as a delivery-check failure. queued now exits non-zero by default because the peer did not receive the message now; use --allow-queued only when deferred mailbox queueing is explicitly acceptable.

The chosen --name becomes the actual bus address. After enable, bus whoami should print that handle.

Normal interactive paths on this machine:

  • claude --dangerously-skip-permissions
  • codex
  • Codex Desktop app

Terminal claude and codex launch wrapped sessions already. Codex Desktop uses the Desktop autostart watcher and the CODEX_THREAD_ID fallback. The bus command is expected to be on PATH.

Control Commands

  • bus status Use first. It tells you whether the session is enabled, which adapter it is using, the current participant id if enabled, the control/delivery socket paths, and any last error.
  • bus enable Registers or renames the live session on the bus. --name is the real messageable handle, not just a label. Pick task-specific names like codex-architecture, codex-review, or claude-triage over generic ones when multiple sessions are active. For wrapped Codex, this may return awaiting_thread if the session does not have a real thread yet. Codex Desktop normally arrives already enabled.
  • bus disable Unregisters the live session but keeps the control socket alive, so it can be re-enabled later.
  • bus whoami Prints only the live participant id / address. Use this when another agent or terminal needs the exact destination id.

Sending Messages

Use the live-session send path when this session should be the real sender:

bus send --from-session <participant-id> "message"

This makes the broker record from=<this session's chosen bus name> instead of from=cli:....

Use plain bus send <participant-id> "message" only when the sender should be an ephemeral CLI identity.

Failure Handling

  • If bus send --from-session ... says the session is not bus-enabled, run bus enable and retry.
  • If bus send --from-session ... returns queued, do not claim the peer received it. Report the exact output and only use --allow-queued when deferred mailbox delivery is explicitly acceptable.
  • If bus status shows a last_error, quote that error back to the user and include the log= path in your reasoning.
  • If bus whoami returns bus_disabled, enable the session first.
  • If Codex reports awaiting_thread, submit or ask for a real prompt first, then retry bus enable.
  • If Codex Desktop is not listed by default, check launchctl print gui/$(id -u)/com.agentbus.codex-desktop-bus-autostart and then run bus status in the Desktop thread to start the fallback sidecar.
  • If bus list only shows stale hashed ids and named sessions are missing after a code update, the broker may still be running older code. Restart it with launchctl kickstart -k gui/$(id -u)/com.agentbus.bus-broker.

Working Pattern

When asked to connect two live sessions, prefer this order:

  1. bus status
  2. bus enable --name ... --description ... if needed
  3. bus whoami
  4. bus send --from-session ...

When debugging, do not guess. Run the commands and report the concrete state.

Notes

  • The default wrapped launch path is already opt-in; sessions are bus-capable on normal launch but only appear in bus list after bus enable.
  • If you explicitly want the old always-listed behavior for a test, launch with AGENT_BUS_AUTO_ENABLE=1.
  • Claude and Codex both use the same bus command surface, but Codex has an extra thread-readiness constraint.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.