Claude Context Sync
About
Share context, detect file conflicts, and send messages across parallel Claude Code sessions
Details
- Author
- ybin4548
- Downloads
- 326
- Categories
- AI, Communication
Jump to
- Session context sharing across parallel Claude Code sessions
- Real-time file conflict detection with symbol-level accuracy
- Cross-session messaging between terminals without switching
- Lazy evaluation with zero cost when tools aren't called
- Auto-cleanup of tracked data when sessions end
- Symbol-level detection for TypeScript, Python, Swift, Go, and Rust
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
Claude Context SyncCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Install globally with npm install -g claude-context-sync then run context-sync init. The MCP server starts automatically the next time you open Claude Code, and the init command registers a conflict detection hook. Four tools are available: list_sessions, get_session_context, get_all_changes, send_message, get_messages, and resolve_conflicts.
list_sessions
활성 Claude Code 세션 목록과 요약 상태를 반환합니다
get_session_context
특정 세션의 구조화된 요약을 반환합니다. 낙후된 경우 자동으로 재요약합니다.
get_all_changes
모든 세션의 변경 파일과 결정사항을 통합하여 반환합니다
resolve_conflicts
충돌이 해결된 파일을 추적 목록에서 제거합니다
send_message
다른 세션에 메시지를 전달합니다. targetSessionId 생략 시 같은 프로젝트의 모든 세션에 브로드캐스트합니다.
get_messages
세션의 수신 메시지 이력을 조회합니다
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"claude context sync": {
"claude-context-sync": {
"command": "npx",
"args": [
"-y",
"claude-context-sync",
"serve"
]
}
}
}
}
McpServers
{
"claude-context-sync": {
"command": "npx",
"args": [
"-y",
"claude-context-sync",
"serve"
]
}
}
claude-context-sync
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 endInstallation
``bash
npm install -g claude-context-sync
context-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)
| Language | Detected Symbols |
|----------|-----------------|
| TypeScript/JavaScript | function, class, interface, type, enum, const |
| Python | def, class |
| Swift | func, class, struct, protocol, enum, extension |
| Go | func, type (struct/interface) |
| Rust | fn, 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:
- GitHub Discussions — ideas, questions, show & tell
- GitHub Issues — bug reports, feature requests
Development
`bash
git clone https://github.com/ybin4548/claude-context-sync.git
cd claude-context-sync
npm install
npm run build
npm test
``
License
MITSign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.

