bridge

bridge is a command for coding agents from PatilShreyas/claude-code-session-bridge. It costs 24 tokens per session (1,761 once invoked), scanned B, original, MIT.

A command for connecting separate Claude Code sessions on the same computer so they can communicate. It can start, connect, listen to, check, and stop these connections.

In plain words
What is it for?
Use it to register a session, connect to another session by ID, receive and answer peer queries, inspect connection status, or stop the connection.
Why use it?
It removes the need to manually coordinate information between separate agent sessions working on related tasks.

Command

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the session-bridge plugin — 1 skill, 1 command, 1 hook shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/patilshreyas/claude-code-session-bridge/bridge
Clone the repo
git clone --depth 1 https://github.com/PatilShreyas/claude-code-session-bridge

Or install session-bridge, the plugin that ships this one along with the rest of its 1 skill, 1 command, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for bridge

README.md
[![agentmods](https://agentmods.dev/badge/commands/patilshreyas/claude-code-session-bridge/bridge.svg)](https://agentmods.dev/commands/patilshreyas/claude-code-session-bridge/bridge)
Your own site
<a href="https://agentmods.dev/commands/patilshreyas/claude-code-session-bridge/bridge"><img src="https://agentmods.dev/badge/commands/patilshreyas/claude-code-session-bridge/bridge.svg" alt="Measured on agentmods" height="20"></a>
Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,761 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00024 $0.01761
Opus 5 $0.00012 $0.00881
Sonnet 5 $0.00005 $0.00352
Haiku 4.5 $0.00002 $0.00176

Measured 4d ago against content hash 0776992af60e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

bridge scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

This works even if you've cd'd into a subdirectory. NEVER use `$(cat .claude/bridge-session)` directly — it's a relative path and breaks when the working directory changes.
plugins/session-bridge/commands/bridge.md · 202 lines

How it starts

The opening of the file, as written. The whole thing — 202 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Bridge Command

Manage cross-session communication with other Claude Code instances on this machine.

IMPORTANT: To get your session ID, always use:

bash "${CLAUDE_PLUGIN_ROOT}/scripts/get-session-id.sh"

This works even if you've cd'd into a subdirectory. NEVER use $(cat .claude/bridge-session) directly — it's a relative path and breaks when the working directory changes.

Actions

Parse the user's argument to determine the action:

start

Register this session as a bridge peer.

  1. Run the registration script:
    bash "${CLAUDE_PLUGIN_ROOT}/scripts/register.sh"
    
  2. Capture the session ID from stdout.
  3. Display to the user:
    Bridge active!
    Session ID: <session-id>
    Share this ID with other Claude sessions to connect: /bridge connect <session-id>
    Use /bridge listen to start receiving and answering peer queries.
    

connect <session-id>

Connect to a peer session. Auto-starts this session's bridge if not already active.

  1. Extract the session ID from the argument.
  2. Check if this session has a bridge:
    bash "${CLAUDE_PLUGIN_ROOT}/scripts/get-session-id.sh"
    
    If it exits with code 1 (not found), auto-start the bridge first:
    bash "${CLAUDE_PLUGIN_ROOT}/scripts/register.sh"
    
    Capture the session ID from stdout and note it for the user.
  3. Then connect to the peer:
    BRIDGE_SESSION_ID=$(bash "${CLAUDE_PLUGIN_ROOT}/scripts/get-session-id.sh") bash "${CLAUDE_PLUGIN_ROOT}/scripts/connect-peer.sh" "<session-id>"
    
  4. If successful, display the peer's project name and path. If you auto-started in step 2, also show this session's ID.
  5. If it fails (peer not found), suggest /bridge peers to see available sessions.
  6. Tell the user: "Connected! Use /bridge listen to start answering peer queries, or /bridge ask <question> to ask them something."

listen

Enter listening mode — continuously wait for peer messages and respond to them. This dedicates the session to answering peer queries using YOUR FULL CONTEXT.

Read the full file on GitHub · 202 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 202 lines · 24 tokens per session scan B 0776992af60e

Subscribe to this mod's changes

bridge is a command published in the GitHub repository PatilShreyas/claude-code-session-bridge (66 stars, last pushed 5mo ago), licensed MIT. It adds 24 tokens to every session and 1,761 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.