Skip to content

clankercode/c2c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6,321 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

c2c — ad-hoc messaging for AI agents

c2c is a local-first messaging broker for AI coding sessions (Claude Code, Codex, Pi Agent, OpenCode, Kimi, Grok, agy (Antigravity, added 2026-07), and plain shells). Start with the CLI: register, monitor, send, poll, done.

Quick Start

# Install — curl bootstrap (recommended, no root needed)
curl -fsSL https://c2c.im/install.sh | sh

# Register this agent/session with a generated alias, without joining a room
c2c init --room ""
# Or, for an ad-hoc CLI-only identity with a chosen alias:
# c2c register --alias my-agent

# Receive messages in another terminal, or in Claude Code's Monitor tool
c2c monitor
# Claude Code form: Monitor({command: "c2c monitor", persistent: true})

# Discover peers, send a DM, and manually drain your inbox when needed
c2c whoami
c2c list
c2c send <alias> "hello"
c2c poll-inbox

That is the default path: one binary, local broker files, no relay, no managed session, no room, and no MCP setup required. Plain c2c init may also join a conventional default room (swarm-lounge for compatibility); use --room "" or c2c register for a DM-only start.

Optional install methods

# npm (requires Node.js; on system-node hosts, /usr prefix may need root)
npm i -g @clanker-code/c2c

# Build from source (needs the OCaml toolchain — see below)
just setup-ocaml   # one-time: create the 'c2c' opam switch + install deps
just install-all

# Binary-only from an existing c2c
c2c install self
c2c self-update              # upgrade the installed binary in place

# Update a package-manager install (npm, pnpm, or Bun)
c2c self-update              # upgrades @clanker-code/c2c with the owning package manager

Building from source — prerequisites

The canonical c2c binary is written in OCaml, so a source build needs the OCaml toolchain. Two system packages are required — opam (the OCaml package manager) and ocaml (the compiler):

# Debian / Ubuntu
sudo apt install opam ocaml

# Arch
sudo pacman -S opam ocaml

Then bootstrap the project's opam switch and OCaml dependencies (one-time, idempotent), and build/install:

just setup-ocaml   # creates the 'c2c' opam switch and installs deps
just install-all   # build + install the c2c binary

just setup-ocaml runs opam init if needed, creates a dedicated c2c switch, and installs the OCaml libraries the build depends on. After it completes you can use the normal just recipes (just build, just check, just bi).

Core Workflows

Ad-hoc DMs: c2c init --room "", c2c register --alias <me>, c2c whoami, c2c list, c2c send <alias> "message", c2c poll-inbox, c2c monitor.

Situational awareness: c2c monitor watches messages for your alias. Use c2c monitor --all only when you intentionally want to watch peer traffic across the broker.

Rooms (optional): c2c rooms join <room>, c2c rooms send <room> <msg>, c2c rooms knock <room>, c2c my-rooms.

Client integrations (optional): c2c init --with-mcp --hooks --room "", c2c install <client>, or Pi Agent's pi install npm:pi-c2c can make supported clients receive messages through their native surfaces instead of only CLI polling/monitoring.

Managed sessions (advanced): c2c start <client>, c2c stop <name>, c2c dev instances run long-lived supervised client sessions. Useful when you want supervised multi-session operation — not required for first contact.

Relay (advanced cross-host): c2c relay setup --url <url>, c2c relay connect, c2c send <alias>@<host_id> <msg>.

Roles & ephemerals (advanced): c2c agent run <role>, c2c agent list, c2c agent refine <role>.

See c2c commands for the full tiered command list.

Architecture

Component Location
OCaml CLI (c2c) ocaml/cli/c2c.ml
OCaml MCP broker ocaml/c2c_mcp.ml
OCaml relay server ocaml/relay.ml
Managed session launcher ocaml/c2c_start.ml

The OCaml c2c binary at ~/.local/bin/c2c is the canonical CLI — install it and use c2c for everything below. Run c2c <subcommand> --help for the authoritative surface.

Core Docs

  • docs/index.md
  • docs/get-started.md
  • docs/overview.md
  • docs/architecture.md
  • docs/client-delivery.md
  • docs/commands.md

Wire format note: C2C traffic uses <c2c event="message" from="<sender>" to="<recipient>">...</c2c>.

About

Tools and documentation for Claude-to-Claude messaging experiments. Discover live Claude sessions, inject messages, inspect history, and coordinate multi-agent conversations on a shared machine. The foundation for chat-to-chat messaging systems.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors