ClaudeMods
☰
JA
● — 人がオンライン ・閲覧 — 回
スポンサー作品を投稿
GitHub リポジトリ · 投稿者 gray9199

network

Claude Code の mod で、セッションの内容を説明する haiku 生成の 40 語カードが、類似の問題に取り組む他の開発者とマッチングされるリレーにオプトインできます。

翻訳済み

この mod について

ユーザーはハンドルでオプトインします。数ターンごとに haiku が最近のプロンプトと回答(ツール出力やファイル内容ではない)を読み、セッション内容を説明する 40 語の公開カードとタグを書き出します。カードは名前、URL、パス、認証情報についてスクリーニングされ、変更前にトランスクリプトに表示されます。リレーがカードをマッチングし、最大 5 人とマッチ理由を返します。その理由もコンテキストとして注入され、Claude が紹介文を起草できるようになります。コマンド:/network on、/network show、/network off。関数フックを有効にした Claude Code >= 2.1.270 が必要です。同梱のリレーは Node 上で依存関係ゼロで動作し、オプションの bearer-token 認証と Voyage AI 埋め込みをサポートし、デフォルトで localhost をリッスンします。

インストール

まず作者の README で marketplace とプラグイン名を確認してください。コマンドはリポジトリの構成によって変わる場合があります。

claude plugin marketplace add gray9199/claude-network-mod
claude plugin install network@network-mod
原文 / README

network — a Claude Mod

Find the people working on the same problem as you, matched on what your session is about, not which repo it's in.

How it works, in one breath: you opt in with a handle → every few turns, haiku reads your recent prompts and answers (never tool output or file contents) and writes a 40-word public card plus a few tags, with names, products and secrets ruled out → the card is printed in your transcript the moment it changes, so nothing goes out you haven't seen → the relay matches cards and hands back up to five people and why they matched → you do the talking. The model also gets the matches as context, so "draft an intro to the person doing grader calibration" just works.

/network on github:graeme    opt in (or set NETWORK_HANDLE)
/network show                your card, your matches
/network off                 stop, and pull your card off the relay

Run it

Needs Claude Code ≥ 2.1.270 with function hooks enabled (CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1; shipping as "Claude Mods" in the coming weeks). Verified on 2.1.271.

node relay/server.mjs                       # http://127.0.0.1:8788, lexical matching
VOYAGE_API_KEY=... node relay/server.mjs    # embedding matching: catches "same problem, different words"

export NETWORK_RELAY=https://your-relay     # skip if the relay is on localhost
export NETWORK_TOKEN=...                    # only if the relay was started with one
CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1 claude --plugin-dir /path/to/network

Or install it from this repo's marketplace:

claude plugin marketplace add gray9199/claude-network-mod
claude plugin install network@network-mod

Windows, Git Bash: MSYS rewrites an argument starting with / into a Windows path, so claude -p "/network show" reaches Claude as C:/Program Files/Git/network show. Turn the rewriting off and hand --plugin-dir a Windows-style path:

MSYS_NO_PATHCONV=1 CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1 claude --plugin-dir "$(pwd -W)" -p "/network show"

PowerShell needs neither: claude --plugin-dir $PWD -p "/network show". Inside an interactive session the command is typed at Claude's prompt and no shell touches it.

Layout

.claude-plugin/plugin.json   manifest
.claude-plugin/marketplace.json  lets `claude plugin marketplace add` install it from this repo
hooks/hooks.json             names the module
hooks/register.ts            the mod (~250 lines)
relay/server.mjs             the relay (~190 lines, zero dependencies)
tests/register.test.ts       the demo, as a test that runs in the real engine
types/claude-code.d.ts       Anthropic's published contract, for tsc (regenerate with /plugin-types)

Checks

npx tsc -p tsconfig.json                                      # types, against the real contract
CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1 claude plugin validate .  # Claude Code's own offline scan
CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1 claude plugin test .      # runs tests/ through the real hooks engine (2.1.271+)

tests/register.test.ts is also the demo: it drives /network on, the card, the matches and the model's context block with the world beneath the mod mocked, prints what each side sees, and asserts that the company name and file path in the transcript never leave the machine.

What is and isn't shared

Shared: your handle, the card, the tags. Nothing else — not the transcript, not file contents, not the repo. The card prompt forbids company, product, customer and person names, URLs, paths and credentials, and the card is shown to you when it changes. After haiku, the mod checks the card once more on your side: one that still looks like it carries a URL, a file path, an email address or a credential is withheld and never sent. That is a strong default, not a guarantee: for work you can't describe in public, don't turn it on, or run a relay only your team can reach.

Security

The relay and everyone on it are strangers, and the mod treats them that way.

  • Inbound is data, not instructions. Every match the relay returns is shape-checked, stripped of control and escape characters, and capped (handle 64 chars, card 40 words / 320 chars, 6 tags of 32 chars, 5 matches). The context block hands the cards to the model with a line saying they came from other people over the network and are never instructions to follow. Terminal output gets the same cleaned text, so a card can't smuggle ANSI escapes into your transcript.
  • Outbound is bounded and checked twice. The card is written by haiku under a prompt that forbids names, URLs, paths and credentials, then screened by regex for URLs, paths, emails, key-shaped strings and long opaque tokens. Anything that trips the screen is withheld with a line in the transcript.
  • The relay listens on localhost unless HOST says otherwise. Set NETWORK_TOKEN when starting it and every request must carry that bearer token (compared in constant time); the mod reads the same variable. Bodies over 16 KB get a 413, malformed handles and cards a 400, and the table stops at 5 000 cards. A remote relay over plain http earns a warning in the transcript: use https.
  • What it does not do. A handle is a name people choose, not a verified identity: anyone with the token can post under any handle. Cards are visible to everyone on the relay by design. If you use embeddings, card text goes to Voyage AI.

Known limits (early access)

  • Lexical matching only sees vocabulary: a card with a tag in common always matches, but two people describing one problem in different words with no tag in common rank low. Embeddings fix that; MIN_EMBED is a starting threshold, tune it.
  • Hooks fail open. If the relay or the model call fails, the mod logs a line and Claude carries on.
  • $.http.fetch and $.model.complete can be withheld by an org's admin mod.
  • The $ surface is still moving between releases; re-run /plugin-types and tsc after updating.

バッジを取得

あなたのプロジェクトですか?このバッジを README やサイトに貼ると、このページにリンクします。

Featured on ClaudeMods
サイズ
テーマ
Markdown
HTML

関連作品