bridge

bridge is a command for Claude Code 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 for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions Claude Code.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

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

Good fit Use it to register a session, connect to another session by ID, receive and answer peer queries, inspect connection status, or stop the connection.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add PatilShreyas/claude-code-session-bridge
Claude Code
/plugin install session-bridge

Made for: Claude Code.

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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for bridge

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00024 $0.01761
Opus 5.5 $0.00010 $0.00704
Sonnet 5.5 $0.00005 $0.00352
Haiku 4.5 $0.00002 $0.00176

Measured 1mo ago against content hash 0776992af60e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo 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 (67 stars, last pushed 6mo ago), licensed MIT. It adds 24 tokens to every session and 1,761 once invoked, about $0.0001 per session on Opus 5.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.