Skip to content

feat: implement cc-mess inter-Claude-Code communication plugin#2

Merged
yaniv-golan merged 9 commits into
mainfrom
cursor/internal-design-content-8783
Mar 23, 2026
Merged

feat: implement cc-mess inter-Claude-Code communication plugin#2
yaniv-golan merged 9 commits into
mainfrom
cursor/internal-design-content-8783

Conversation

@yaniv-golan

Copy link
Copy Markdown
Owner

What

Full implementation of the cc-mess plugin as specified in docs/internal/design.md — a file-based mesh networking system for multiple Claude Code instances.

Why

Enables multiple Claude Code instances to discover each other, communicate, delegate tasks, share insights, and develop emergent trust relationships. Human observes and controls the mesh via Telegram integration.

How

Implements all 5 sub-projects from the design doc:

SP-1: Transport & Registry — File-based messaging under ~/.claude/channels/mess/, atomic writes via temp+rename, lockfile-protected registry, at-least-once delivery with persistent deduplication, heartbeat-based liveness detection.

SP-2: MCP Server & Tools — 7 MCP tools (send, broadcast, reply, list_instances, spawn, kill, update_self), channel notification formatting, poll-based inbox delivery.

SP-3: Spawn & Guardrails — Process launch via child_process.spawn() (no shell interpolation), 3 guardrail profiles (strict/permissive/custom), path canonicalization, spawn depth enforcement, atomic admission with placeholder reaping.

SP-4: Telegram Relay — Event formatting, verbosity control (quiet/normal/verbose), status reports, human-to-instance message parsing, /mess command formatting.

SP-5: Trust & Reputation — Documentation patterns for emergent per-instance trust via Claude Code memory.

Also includes: CI/CD workflows (lint/typecheck/test/release/CodeQL), GitHub config (issue templates, PR template, CODEOWNERS), project docs (README with mermaid diagram, CONTRIBUTING, SECURITY, CHANGELOG, LICENSE), hook scripts, skill files, and plugin configuration.

Test plan

  • Unit tests pass (4 files, 59 tests: names, registry, transport, guardrails)
  • Integration tests pass (3 files, 44 tests: mesh-lifecycle, concurrent-spawn, coordinator-failover)
  • tsc --noEmit typecheck clean
  • eslint src/ tests/ lint clean
  • tsc build succeeds
Open in Web Open in Cursor 

cursoragent and others added 4 commits March 23, 2026 00:14
…guardrails, spawn, and relay

- types.ts: shared types for messages, registry, config, control
- names.ts: pool of ~200 mythological names + allocation logic
- registry.ts: register, heartbeat, liveness, cleanup, lockfile, atomic writes
- transport.ts: inbox polling, message delivery, control.json, dedup
- tools.ts: MCP tool handlers (send, broadcast, reply, list, spawn, kill, update_self)
- spawn.ts: process launch, guardrail hooks, cwd validation, placeholder reaping
- guardrails.ts: strict/permissive/custom profiles, path canonicalization
- telegram-relay.ts: event formatting, verbosity, status reports
- server.ts: MCP server entry point with polling loop and graceful shutdown
- Project infrastructure: package.json, tsconfig, eslint, vitest, editorconfig
- GitHub config: CI/CD workflows, issue templates, PR template, CODEOWNERS
- Docs: LICENSE, CONTRIBUTING, SECURITY, CHANGELOG

Co-authored-by: Yaniv Golan <yaniv@golan.name>
…anifest

- hooks/guardrail.sh: policy enforcement script (reads tool JSON, checks profile)
- hooks/hooks.json: mesh activity tracking hook config
- hooks/profiles/: strict, permissive, and custom-template JSON profiles
- .claude-plugin/plugin.json: plugin metadata
- .mcp.json: MCP server configuration
- skills/status/SKILL.md: /mess:status skill
- skills/configure/SKILL.md: /mess:configure skill

Co-authored-by: Yaniv Golan <yaniv@golan.name>
… and configuration reference

Co-authored-by: Yaniv Golan <yaniv@golan.name>
Unit tests (4 files):
- names.test.ts: pool size, uniqueness, allocation, short name resolution
- registry.test.ts: atomic writes, lockfile, CRUD, liveness, spawn slots, failover
- transport.test.ts: message creation, delivery, polling, dedup, pause filtering
- guardrails.test.ts: strict/permissive/custom profiles, path checks, bash commands

Integration tests (3 files):
- mesh-lifecycle.test.ts: full register→communicate→deregister cycle, peer-to-peer
- concurrent-spawn.test.ts: capacity limits, depth enforcement, placeholder reaping
- coordinator-failover.test.ts: role transfer, inbox preservation, crash recovery

Bug fix: pollInbox now tracks actual filenames instead of reconstructing them
from msg.timestamp, fixing dedup failures when write time differs from
message creation time.

All 103 tests pass. Typecheck and lint clean.

Co-authored-by: Yaniv Golan <yaniv@golan.name>
@yaniv-golan yaniv-golan marked this pull request as ready for review March 23, 2026 04:43
cursoragent and others added 5 commits March 23, 2026 04:49
Co-authored-by: Yaniv Golan <yaniv@golan.name>
…checkout

Co-authored-by: Yaniv Golan <yaniv@golan.name>
Co-authored-by: Yaniv Golan <yaniv@golan.name>
@yaniv-golan yaniv-golan merged commit 11c5d37 into main Mar 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants