From session-bridge
Enables Claude Code agents to query connected peer sessions via bridge plugin, handle responses/follow-ups, and apply peer context to tasks like dependency updates or error fixes.
npx claudepluginhub patilshreyas/claude-code-session-bridge --plugin session-bridgeThis skill uses the workspace's default tool permissions.
You are connected to other Claude Code sessions via the Claude Bridge plugin. This skill defines how you communicate with peer agents.
Sends and receives direct messages between active Claude Code sessions on the same machine. Use for coordinating parallel sessions via dm, broadcast, active checks, and project-scoped messaging.
Manages Claude Code sessions: lists active ones, checks inbox for cross-session messages, broadcasts to all. Explicitly invoke via /session for multi-session coordination.
Enables multiple Claude Code instances on the same machine to discover peers and exchange real-time messages via local broker daemon and MCP server. Useful for coordinating multi-agent sessions.
Share bugs, ideas, or general feedback.
You are connected to other Claude Code sessions via the Claude Bridge plugin. This skill defines how you communicate with peer agents.
Getting your session ID: Always use bash "${CLAUDE_PLUGIN_ROOT}/scripts/get-session-id.sh" to get your session ID. This works even if you've cd'd into a subdirectory. In listen mode, use TO_ID from the message output instead (even more reliable).
When the user asks you to communicate with a peer — whether via /bridge ask, or in natural language like "ask the library about...", "check with the peer", "what did the other session change", etc. — do this:
MY_SESSION=$(bash "${CLAUDE_PLUGIN_ROOT}/scripts/get-session-id.sh" 2>/dev/null) || MY_SESSION=$(bash "${CLAUDE_PLUGIN_ROOT}/scripts/register.sh")
Then find connected peers:
find ~/.claude/session-bridge/sessions/$MY_SESSION/inbox -name "*.json" -exec jq -r 'select(.type == "ping") | "\(.metadata.fromProject) (\(.from))"' {} \; 2>/dev/null | sort -u
If no connected peers found but the user specified a peer by name or session ID, connect first:
BRIDGE_SESSION_ID=$MY_SESSION bash "${CLAUDE_PLUGIN_ROOT}/scripts/connect-peer.sh" "<peer-id>"
MSG_ID=$(BRIDGE_SESSION_ID=$MY_SESSION bash "${CLAUDE_PLUGIN_ROOT}/scripts/send-message.sh" <peer-id> query "Your question here")
bash "${CLAUDE_PLUGIN_ROOT}/scripts/bridge-receive.sh" "$MY_SESSION" "$MSG_ID" 90
bridge-receive.sh.Query immediately (don't wait for errors) when:
Query on errors when you encounter:
When responding to peer queries (in listen mode), include actual code — don't just describe it. Read the relevant source files in your project and paste the important parts. For example, if a peer asks about a type or function signature, read the file and include the actual definition — not just a description of it.
When querying a peer, if you need their actual file content, ask specifically — e.g., "Send me the contents of your config file" or "What does the function signature look like? Include the actual code."
/bridge listen)When the user runs /bridge listen, you enter a continuous listening loop:
bridge-listen.sh (blocks until a message arrives)TO_ID from the output as your session IDbridge-listen.sh againYou MUST keep the loop going. After every response, immediately call bridge-listen.sh again. Never stop to ask the user what to do. Never break the loop.
When a query message arrives (in listen mode or otherwise):
TO_ID from the message as your session ID:
BRIDGE_SESSION_ID=<TO_ID> bash "${CLAUDE_PLUGIN_ROOT}/scripts/send-message.sh" <FROM_ID> response "Your answer" <MESSAGE_ID>
inReplyTo set so the peer's bridge-receive.sh picks it up):
BRIDGE_SESSION_ID=<TO_ID> bash "${CLAUDE_PLUGIN_ROOT}/scripts/send-message.sh" <FROM_ID> response "I need more info: <your question>. Please clarify and ask again." <MESSAGE_ID>
The peer will receive this via bridge-receive.sh, see it's a question, answer it, and send a new query. Your listen loop will pick up the follow-up.When a ping message arrives, acknowledge using TO_ID:
BRIDGE_SESSION_ID=<TO_ID> bash "${CLAUDE_PLUGIN_ROOT}/scripts/send-message.sh" <FROM_ID> ping "connected"
send-message.sh — never write message JSON files directly.TO_ID from the message output as BRIDGE_SESSION_ID.get-session-id.sh to get your session ID reliably.$(cat .claude/bridge-session) directly — it's a relative path that breaks when the working directory changes.