Skip to content
crdt-vterm logo

CRDT-VTerm - Collaborative Terminal Sharing

crdt-vterm

Collaborative terminal session sharing using CRDT-style s-expressions

SKILL.md

Full skill instructions

CRDT-VTerm - Collaborative Terminal Sharing

Collaborative terminal session sharing using CRDT-style s-expressions with GF(3) trifurcated conflict resolution.

Components

Emacs Bridge

  • File: crdt-vterm-bridge.el
  • Purpose: Connect vterm.el to crdt.el via shadow buffers

Babashka Recorder

  • File: vterm_crdt_recorder.bb
  • Purpose: Record/​replay terminal sessions as CRDT sexps

P2P Sharing

  • File: vterm_localsend_share.bb
  • Purpose: Live terminal sharing via localsend multicast

Architecture

┌──────────────────────────────────────────────────────────────────┐
│                    CRDT-VTerm System                             │
├──────────────────────────────────────────────────────────────────┤
│                                                                  │
│  ┌─────────┐     remote-insert     ┌───────────────┐             │
│  │ vterm   │ ───────────────────▶  │ shadow buffer │             │
│  │  PTY    │      (GF3 trit)       │  (crdt.el)    │             │
│  └────┬────┘                       └───────┬───────┘             │
│       │                                    │                     │
│       │ script(1)                          │ sexp file           │
│       ▼                                    ▼                     │
│  ┌─────────┐                       ┌───────────────┐             │
│  │ raw log │                       │ .sexp log     │             │
│  └────┬────┘                       └───────┬───────┘             │
│       │                                    │                     │
│       │ vterm_crdt_recorder.bb             │ localsend UDP       │
│       ▼                                    ▼                     │
│  ┌─────────────────────────────────────────────────┐             │
│  │              P2P Peer Network                   │             │
│  │  ┌───────┐   ┌───────┐   ┌───────┐              │             │
│  │  │ MINUS │   │ERGODIC│   │ PLUS  │  ← GF(3)     │             │
│  │  └───────┘   └───────┘   └───────┘    routing   │             │
│  └─────────────────────────────────────────────────┘             │
└──────────────────────────────────────────────────────────────────┘

CRDT Sexp Format

;; Session header
(crdt-terminal-session
  (version "0.1.0")
  (session-id "T-abc123")
  (site-id 42)
  (gf3-assignment :ERGODIC))

;; Terminal output
(remote-insert "0a1b2c3d" 42 "$ ls -la\n"
  (props :type :terminal-output
         :trit :MINUS
         :timestamp 1234567890))

;; User input
(remote-input "0a1b2c3e" 42 "ls -la"
  (props :trit :PLUS
         :timestamp 1234567891))

;; Conflict resolution
(conflict-resolution
  :type :concurrent-input
  :strategy :gf3-ordering)

Usage

Record Session

bb vterm_crdt_recorder.bb record session.sexp

Replay Session

bb vterm_crdt_recorder.bb replay session.sexp 2.0

Live P2P Share

bb vterm_localsend_share.bb share output.sexp 192.168.1.5

Emacs Replay

M-x crdt-vterm-replay RET session.sexp RET 1.0 RET

GF(3) Trifurcated Input

Multi-user input is routed through three queues:

QueueTritProcessing Order
MINUS-1First
ERGODIC0Second
PLUS+1Third

This prevents conflicts in "no-longer-optimistic waiting" scenarios by deterministically ordering concurrent inputs.

;; Cycle through queues
(crdt-vterm-trifurcate-cycle)

Integration

With gay-mcp

Each terminal session gets a deterministic color based on session ID.

With localsend-mcp

P2P discovery and file transfer for session sharing.

With duckdb-ies

Terminal sessions can be indexed in DuckDB for time-travel queries.

Related Skills

  • gay-mcp - Deterministic colors
  • spi-parallel-verify - GF(3) conservation
  • triad-interleave - Three-stream scheduling
  • bisimulation-game - Session equivalence

Scientific Skill Interleaving

This skill connects to the K-Dense-AI/​claude-scientific-skills ecosystem:

Graph Theory

  • networkx [○] via bicomodule
    • Universal graph hub

Bibliography References

  • distributed-systems: 3 citations in bib.duckdb

SDF Interleaving

This skill connects to Software Design for Flexibility (Hanson & Sussman, 2021):

Primary Chapter: 8. Degeneracy

Concepts: redundancy, fallback, multiple strategies, robustness

GF(3) Balanced Triad

crdt-vterm (−) + SDF.Ch8 (−) + [balancer] (−) = 0

Skill Trit: -1 (MINUS - verification)

Secondary Chapters

  • Ch10: Adventure Game Example

Connection Pattern

Degeneracy provides fallbacks. This skill offers redundant strategies.

Cat# Integration

This skill maps to Cat# = Comod(P) as a bicomodule in the equipment structure:

Trit: 0 (ERGODIC)
Home: Prof
Poly Op: ⊗
Kan Role: Adj
Color: #26D826

GF(3) Naturality

The skill participates in triads satisfying:

(-1) + (0) + (+1) ≡ 0 (mod 3)

This ensures compositional coherence in the Cat# equipment structure.

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View