Mesh-first distributed AI runtime for field operations, operator oversight, and safe execution.
ClawMesh turns a laptop, Jetson, sensors, actuators, and operator surfaces into one trust-gated, capability-aware runtime.
Screenshots · Problem · System Flow · Architecture Choices · Quickstart · Safety · Development
These are real screenshots captured from the live local runtime in this repository.
Topology |
Telemetry |
Command Center — Operators talk to the runtime, review outcomes, and keep approvals inside the same control surface.
ClawMesh is a distributed AI control-plane runtime for systems that do not fit inside one process or one machine.
Typical real deployment:
- a command-center laptop hosts the planner, operator UI, approvals, and credentials
- a Jetson or field node hosts sensors, cameras, or actuators
- other nodes may host models, private network access, or specialized capabilities
- operators need one system that can reason across all of it safely
ClawMesh solves that by giving you:
- device identity with Ed25519 keys
- trusted peer connections across LAN or static/WAN links
- capability-based routing instead of host-by-host glue logic
- shared context propagation so the planner reasons over mesh state, not just local memory
- proposal-based execution so real actuation stays human-governed
- operator-facing status surfaces for topology, telemetry, command, and approvals
In short: ClawMesh is the runtime glue between distributed sensing, distributed planning, and safe distributed execution.
Most AI + robotics / field-ops stacks break down in the same ways:
A browser, a laptop planner, a Jetson, a sensor bus, and an actuator controller are often treated like one app with point-to-point hacks.
That causes:
- brittle host assumptions
- ad-hoc tunnels and proxies
- duplicated integration logic
- poor failover behavior
Sensor data, approvals, operator instructions, and node health live in separate channels.
That causes:
- partial reasoning
- duplicate actions
- stale assumptions
- poor operator confidence
A useful planner should be able to reason and propose, but LLM-only reasoning must not directly flip real hardware.
That causes a design requirement, not a feature request:
- proposals
- approvals
- trust tiers
- evidence tracking
- enforcement on both sender and receiver
Without good surfaces, teams cannot answer:
- what is the planner doing?
- why is it queued?
- which node is connected?
- which peer is stale?
- what proposal is pending?
- what changed recently?
ClawMesh is built to make those answers operationally obvious.
flowchart LR
Operator[Operator]
Browser[Browser UI\nTopology / Telemetry / Command]
CC[Command Center Node\nplanner + gateway + approvals]
WM[Mesh World Model\nshared context frames]
Router[Capability Router\nrole-aware routing]
Field[Field Node / Jetson]
Sensors[Sensors / Cameras]
Actuators[Actuators]
Props[Proposal Queue\nL1/L2/L3 approvals]
Operator --> Browser
Browser --> CC
CC --> WM
CC --> Router
Router --> Field
Field --> Sensors
Router --> Props
Props --> Operator
Props --> Router
Router --> Actuators
Sensors --> WM
Field --> WM
sequenceDiagram
participant O as Operator
participant UI as Browser UI
participant CC as Command Center Node
participant P as Planner Leader
participant WM as World Model
participant F as Field Node
participant A as Approval Lane
O->>UI: Ask question / request action
UI->>CC: mesh.message.forward
CC->>P: Route to planner leader
P->>WM: Query recent observations, events, proposals
alt Read-only / safe response
P-->>UI: agent response + citations
else Action required
P->>A: Create proposal
A-->>O: Await approval
O->>A: Approve / reject
A->>F: Execute approved command
F-->>UI: Result + status update
end
The browser is not the backend.
ClawMesh is designed so the browser can talk to a local command-center node, and that node can safely route work into the mesh. That keeps credentials, trust, peer logic, and approvals in the runtime instead of leaking them into the browser.
This backend is not an arbitrary pile of technologies. Each major piece exists because it solves a specific failure mode seen in real multi-device systems.
| Problem in real deployments | Architectural choice in ClawMesh | Why this choice exists |
|---|---|---|
| Devices should not trust random peers just because they can see them | Ed25519 identity + trusted peer store | Gives each device a stable identity and lets operators explicitly decide trust |
| Hostnames and fixed topologies break as devices move or change roles | Capability-based routing + explicit roles | Work is routed to what a node can do, not where someone hard-coded it |
| LAN deployments want simplicity; WAN deployments need explicit safety | mDNS discovery + static peer mode + transport labels + TLS posture | Lets local networks stay easy while making WAN connections visible, intentional, and enforceable |
| Planner reasoning should span multiple nodes, not one local process | Context propagation + world model | Shares observations, events, human input, and planner output across the mesh |
| Multi-planner meshes need deterministic behavior | Planner election + leader-aware forwarding | Prevents split-brain operator handling and lays groundwork for HA |
| A browser should not connect directly to every field node | Command-center gateway node | Keeps trust, routing, credentials, and policy in the runtime rather than in the browser |
| LLMs are useful for planning but unsafe as direct actuator controllers | Proposal workflow + trust tiers + approval levels | Forces high-risk operations through human-governed execution paths |
| Operators need runtime truth, not demo UI | mesh.status / mesh.health / mesh.peers / mesh.events + live UI | Makes the system observable in terms operators actually need |
| Stale peers and flaky links can poison distributed behavior | Peer lifecycle handling + reachability confirmation + dead-peer suppression | Prevents ghost reconnects, bad peer.down reports, and duplicate lifecycle churn |
Problem: “How do I know this is really my Jetson and not just something on the network?”
Solution: Each node has a persistent Ed25519 identity. Peers are explicitly trusted and persisted locally.
Operator value: You can reason about the mesh in terms of actual devices, not anonymous sockets.
Problem: “LAN should be easy, WAN should be explicit.”
Solution: Local meshes can auto-discover with mDNS. WAN/static mode disables discovery and uses explicit peers with transport labeling and posture reporting.
Operator value: You can choose convenience for LAN, determinism for WAN, and see exactly what transport the system is using.
Problem: “I do not want to wire every action to a specific host forever.”
Solution: Nodes advertise capabilities, and the runtime routes based on capability and role.
Operator value: Adding or moving a node does not force a rewrite of every control path.
Problem: “The planner is blind if state is fragmented across nodes.”
Solution: Observations, events, human inputs, and planner outputs are propagated as frames and ingested into a mesh-wide world model.
Operator value: The planner can answer based on real shared state, and telemetry can show what the runtime actually knows.
Problem: “The planner needs queueing, mode control, tool calls, error handling, and safe integration with the mesh.”
Solution: PiSession wraps the planner session, trigger queue, proactive checks, tool execution, and broadcast path.
Operator value: You can see when the planner is idle, queued, thinking, or inside a tool call, instead of treating it like a black box.
Problem: “Reasoning is not execution.”
Solution: The planner proposes work, approvals are explicit, ownership is tracked, and decisions are observable.
Operator value: Human approval becomes part of the runtime, not a side conversation.
Problem: “Someone has to orchestrate identity, peers, RPCs, context, UI events, proposals, and health surfaces coherently.”
Solution: The node runtime is the control-plane orchestrator for a ClawMesh node.
Operator value: The system has one consistent runtime contract whether it is running as planner, field node, or viewer/gateway.
Problem: “Dashboards often lie because they are disconnected from backend truth.”
Solution: The UI polls and subscribes to backend runtime surfaces and live context frames.
Operator value: Refresh-safe telemetry, live topology, and command-center state reflect the real runtime instead of mock cards.
- trusted LAN peer discovery via mDNS
- static peer configuration for WAN or discovery-disabled deployments
- stable mesh identity and protocol-generation validation
- explicit node roles:
planner,field,sensor,actuator,viewer,standby-planner,node - peer lifecycle handling for graceful leave, hard down, reachability confirmation, and dead-peer suppression
- Pi-powered planner integration
- proposal-based execution flow with approval levels
- mesh-wide world model from propagated context frames
- planner ownership and leadership groundwork
- leader-aware command-center forwarding
- Ed25519 mutual identity
- trusted peer store
- actuation trust tiers (T0-T3)
- approval levels (L0-L3)
- hard block on LLM-only physical actuation
- web UI for topology, command, telemetry, and twins
- CLI status, trust, identity, and admin operations
- Telegram interface for status and approvals
- TUI support
- machine-readable runtime surfaces via
mesh.status,mesh.health,mesh.peers, andmesh.events
- discovery-disabled static mode
- transport labels such as
relay,vpn,lan,local,mdns - URL normalization from
http(s)tows(s) - startup diagnostics for insecure or unpinned WAN links
- posture surfaced in health, status, logs, and operator views
- WAN enforcement for non-local transports while keeping explicit local labels permissive
- Node.js
pnpm- a sibling checkout of
../pi-monofor the current localfile:dependencies in this repo
Optional but commonly needed:
- provider API keys for planner usage
- Telegram bot token if using Telegram
pnpm install
pnpm typecheck
pnpm testIf clawmesh is not installed on your PATH yet, use:
pnpm exec tsx clawmesh.ts <command>The examples below use clawmesh for readability. In a source checkout, replace that with pnpm exec tsx clawmesh.ts.
clawmesh start --name dev-node --capability channel:clawmeshStart the runtime:
clawmesh start \
--name ops-main \
--role planner \
--command-center \
--pi-model anthropic/claude-sonnet-4-5-20250929Start the web UI:
cd ui
pnpm install
pnpm devclawmesh start \
--name field-jetson \
--role field \
--field-node \
--mock-sensor \
--mock-actuatorclawmesh status --url ws://localhost:18789
clawmesh status --url ws://localhost:18789 --events
clawmesh peers
clawmesh worldA deployment pattern that fits this repository well is:
- planner leader
- browser UI host
- approvals / operator surface
- local model or remote provider
- field role
- sensors / cameras / actuators
- no direct browser dependency
- connects outbound to the Mac command center
That gives you a clean operational split:
- browser talks to Mac
- Mac talks to mesh
- Jetson contributes field capabilities
- trust and approvals stay in the runtime
clawmesh start --name edge-a --capability sensor:mock
clawmesh start --name edge-b --capability channel:clawmeshUse this when nodes share a local network and you want trusted peers to auto-connect.
clawmesh start \
--name wan-node \
--no-discovery \
--peer "<deviceId>=https://relay.example.com/mesh|sha256:ABCDEF...|relay"Use this when peers are not on the same LAN or when you want deterministic startup and explicit connection intent.
clawmesh start --name ops-main --mesh-name bhoomi-prod --role planner
clawmesh start --name field-jetson --mesh-name bhoomi-prod --role fieldThis helps reject accidental cross-mesh joins.
Common patterns:
planner— primary planning nodestandby-planner— HA groundwork / hot standby rolefield— mixed edge node with sensors and actuatorssensor— read-focused nodeactuator— execution-focused nodeviewer— passive observer that does not affect routing
Static peers are passed with --peer.
<deviceId>=<url>|<tlsFingerprint>|<transportLabel>
Where:
deviceIdis the trusted peer device IDurlmay bews://,wss://,http://, orhttps://tlsFingerprintis optional for local peers, but required for WAN-safe labeled peerstransportLabelis optional but strongly recommended for non-LAN peers
Examples:
clawmesh start --peer "<deviceId>=ws://10.0.0.5:18789||lan"clawmesh start --no-discovery \
--peer "<deviceId>=https://relay.example.com/mesh|sha256:ABCDEF...|relay"clawmesh start --no-discovery \
--peer "<deviceId>=wss://vpn.example.com/mesh|sha256:ABCDEF...|vpn"ClawMesh is opinionated here because field systems need stronger guarantees than general chat systems.
Peers are not trusted just because they are visible.
clawmesh trust add <deviceId>
clawmesh trust list
clawmesh trust remove <deviceId>Trusted peers are persisted in:
~/.clawmesh/mesh/trusted-peers.json
| Tier | Meaning |
|---|---|
T0 |
planning inference |
T1 |
unverified observation |
T2 |
operational observation |
T3 |
verified action evidence |
| Level | Meaning |
|---|---|
L0 |
safe read-only |
L1 |
bounded auto-execute |
L2 |
human approval required |
L3 |
strongest verification / on-site style control |
LLM-only evidence is hard-blocked from physical actuation.
That means the planner can:
- reason
- summarize
- route
- propose
- explain
But it cannot unilaterally trigger real-world actuation without the required trust and approval evidence.
Answers:
- what nodes exist?
- who is connected?
- what does the runtime know right now?
Answers:
- what is the planner doing?
- is it queued, thinking, or inside a tool call?
- what changed recently?
- how healthy is the runtime?
Answers:
- how does an operator talk to the system?
- what did the planner say?
- what proposals need review?
Useful commands:
clawmesh identity
clawmesh start
clawmesh status --url ws://localhost:18789 --events
clawmesh trust list
clawmesh credential list
clawmesh gateway-connect --url ws://192.168.1.39:18789
clawmesh gatewaysclawmesh start --command-center --telegram --telegram-chat <chatId>Telegram supports:
/status/world/proposals/approve <id>/reject <id>/alerts
clawmesh start --command-center --tuiThe TUI gives you peers, context activity, proposals, planner state, and interactive command input in the terminal.
ClawMesh exposes runtime state through:
mesh.peersmesh.statusmesh.healthmesh.events- startup diagnostics
- connection and error logs
Current operator-visible details include:
- discovery mode
- connected peers
- configured static peers
- transport labels
- static peer security posture (
insecure,tls-unpinned,tls-pinned) - planner activity and leader context
- planner queue/tool state
This is especially useful in WAN/static deployments, where operators need to answer:
“What did this node think it should connect to, what is it doing now, and how safe is that path?”
src/mesh/node-runtime.ts— node orchestratorsrc/mesh/peer-connection-manager.ts— outbound peer lifecyclesrc/mesh/peer-client.ts/src/mesh/peer-server.ts— WebSocket transportsrc/mesh/discovery.ts— mDNS discoverysrc/mesh/server-methods/— RPC handlers
src/agents/pi-session.ts— planner/session integrationsrc/agents/extensions/— mesh tools and operator commandssrc/agents/proposal-*.ts— proposal lifecycle and formatting
src/channels/telegram.ts— Telegram bridgesrc/tui/— terminal dashboardui/— browser dashboard
src/infra/device-identity.ts— Ed25519 identitysrc/mesh/peer-trust.ts— trusted peer storesrc/infra/credential-store.ts— credential persistence
By default ClawMesh stores local state under:
~/.clawmesh
Override with:
export CLAWMESH_STATE_DIR=/path/to/custom/stateImportant files:
| Path | Purpose |
|---|---|
~/.clawmesh/identity/device.json |
local Ed25519 identity |
~/.clawmesh/credentials.json |
provider/channel credentials |
~/.clawmesh/mesh/trusted-peers.json |
trusted peer store |
~/.clawmesh/mesh/gateways.json |
saved gateway targets |
~/.clawmesh/mesh/patterns.json |
learned operator patterns |
~/.clawmesh/world-model-snapshot.json |
world-model snapshot for restart recovery |
ClawMesh is a serious working codebase under active hardening, but it is not yet a finished packaged product.
Important current realities:
- the runtime and safety model are real and actively tested
- WAN/static deployment support includes transport labeling, posture reporting, and enforcement for WAN-style links
- the browser UI is tied to real runtime surfaces rather than mock cards
- the package is not yet published to npm
- the current checkout still expects local
file:dependencies from a sibling../pi-mono
So today this repo is best treated as:
- production-minded engineering work
- actively usable for development and field experiments
- still evolving in packaging and final deployment ergonomics
clawmesh credential set provider/google <api-key>
clawmesh credential set provider/anthropic <api-key>
clawmesh credential set channel/telegram <bot-token>
clawmesh credential list
clawmesh credential get provider/googleStored provider credentials are injected into process.env on startup so the planner can use them without manually exporting each variable.
pnpm install
pnpm typecheck
pnpm testpnpm exec vitest run src/mesh/
pnpm exec vitest run src/agents/
pnpm exec vitest run src/channels/
pnpm exec vitest run src/cli/- prefer small, test-backed slices
- mesh reliability changes are developed Red/Green
- existing trust/safety constraints should not be weakened casually
- WAN/static behavior should stay explicit and operator-visible
- browser UI should prefer backend truth over mock/demo-only state
- Getting Started Guide
- Command Center Setup
- Field Node Setup
- Bhoomi Farm Twin Spec
- Mesh Safety Skill / Policy Context
MIT




