feat: implement cc-mess inter-Claude-Code communication plugin#2
Merged
Conversation
…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>
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>
Co-authored-by: Yaniv Golan <yaniv@golan.name>
Co-authored-by: Yaniv Golan <yaniv@golan.name>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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,
/messcommand 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
tsc --noEmittypecheck cleaneslint src/ tests/lint cleantscbuild succeeds