Code With Me Architecture Note: Host-Authoritative Real-Time Collaboration
Architecture note on JetBrains Code With Me: host-authoritative real-time collaboration, minimal design, trust and data boundaries, operational checks, failure modes and when the design must change.
23 Sept 2026, 16:47 UTC

Problem: shared IDE without replicating the build
Teams want real-time pair programming inside IntelliJ-based IDEs with local project access, low latency edits, and no full remote IDE replication. The useful takeaway is that JetBrains Code With Me solves this with a host-authoritative model: the host machine remains the source of truth for code, build state and credentials, while guests receive transient editor operations and UI state over a secure relay.
Requirements for real-time shared sessions
Real-time collaborative editing requires low-latency operation propagation, local file and tool access on the host, and permission control per participant. Build execution, local SDKs, environment variables and secrets must stay on the host machine. The session must degrade gracefully on network loss and expose clear host/guest roles.
These requirements push against a replicated IDE model. Replicating the full project and toolchain to each guest increases data exposure and operational cost. A host-authoritative design keeps the project files, build execution and credentials only on the host.
Smallest suitable design
The minimal design keeps project files, build execution and credentials only on the host. A lightweight session relays editor operations and UI state to guests via a secure channel, avoiding full remote IDE replication.
Host role: runs the IDE, owns the local filesystem, executes builds and tests, maintains the canonical document model. Guests connect to the session and receive a live editor view with operation-based updates. The relay brokers the connection; it does not store code persistently.
Participant permissions are set by the host. Typical levels are View Only and Can Edit. The host can also restrict chat and file navigation. Permission changes are applied in the session settings for Code With Me, under Tools > Code With Me in the IDE settings.
This design limits the guest surface to transient operations and UI updates. Guests do not receive persistent storage or direct filesystem access. The host remains the single writer for the local project.
Trust and data boundaries
Code, credentials and local filesystem sit inside the host trust zone. Guests receive transient edit operations and UI updates but not persistent storage, limiting exposure from network eavesdropping or relay compromise.
The trust boundary assumes the host machine is trusted. A compromised host exposes all project data to participants regardless of relay security. The relay is treated as semi-trusted: it brokers encrypted connections but should not be able to read plaintext code in the intended architecture.
Data classification: project source, build outputs, environment variables and IDE credentials remain host-local. Session metadata such as participant identity and permission level passes through the relay. No guest cache should be relied on for confidentiality.
Operational checks
Operational checks are conceptual and vary by IDE release. Verify in the specific product.
- Session health heartbeat: monitor connection liveness between host and guests and relay reachability. Lag or missed heartbeats indicate network degradation.
- Participant permission levels: confirm each guest is assigned the intended role before granting edit access. Review the participant list in the Code With Me session window.
- Host resource usage monitoring: CPU, memory and disk I/O on the host affect typing latency for all participants. High host load degrades the shared experience.
- Relay connectivity fallback: check whether the IDE can fall back to direct peer connection when the relay is unreachable. Relay selection is configurable in Code With Me settings.
Practical verification: open IDE settings for Code With Me to inspect host session options, participant permissions and relay selection. Start a local session with two accounts to observe that file changes are applied only on the host and guests cannot access the host filesystem directly. Review IDE release notes and platform documentation for Code With Me architecture notes to confirm trust boundaries and relay behavior.
Failure modes
Host crash terminates the session. All guests lose the live view and any in-flight edits are lost unless the host IDE recovers its local state. There is no multi-host merge.
Network partition causes edit divergence risk. Operation ordering relies on the host as sequencer. A guest with local unacknowledged edits may see conflicts on reconnect.
Relay outage forces fallback behavior. If direct peer connection is not available, the session may become unavailable. Session continuity depends on relay availability and host network.
Permission escalation if host misconfigures guest roles. Granting Can Edit broadly increases accidental change risk. Hosts should review participants regularly and revoke access when pairing ends.
Conditions that would change the design
The host-authoritative model fits small team pairing and low-latency local development. Design would change if requirements shift.
- Multi-host merge: need for concurrent writes from multiple authoritative hosts requires CRDTs or operational transformation with merge semantics, not just host sequencing.
- Regulatory need for on-prem relay: requirements for data residency or audit may require a self-hosted relay and persistent session recording.
- Scale beyond small team size: larger groups need persistent session recording, audit logs, and fine-grained access control beyond per-session permissions.
Limitations: Code With Me implementation and relay options vary across IntelliJ Platform releases and JetBrains IDE families. Assumptions reflect general host-authoritative architecture. Actual telemetry names and alerting differ per IDE version and should be verified in the specific product.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.