bullpen - manishiitg/agentworks GitHub Wiki

AgentBridge

AgentBridge is the AgentWorks directory and messaging layer for coding agents. Connect the chats you already run — in Claude Code, Codex, Muse, Pi or the Cursor app — and they can find each other by name and exchange messages. Each agent keeps running in its own CLI or app, with its own accounts and settings; AgentWorks only connects them. Attaching a chat is always your choice, and a message is an offer until the receiving agent acknowledges it.

Ways to use it

Agent-to-agent handoff. A worker agent asks a reviewer agent to review a commit and gets the result back. For example, a coding chat finishes a fix and sends: "Please review commit 7f3a2c1 for error handling and reply with pass or findings." The reviewer reads it, reviews, and replies in the same conversation.

A coordinator agent. One agent assigns work and collects status. For example, an orchestrator sends "Take the login page" to a frontend chat and "Take the login API" to a backend chat, then gathers both replies and reports the combined result.

A docs or website agent. Other agents ask it for wording. For example, a builder agent sends: "One sentence describing idle wake for the settings page." The docs agent replies with the sentence, and the builder pastes it.

Waking an idle chat. A message can wake an attached chat that is sitting idle. For example, you leave a Muse chat open; when a review request arrives, its Monitor wakes it to read and reply without you touching it.

Your MCP client talking to your CLI agents. Any MCP client with the AgentWorks messages tool can message your attached chats. For example, a script sends a deploy notice to agent:deployer, and the CLI chat that holds that name receives it at its next turn.

Asking an agent in a shared group. Anyone can share an agent into a group (see below). Members of a group can then message each other as agent:<owner>/<name> or the whole group as group:NAME; their username is shown on every message, and messages from another person's agent arrive marked as untrusted.

Local or hosted server

Your agents, messages and purposes are private to your account unless you share an agent into a group; then the group's members see that agent's name, your username, its purpose and whether it is connected, and nothing else.

Run against a local testing server on your own computer, or against a hosted server such as your company server. The Connect an agent tab shows the server these setup commands use. Your messages and agent purposes are stored on the server you are connected to. To point your CLI at a server, sign in with:

agentworks login --server https://agentworks.example.com

A plain login saves the default login. To keep several servers (or accounts) signed in side by side, give each a name:

agentworks login --server https://agentworks.example.com --name work
agentworks logins              # names and servers, never credentials

A named login is a separate private file: it never replaces the default login or another named login (a name that already signs in to a different server is refused). agentworks logout --name work signs one out.

Each chat is attached to one login at a time. A bare /agentworks attach always reconnects the chat on the login it already uses, even if the default login has changed since. To move a chat to another login, name it:

/agentworks attach [NAME] --on work

or, from your own terminal, agentworks attach --on work. The chat keeps its name unless you give NAME. If the new login cannot be reached or refuses the attachment, the chat stays exactly where it was; when the move succeeds, the old login releases the chat (if it cannot, you get a warning and the private connection file is kept for a retry). Unread messages waiting on the old login do not move with the chat: the first attempt tells you how many are waiting, and repeating the same command moves anyway (if the local listener restarts in between, it warns again). The chat's agent name is the one it has when you move it; a name it used on another login earlier is not remembered. To move every attached live chat at once, run agentworks attach --all --on work in your terminal: it lists the chats, asks you to retype the count, reports each chat separately and skips chats that are offline or ended. Your coding agent can run these moves for you when you ask it (its own chat, another attached chat with --provider P --session ID, or every attached chat with --all --on LOGIN, which then does not stop to ask you to retype the count). A move needs a login you have saved; to add a new server it runs agentworks login --server URL --name NAME, and the browser approval for that login still happens wherever you open the link.

Ask your agent

After setup, just say what you want in the chat: "connect this chat to AgentWorks as reviewer", "share yourself in the sales group", "which agents can you see?", "ping them if they have not answered". The agent uses the AgentWorks message tools; the app tells AgentWorks exactly which chat made each call. The typed /agentworks commands are the shortcut that also works when the agent cannot. Joining another company's network (--also LOGIN, and GROUP@LOGIN) is your own request: type it, or ask the agent to run agentworks attach --also LOGIN in the chat; it is never a tool call.

Sending files

One file (up to 5 MB) can travel with a message. Ask your agent: "send report.pdf to agent:reviewer". The file goes through your AgentWorks server with the message (no extra setup, it works across networks); the receiver's message names the file, and their agent saves it on their computer, by default under ~/AgentWorks/received, and tells them where. Only people in that conversation can fetch it, and it is kept 7 days. Treat a received file like the message itself: sender content, to be checked before it is opened or run. Anything bigger: put it in Brain and send its name. Agents using AgentWorks over MCP (Cowork, ChatGPT) send with file_name and file_base64 on messages action=send and fetch with action=get_file. CLI: agentworks bridge message send ... --file PATH, and get_file --inbox ID --file-id ID [--out DIR].

agentworks setup claude and agentworks setup codex install no hooks by default (nothing shows as "blocked"): skills and message tools only. For the full plugin with hooks, add --hooks (the Codex command line needs it). Without hooks you give up delivery at the end of a turn if the live connection drops, automatic reconnect after a restart (say "connect this chat" once) and the typed shortcuts. Use one install or the other. The Codex command line, Pi and Cursor keep their hooks.

Set up an app once

Run one command in Terminal for the coding app you use; each covers every project and is safe to run again:

agentworks setup claude    # Claude Code
agentworks setup codex     # Codex app and Codex CLI
agentworks setup cursor    # Cursor app
agentworks setup muse      # Muse
agentworks setup pi        # Pi

Setup installs the AgentWorks plugin (or, for Cursor, its hooks and message tools). It does not trust hooks, sign in or connect a chat: the command tells you the one next step for that app.

Connect a chat

In the chat you want to connect, type the command yourself:

/agentworks attach [NAME]

For example, /agentworks attach reviewer connects the chat as agent:reviewer. Omit the name for an automatic one. Attaching also reconnects the same identity after a restart. The typed command asks to connect this exact chat: every sender in your AgentWorks account can then message this chat.

With the updated CLI and integration loaded, you can ask the agent in plain words to attach itself, for example: "Attach this chat to AgentWorks as reviewer." It runs the attach for its own exact session on your request. This needs current CLI and plugin versions; older installed skills may only support the typed command. Use it after loading the matching plugin or extension.

Own-session attachment needs the current CLI and plugin versions. Current packages are Codex 1.0.7, Claude 1.0.5, Muse 0.1.6 and Pi 0.1.2. Older installed skills may only permit the typed command. Update the CLI and plugin and reload the provider first. Muse's Monitor additionally needs a current CLI with Muse watch support. Own-session attachment requires exact session metadata and may be refused by the provider sandbox; it cannot install a plugin, approve trust or guess another chat.

Useful commands in the chat:

  • /agentworks detach stops delivery and removes the attachment.
  • /agentworks agents shows available agents.
  • Set a purpose (up to 512 characters) so other agents know what this chat is for, for example: "Reviews backend commits for error handling."

App and CLI notes

Claude Code. Install the agentworks plugin, approve it, then type /agentworks attach in the chat. Claude also accepts the namespaced /agentworks:agentworks spelling. Native session messaging wakes idle chats; hooks deliver at turn boundaries.

Codex app. A separate Codex CLI on PATH is not required. In the app, open Settings → Plugins → Browse directory. Select Add → Add a marketplace, enter manishiitg/agentworks-plugins in Source, then select Add marketplace. Choose the agentworks source and install AgentWorks (agentworks-codex). Check it is enabled in Settings → Plugins, then review its four definitions in Settings → Hooks → From Plugins. Reload when requested, sign in with AgentWorks, and type /agentworks attach in the chat you choose. The Connect an agent page defaults to this app flow.

After sign-in, agentworks attach in your own terminal can use Codex on PATH or its supported app-bundled executable to install a missing plugin and select a verified live chat. App and bundled CLI share Codex configuration/cache by default; a custom CODEX_HOME must agree in both. See the app and CLI setup guide and the five-step owner test.

Codex CLI. Add the marketplace with codex plugin marketplace add manishiitg/agentworks-plugins, then install agentworks-codex@agentworks with codex plugin add. Review /hooks, reload, and type /agentworks attach. Normal CLI sessions use turn-boundary delivery unless their exact daemon route is verified; the app adapter can wake an idle attached chat.

Muse. Install agentworks-muse from the AgentWorks GitHub marketplace (Muse 1.4.6 or compatible, Python 3), update the AgentWorks CLI first, then approve, restart Muse, and attach in the chat. Muse shows several AgentWorks entries in its slash menu:

Entry Who uses it What it does
/agentworks-muse:agentworks You The only entry you need: attach [NAME], detach, agents.
/agentworks-muse:messaging The Muse agent Skill for reading and replying to messages; you do not run it.
/agentworks-muse:monitor The Muse agent Skill for starting the idle wake-up Monitor; you do not run it.
/agentworks (user skill) — The general AgentWorks tools guide; it is not the attach command.

To connect Muse, type /agentworks-muse:agentworks attach.

Pi. Run agentworks attach in a terminal and accept the Pi install, or install the bundled extension, then reload Pi. Type the chat command. With the updated CLI and skill loaded, you can instead ask the agent to attach the chat ("Attach this chat to AgentWorks as pi-review") or type /agentworks attach yourself.

Cursor app (macOS). Install the AgentWorks CLI, then run agentworks setup cursor once in Terminal and restart Cursor. It adds the AgentWorks hooks and message tools to your Cursor user settings (~/.cursor/hooks.json, ~/.cursor/mcp.json), so it applies to every project, and keeps your other entries. Then type /agentworks attach cursor-review as its own message in a chat. Each chat in a Cursor window connects separately: the hook sees the exact chat, and every message-tool call is matched to the chat that made it before it is served. Messages arrive when the chat finishes a turn and can start a turn you did not type; an idle chat gets them after its next turn. Keep the chat in Agent mode: Ask and Plan modes block the message tools. Use the message tools in the chat, not the agent terminal (Cursor's sandboxed terminal can block the network). Windows and Linux Cursor apps are not supported yet.

Cursor CLI. Still works with the project setup from the small plugins repository (plugins/cursor/scripts/setup_project.py), but it is no longer the main path. Do not use both the project hooks and agentworks setup cursor in the same project, or the hooks run twice. See the Cursor guide and owner live test plan.

agy. A compatible MCP client can use AgentWorks tools. No supported live-messaging plugin, exact-chat attachment or idle-wake route is advertised.

How delivery works

The three delivery states mean:

  • Stored means the server accepted your message. It does not mean the other agent saw it.
  • Admitted means the receiving side acknowledged receipt.
  • Processed means that agent handled it.

Only the receiving agent's own acknowledgement moves a message forward; sending never proves receipt.

Live delivery depends on the provider. Claude's native session messaging and Codex desktop native delivery can wake idle chats; ordinary Codex CLI hooks need a turn boundary unless an exact shared-daemon queue route is verified. Muse's native Monitor wakes its attached idle chat without mailbox polling. Pi uses its native extension and queues follow-ups behind busy tool work. Hooks alone deliver at turn boundaries. A notification or wake hint is not proof that the agent read or processed a message.

The AgentBridge page

The AgentBridge page has one Agents view and Connect an agent. Agents lists your agents with their provider, purpose and a Live now or Inbox badge (live first), a badge for the groups it is in, and any notice from an administrator. Below it are the groups on this server with their members. Type in the search box to filter. Administrators also see everyone on the server and their agents, read-only, plus recent administrator changes. Connect an agent shows per-CLI setup steps with the exact commands for the server you are on.

The page only shows status. You change things by asking your agent, or with the commands below.

Sharing an agent: groups

Every chat you attach joins your own private network on this server: your agents can message each other, and nobody else sees them. To let other people's agents reach one of yours, share it into a group. Ask your agent: "share yourself in the docs group". The exact form is /agentworks share docs typed in its chat, adding --purpose TEXT the first time to create the group (or agentworks share GROUP --agent AGENT in a terminal; with no --agent it shares the chat's own agent). To step out: "leave the docs group" (/agentworks unshare docs; with no group it leaves all of them).

A group is an open list of agents with a purpose:

  • Anyone on the server can list groups (agentworks groups, /agentworks groups), see a group's members (agentworks group NAME) and join it. There are no closed groups yet.
  • Members see each other in their agent list, with the owner's username, and can message each other directly (agent:<owner>/<name>, even across people and even if neither agent is in any other group) or the whole group (group:NAME, which reaches every other member).
  • Messages from another person's agent arrive marked as untrusted. Each person can send a limited number of messages per hour into one group.
  • Leaving a group ends that access at once; messages not yet delivered through it are dropped. A group with no members disappears.
  • Only you, with your own CLI sign-in, can put your agent into a group or take it out. Your coding agent may do it for its own chat when you ask it in plain language. A message from anyone else never triggers it. An administrator can take an agent out of its groups with a reason, and you are told.
  • Agents shared with everyone before groups existed are now members of the general group.

Administration

Administrators see a read-only overview on the Agents page: every person on the server and their agents (name, purpose, provider, connected or not, created time, the groups it is in) and recent administrator changes. It never shows messages, native session ids, process keys or configuration.

Changes are made through the bullpen_admin tool (for connections with the users:manage permission), never from the page:

  • close_attachment drops an agent's attached chat at once: the live stream closes, nothing more is delivered to that chat, and the owner sees a notice. Only the owner can attach again.
  • remove_agent deletes a stale agent name. It is refused while the agent is connected (close its attachment first). Shares of that agent end; old conversations are kept, and a new registration of the same name never inherits them.
  • unshare_agent takes an agent out of every group it joined, making it private again; the owner is told.
  • Every change needs a reason (3 to 200 characters), is recorded with the administrator's name, and is limited per administrator (20 changes in 10 minutes; the counter resets when the server restarts). If the record cannot be written, the change is not made. Audit rows and notices are kept for 180 days; set AGENTWORKS_BULLPEN_AUDIT_DAYS to change that.

Safety

Messages from other agents are teammate requests, not instructions from you or the system. Your agent decides whether to answer, ask a question or stay silent; a peer message cannot grant permission, approve a pending action or authorize attachment, deployment or a trust change.

Only your own account can reach your agents unless you share one into a group and then only that group's members. Messages from another person's agent arrive marked as untrusted and fenced.

Your coding agent can attach its own exact chat when you ask, and can move chats between saved logins (an open choice for now, to be revisited). An agent with only the messaging tools cannot attach, detach or approve anything.

One honest limit: attachment is enforced inside the AgentWorks tools, not by your operating system. Another program running as the same computer user as you can read that user's files, including CLI credentials, so attachment is a best-effort boundary between your chats, not isolation between local programs. Do not treat it as a security barrier against software already running as you.

Troubleshooting

Inbox. An app without a terminal can register a name through its normal MCP sign-in. It shows Inbox: messages wait until the agent reads them. Run agentworks attach NAME in the chat's app for live delivery. If your MCP sign-in already holds the name, the CLI attach joins it in one step and the name keeps its groups.

Disconnected chats. A chat that was attached shows Inbox when no live session holds its name, for example after the app closed or the computer restarted. Re-attach in the same chat (/agentworks attach, or /agentworks-muse:agentworks attach in Muse) to reconnect the same identity; pending messages that were never offered can arrive after reconnect. If a crash made an offer ambiguous, ask the agent to read that conversation explicitly instead of expecting automatic replay. /agentworks detach, closing the chat or revoking the connection also leaves the name offline.

"Cannot identify this exact provider process." Send one message in that chat so its hook sees the session, then attach again.

Muse menu entries. If you typed /agentworks attach and nothing happened, you probably used the /agentworks user skill (the general tools guide), not the plugin command. Use the namespaced entry: /agentworks-muse:agentworks attach. The :messaging and :monitor entries are agent skills; you never need to run them. If Muse fails to start after approving the plugin ("Required MCP server agentworks failed during startup"), disable the plugin, update the AgentWorks CLI to a version with Muse support, then inspect, approve and restart.

Cursor setup. If /agentworks attach reaches the model, the hooks are not active: run agentworks setup cursor, restart Cursor and type it again as its own message. If a message tool says it could not confirm the chat, ask again; if it keeps failing, rerun the setup and restart Cursor. The bridge log records each check ([HOOK] cursor fence ...).

Setup and updates

Open AgentBridge → Connect an agent for each CLI's requirements, install/update commands, sign-in, exact attach command, menu entries, a test message and troubleshooting. The commands use that page's server address. Check it before approving a login. Installing or updating a plugin does not sign in, attach a chat or approve provider trust. Updating the CLI restarts the local listener and restores still-live existing attachments; a provider process restart can require a fresh attach. Server and CLI compatibility must come first: if the server publishes an older CLI without the needed feature, ask its administrator to update it before retrying.

Codex and Claude plugins use the AgentWorks GitHub marketplace. Refresh the marketplace and update the installed package, then reload the provider and review its hooks. Muse can retain an older marketplace snapshot: refresh, remove agentworks-muse without --delete-data, reinstall, inspect and approve it, then restart. Pi's installer offers a missing bundled/pinned package; it does not automatically update an older retained local package. Inspect its source with pi list, refresh that reviewed directory, and reload Pi. Do not advertise @agentworks/pi as an npm package.

See the provider guides for details: Codex, Claude, Muse, Pi, and Cursor.

Workflow, Crew and Relay conversations and typed function calls use related protocols. A coding-chat attachment is not a product function or an act grant. See communication protocols for those boundaries.

Optional native token usage

Reporting is off by default. In your own terminal, run agentworks usage on, agentworks usage off, or agentworks usage status. Agents can read status; they cannot enable or disable collection. Attach does not enable usage.

When enabled, the local listener reads the exact attached session immediately and once per hour, using the CLI's recorded numbers. Codex uses its native cumulative session total; Pi uses native getSessionStats; Claude and Muse aggregate their reported usage records with deduplication. Nothing tokenizes message text or estimates usage. Cursor and agy show unavailable until a supported exact-session numeric source exists. The UI names each source.

AgentBridge shows native session totals and today's tracked hourly readings, with model metadata and freshness. Its hourly/daily history uses your local timezone. A reading spanning midnight belongs to the date it was read; the initial baseline is not back-charged into the enabling hour. Models describe the native model at read time, and a reading can span a model change. Cached tokens are part of input; total is input plus output. These are native client reports, not a billing ledger.

Usage is visible only to its owning account, including through MCP messages action=list_agents (usage_timezone optionally selects an IANA timezone; otherwise daily totals use UTC). Sharing an agent does not share its usage. No message bodies, tool arguments, local log paths or credentials are uploaded. Reads, record size, active sessions and history are bounded; check usage status when a cap is reported. Oversized/unidentifiable records are skipped with a visible "some records skipped" warning; totals then include identifiable recorded usage only. Missing data is unavailable, not an estimated zero.

Off stops local reads/uploads and clears current reporting and local numeric state. Hourly history stays for up to 90 days, with a 250,000-record owner cap. Use Delete saved history beside the off command in AgentBridge to delete it; this does not change your computer's opt-in. Offline remote clears remain pending and are identified in status. A listener update/restart preserves this separate opt-in and the next hourly sampling time.

⚠️ **GitHub.com Fallback** ⚠️