Guide · Pair programming

Real-time collaboration in LingCode

Share a file with a teammate, see each other's cursors, edit at the same time. CRDT under the hood — no merge conflicts, no "save and refresh", no third-party SaaS.

Both participants need to be signed in. Collab uses your LingCode account for identity and permission. Create a free account first if you haven't, then come back here.

Host a session

Open the file you want to share

Any file in any open project. Collab works on a single document at a time — to share a different file, end the session and start a new one.

Click Share in the Collab toolbar

The Collab toolbar lives at the top of the editor pane (next to the avatar/people icons). When no session is active, the only button is Share.

LingCode does three things automatically:

  • Creates a saved-prototype row for this file (one-time, if needed)
  • Generates a single-use invite token
  • Copies a lingcode://collab/join?proto=<UUID>&token=<TOKEN> link to your clipboard

Send the link to your teammate

Slack, iMessage, email — anywhere a URL pastes. The link is a lingcode:// deep link, so clicking it on a Mac with LingCode installed opens the app and joins the session directly.

Join a session

Click the link your teammate sent

macOS hands the URL to LingCode. If LingCode isn't running, it launches first. The app opens a virtual document for the shared file and connects to the live session.

Default role on join is viewer — you see the host's cursor and edits but can't type. The host can promote you to editor.

Wait for promotion (or just watch)

The Collab toolbar in the host's window shows your avatar with a "Promote to editor" action. They click it; your role flips immediately and your edits start streaming back to the host.

Edit together

Type anywhere. Your cursor shows up in the host's editor with your account's color and initials. Their cursor shows up in yours. Every keystroke is a CRDT operation — concurrent edits merge cleanly without overwriting each other.

What's actually happening

LingCode runs a local Node bridge (collab-bridge) per session that owns a Yjs document. The bridge talks to a websocket on lingcode.dev that broadcasts deltas to all connected peers. Edits are applied locally first, then propagated — that's why typing feels instant even when the network blips.

Roles & permissions

Only the owner can promote a viewer to editor. Promotion is reversible.

Pair-program with the AI in the loop

Both participants have their own LingCode chat panel pointed at the same project. Useful patterns:

Each participant's AI session is local to their LingCode — chat history doesn't sync across the collab session. That's intentional: you can each use different models or run different agent loops in parallel.

End a session

Click End session in the Collab toolbar. The bridge disconnects, your guests are dropped, and the invite token is invalidated. The document and its history stay saved on the server — you can host a fresh session for the same file later, with a new link.

Multi-file + follow-mode

Sessions now hold any number of open files. As the host focuses files in the editor, each one joins the share automatically — guests see edits arrive per file with independent CRDT history. Click a participant's avatar in the Collab toolbar to follow them: your viewport scrolls to wherever their cursor goes. A small banner above the participants list shows who you're following with a Stop button.

Limits to know

Troubleshooting

What to read next

Not signed up yet?

Create a free LingCode account