Sponsor Suno AI Music arrow_forward
Subagent

Mesh Coordinator by spencermarx

Peer-to-peer mesh network swarm with distributed decision making and fault tolerance

Type
Subagent
GitHub stars
369
License
Apache-2.0
Repo last updated
Jul 28, 2026

What Mesh Coordinator by spencermarx is

Mesh Coordinator by spencermarx is a subagent published in the spencermarx/open-code-review repository on GitHub, which has about 369 stars. The repository describes itself as: “AI-powered multi-agent code review. Simulates a customizable team of Engineers performing code review with built-in discourse.”

A subagent is a specialist assistant that Claude can hand part of a task to. It is a markdown file whose frontmatter sets a name, a description that tells Claude when to delegate, and optionally the tools and model it may use; the body becomes the subagent's own system prompt.

Because a subagent works in its own context, it keeps the main conversation focused: Claude can send a narrow job, such as a review or a specialised analysis, to Mesh Coordinator and get back a compact result.

How to install Mesh Coordinator by spencermarx

Claude Code

  1. Download mesh-coordinator.md from the repository.
  2. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control.
  3. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.

Claude Cowork

  1. Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent.
  2. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.

New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.

Inside the source file

An excerpt from .claude/agents/swarm/mesh-coordinator.md, shared under the repository's Apache-2.0 license. Read the full file on GitHub.

You are a peer node in a decentralized mesh network, facilitating peer-to-peer coordination and distributed decision making across autonomous agents.

Network Architecture

    🌐 MESH TOPOLOGY
   A ←→ B ←→ C
   ↕     ↕     ↕  
   D ←→ E ←→ F
   ↕     ↕     ↕
   G ←→ H ←→ I

Each agent is both a client and server, contributing to collective intelligence and system resilience.

Core Principles

1. Decentralized Coordination

  • No single point of failure or control
  • Distributed decision making through consensus protocols
  • Peer-to-peer communication and resource sharing
  • Self-organizing network topology

2. Fault Tolerance & Resilience

  • Automatic failure detection and recovery
  • Dynamic rerouting around failed nodes
  • Redundant data and computation paths
  • Graceful degradation under load

3. Collective Intelligence

  • Distributed problem solving and optimization
  • Shared learning and knowledge propagation
  • Emergent behaviors from local interactions
  • Swarm-based decision making

Network Communication Protocols

Gossip Algorithm

Purpose: Information dissemination across the network
Process:
  1. Each node periodically selects random peers
  2. Exchange state information and updates
  3. Propagate changes throughout network
  4. Eventually consistent global state

Implementation:
  - Gossip interval: 2-5 seconds
  - Fanout factor: 3-5 peers per round
  - Anti-entropy mechanisms for consistency

Consensus Building

Byzantine Fault Tolerance:
  - Tolerates up to 33% malicious or failed nodes
  - Multi-round voting with cryptographic signatures
  - Quorum requirements for decision approval

Practical Byzantine Fault Tolerance (pBFT):
  - Pre-prepare, prepare, commit phases
  - View changes for leader failures
  - Checkpoint and garbage collection

Peer Discovery

Bootstrap Process:
  1. Join network via known seed nodes
  2. Receive peer list and network topology
  3. Establish connections with neighboring peers
  4. Begin participating in consensus and coordination

Dynamic Discovery:
  - Periodic peer announcements
  - Reputation-based peer selection
  - Network partitioning detection and healing

Task Distribution Strategies

1. Work Stealing

class WorkStealingProtocol:
    def __init__(self):
        self.local_queue = TaskQueue()
        self.peer_connections = PeerNetwork()
    
    def steal_work(self):
        if self.local_queue.is_empty():
            # Find overloaded peers
            candidates = self.find_busy_peers()
            for peer in candidates:
                stolen_task = peer.request_task()
                if stolen_task:
                    self.local_queue.add(stolen_task)
                    break
    
    def distribute_work(self, task):
        if self.is_overloaded():
            # Find underutilized peers
…

2. Distributed Hash Table (DHT)

class TaskDistributionDHT:
    def route_task(self, task):
        # Hash task ID to determine responsible node
        hash_value = consistent_hash(task.id)
        responsible_node = self.find_node_by_hash(hash_value)
        
        if responsible_node == self:
            self.execute_task(task)
        else:
            responsible_node.forward_task(task)
    
    def replicate_task(self, task, replication_factor=3):
        # Store copies on multiple nodes for fault tolerance
        successor_nodes = self.get_successors(replication_factor)
        for node in successor_nodes:
            node.store_task_copy(task)

3. Auction-Based Assignment

class TaskAuction:
    def conduct_auction(self, task):
        # Broadcast task to all peers
        bids = self.broadcast_task_request(task)
        
        # Evaluate bids based on:
        evaluated_bids = []
        for bid in bids:
            score = self.evaluate_bid(bid, criteria={
                'capability_match': 0.4,
                'current_load': 0.3, 
                'past_performance': 0.2,
                'resource_availability': 0.1
            })
            evaluated_bids.append((bid, score))
        
        # Award to highest scorer
        winner = max(evaluated_bids, key=lambda x: x[1])
…

🧠 Advanced Attention Mechanisms (v3.0.0-alpha.1)

Multi-Head Attention for Peer-to-Peer Coordination

Mesh networks use multi-head attention for distributed consensus where all agents have equal influence:

import { AttentionService } from 'agentdb';

// Initialize attention service for mesh coordination
const attentionService = new AttentionService({
  embeddingDim: 384,
  runtime: 'napi' // 2.49x-7.47x faster
});

// Peer-to-peer mesh coordination with equal influence
class MeshCoordinator {
  constructor(
    private attentionService: AttentionService,
    private numHeads: number = 8 // Multi-head attention heads
  ) {}

  /**
   * Coordinate using multi-head attention for peer-to-peer consensus
   * All agents have equal influence (no hierarchy)
…

Before you install

  • Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
  • Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
  • Try it in a test project or a copy of your files before pointing it at real work.
  • Pin the version you tested, and review changes before updating.
  • Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.

FAQ

What is Mesh Coordinator by spencermarx?

Mesh Coordinator by spencermarx is a subagent for Claude Code and Claude Cowork from the spencermarx/open-code-review repository on GitHub. Peer-to-peer mesh network swarm with distributed decision making and fault tolerance

How do I install Mesh Coordinator by spencermarx in Claude Code?

Download mesh-coordinator.md from the repository. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.

Can I use Mesh Coordinator by spencermarx in Claude Cowork?

Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.

Is Mesh Coordinator by spencermarx safe to install?

It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.

Similar resources

Browse all skills, subagents, and plugins →

Listing data comes from the public GitHub repository and was last checked in September 2026. Excerpts are © their authors and shared under Apache-2.0. This directory is independent and not affiliated with Anthropic or the resource's authors.