DEV Community

Eliran Geffen
Eliran Geffen

Posted on

How I Built claude-duet: Real-Time Pair Programming with AI

I use Claude Code daily — and I kept hitting the same wall: I couldn't share my AI coding session with a colleague.

Claude Code runs locally. One developer, one session. If you want to pair program, the other person has to watch your screen over Zoom. That's not pair programming — that's watching someone else code.

*So I built claude-duet.
*

What It Does
claude-duet is an open-source CLI that lets two developers share a Claude Code session in real-time:

Host runs Claude Code locally via the Agent SDK
Partner connects peer-to-peer from their terminal and sends prompts
Both see Claude's responses streamed live
All communication is end-to-end encrypted

Host

npx claude-duet host

Partner (on any machine)

npx claude-duet join cd-a1b2c3d4 --password mypassword --url ws://192.168.1.5:4567

The host machine is the only one that talks to Claude.

The partner connects peer-to-peer (WebRTC by default) and sends prompts through an encrypted channel.

This means:

Only one API key needed (the host's)
The host maintains full control
Approval mode lets the host review partner prompts before execution
Security: E2E Encryption
All messages are encrypted with NaCl secretbox (XSalsa20-Poly1305).

Try It
npx claude-duet host

What's Next
Multi-guest sessions (more than two developers)
Support for other AI coding tools (Codex CLI, Gemini CLI)
Session recording and playback
Claude Code skill integration
The project is MIT licensed and contributions are welcome.

GitHub: https://github.com/EliranG/claude-duet npm: https://www.npmjs.com/package/claude-duet

Top comments (0)