Claude Context Sync

io.github.ybin4548由 GitHub 帳號 ybin4548 發布v0.4.1更新於 Oct 24, 2026

Share context, detect conflicts, and message across parallel Claude Code sessions

發布方自己的服務:Claude Platform Docs

已驗證STDIO僅桌面開發者工具溝通與協作

概覽

AI 產生的概覽

在同一台電腦上的多個平行 Claude Code 工作階段之間共享脈絡、偵測檔案與符號衝突並傳遞訊息。

可以做什麼
  • 列出使用中的 Claude Code 工作階段及其狀態、任務摘要與衝突
  • 讀取指定工作階段的結構化摘要,過期時自動重新產生,並依專案篩選彙整各工作階段的變更檔案與決策
  • 向其他工作階段傳送訊息或向同一專案廣播,並讀取工作階段的訊息紀錄
  • 清除已解決的衝突檔案紀錄
適用情境
適合在同一台電腦上平行執行多個 Claude Code 工作階段時使用,讓各工作階段了解彼此的工作、避免同時修改同一檔案或符號,並在終端機之間傳遞提示。
執行需求
本機 stdio 程序,透過 npm 安裝(npx 或全域安裝後執行 init 指令)。需要 Node.js 20+、Claude Code CLI(claude 指令)用於產生摘要,以及 jq 用於衝突偵測掛鉤。僅支援桌面端;未宣告 API 金鑰或環境變數。
安裝前請注意
它會監看 Claude Code 工作階段紀錄,並在使用者家目錄下寫入摘要、衝突資料與訊息;產生摘要會呼叫 Claude CLI,可能消耗用量或產生費用。init 指令會註冊掛鉤,把衝突提醒與未讀訊息注入工作階段。說明稱工作階段結束後會清除追蹤資料。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Claude Context Sync,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

claude-context-sync

[npm] [License: MIT]

MCP server that automatically summarizes and shares context across parallel Claude Code sessions.

When you run multiple Claude Code sessions on different tasks, each session is unaware of what the others are doing. claude-context-sync watches your session logs, generates structured summaries on demand, and provides real-time file conflict detection and cross-session messaging.

Features

  • Session context sharing — any session can see what others are working on
  • File conflict detection — real-time alerts when multiple sessions edit the same file
  • Symbol-level conflicts — detects shared function/class/interface edits (TypeScript, Python, Swift, Go, Rust)
  • Cross-session messaging — send messages between sessions without switching terminals
  • Lazy evaluation — zero cost when tools aren't called
  • Auto-cleanup — tracked data is removed when sessions end

Installation

bash
npm install -g claude-context-synccontext-sync init

That's it. The next time you open Claude Code, the MCP server starts automatically. The init command also registers a conflict detection hook.

MCP Tools

list_sessions

Returns active Claude Code sessions with their current status, task summary, and any file conflicts.

get_session_context

Returns the full structured summary for a specific session. Automatically re-summarizes if stale. Includes conflict information.

Parameters: sessionId (string)

get_all_changes

Returns changed files and decisions across all sessions, with optional project filtering.

Parameters: project (string, optional)

send_message

Sends a message to another session. Omit targetSessionId to broadcast to all sessions in the same project.

Parameters: fromSessionId (string), message (string), project (string), targetSessionId (string, optional)

get_messages

Returns message history for a session.

Parameters: sessionId (string), unreadOnly (boolean, optional)

resolve_conflicts

Clears resolved files from the conflict tracking list.

Parameters: sessionId (string), files (string[])

How It Works

Context Sharing

[Always running] Watcher: detects .jsonl changes → sets stale flag (zero cost)                    ↓[On tool call]   MCP Tool invoked → summarizes only stale sessions                    ↓                 Extractor → Generator (claude -p) → Store → Response

Conflict Detection

[Always running] Watcher: detects .jsonl changes                    ↓                 FileTracker: parses Write/Edit tool_use events                    ↓                 SymbolResolver: identifies enclosing function/class/type                    ↓                 Writes per-session touched files
[Every message]  Hook (UserPromptSubmit): checks for new conflicts                    ↓                 Alerts Claude once per new conflict → Claude notifies user

Messaging

Session A: send_message → writes to ~/.claude/context-sync/messages/{targetId}/                    ↓Session B: Hook detects unread message → injects into AI context                    ↓           Claude reads and relays to user → marks as read

Architecture

Single MCP server process — no separate daemon. Claude Code launches it automatically via stdio transport.

src/├── mcp/server.ts              # MCP server + 6 tools├── watcher/│   ├── watcher.ts             # File watching (chokidar)│   ├── scheduler.ts           # Hybrid summarization strategy│   ├── file-tracker.ts        # Real-time file edit tracking│   └── symbol-resolver.ts     # Pattern-based symbol detection├── summarizer/│   ├── extractor.ts           # .jsonl parsing + stratified sampling│   └── generator.ts           # claude -p invocation├── messaging/│   └── messenger.ts           # Cross-session message passing├── store/store.ts             # Local summary cache├── cli.ts                     # CLI (init + serve + hook registration)└── types.ts                   # Shared types

Summarization Strategy

  • Incremental: updates existing summary with new messages (default)
  • Full: regenerates from scratch (after 4 incremental updates)
  • Stratified sampling: for large sessions (500+ messages), samples head + middle + tail
  • Cached: returns stored summary if nothing changed (zero cost)

Supported Languages (Symbol Detection)

LanguageDetected Symbols
TypeScript/JavaScriptfunction, class, interface, type, enum, const
Pythondef, class
Swiftfunc, class, struct, protocol, enum, extension
Gofunc, type (struct/interface)
Rustfn, struct, enum, trait, impl

Unsupported file types fall back to file-level conflict detection.

Requirements

  • Node.js 20+
  • Claude Code CLI (claude command available)
  • jq (for conflict detection hook)

Feedback

We'd love to hear from you! If you have feature requests, bug reports, or just want to share how you use claude-context-sync:

Development

bash
git clone https://github.com/ybin4548/claude-context-sync.gitcd claude-context-syncnpm installnpm run buildnpm test

License

MIT

來源:README.md,提交 0f1880c

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.4.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Claude 整合