explaingit

sanjoydat1/p2pa

Analysis updated 2026-07-26

2TypeScriptAudience · developerComplexity · 3/5Setup · moderate

TLDR

A toolkit that lets multiple AI coding assistants share context and divide work directly with each other, without a central cloud server. It uses peer-to-peer networking to sync only changes between machines.

Mindmap

mindmap
  root((repo))
    What it does
      Shares context between AI agents
      Syncs only changes
      No central server needed
    Tech stack
      TypeScript
      Hyperswarm
      Conflict-free data types
      Markdown audit logs
    Use cases
      Multiple AI agents on one project
      Shared war rooms
      Dividing tasks across machines
    Audience
      Founders and engineering teams
      Users of multiple AI coding tools
    Setup
      Global npm install
      Pairing command for keys
      Foreground or background mode

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Let two AI coding assistants split tasks and merge edits without manually copying prompts between them.

USE CASE 2

Keep a shared audit log of all agent changes in plain Markdown so a human can review the full session.

USE CASE 3

Run a shared war room where multiple machines sync AI agent context over a peer-to-peer network.

USE CASE 4

Queue messages to offline peers so work resumes seamlessly when a machine comes back online.

What is it built with?

TypeScriptHyperswarmMCPnpm

How does it compare?

sanjoydat1/p2pa4ssh1/mine-sweeperachawla19/intuitcode-extension
Stars222
LanguageTypeScriptTypeScriptTypeScript
Last pushed2026-01-31
MaintenanceMaintained
Setup difficultymoderatemoderatemoderate
Complexity3/52/54/5
Audiencedevelopervibe coderdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires installing the package globally and running a pairing command on each machine to exchange cryptographic keys before agents can connect.

In plain English

P2PA is a local-first toolkit that lets multiple AI coding assistants share context with each other directly, without routing through a central cloud service. It is designed for founders and engineering teams who run several AI agents and want those agents to pass information, divide up work, and merge edits without someone manually copying prompts between them. The core problem it addresses is that local AI agents tend to work in isolation. When one finishes a task, its working memory disappears, so another agent on a different machine starts from scratch. Passing full context windows through a central server burns tokens and adds delay. P2PA keeps a shared state file on each machine and synchronizes only the changes. It uses a peer-to-peer network layer called Hyperswarm, so there is no central server to stand up. Peers authenticate each other using cryptographic keys, and only keys you have explicitly allowed can connect. Knowing the network topic is not enough. The merge logic is built around conflict-free data types. Two agents writing to different keys never conflict. Two agents writing to the same key resolve to the same result on every machine, with no central arbiter. There are work-claiming leases so two agents never duplicate the same task, and those leases expire automatically if an agent crashes. Messages written to an offline peer are queued and delivered when that peer returns. Every change is written to a plain Markdown audit log on disk, attributed to the peer that made it, so a human can read the full session without any tools. You can test it on a single machine with a few npm scripts that exercise the merge engine, the work-claiming system, and the offline message queue. The test suite runs fully offline. To use it between two machines, you install the package globally, run a pairing command on each side to exchange keys, and then connect an IDE agent like Cursor or Claude Code through a generated config block. You choose one of two process modes: a foreground MCP mode for when an IDE agent is driving, or a background daemon mode for standalone sync. Both modes write the same files, and a writer lock prevents them from running at the same time. The README includes a full CLI reference, a walkthrough of a sample two-agent session, and a Google Docs integration for shared war rooms. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Install P2PA globally and run the pairing command on two machines, then generate a config block to connect Cursor as a foreground MCP agent.
Prompt 2
Run the offline test suite that exercises the merge engine, work-claiming leases, and offline message queue on a single machine.
Prompt 3
Start P2PA in background daemon mode on two machines and verify that a shared state file syncs only the changes between them.
Prompt 4
Set up a two-agent session where one agent claims a task with a lease and the second agent automatically picks up a different task without duplication.
Prompt 5
Configure P2PA so that messages written to an offline peer are queued and delivered when that peer returns, then verify delivery in the Markdown audit log.

Frequently asked questions

What is p2pa?

A toolkit that lets multiple AI coding assistants share context and divide work directly with each other, without a central cloud server. It uses peer-to-peer networking to sync only changes between machines.

What language is p2pa written in?

Mainly TypeScript. The stack also includes TypeScript, Hyperswarm, MCP.

How hard is p2pa to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is p2pa for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.