MeshCode
Code together. Even when offline.
MeshCode is an offline-first collaboration extension for Visual Studio Code. It is designed to let developers collaborate over a local network without depending on an internet connection, while allowing each participant to continue working locally if the network becomes unavailable.
Project status: MeshCode is under active development. The current prototype focuses on LAN-hosted rooms, workspace sharing, and collaborative synchronization. Offline recovery, presence, and other capabilities should be treated as works in progress until verified in the current build.
Why MeshCode?
Most collaborative development tools assume a reliable internet connection. MeshCode explores a different approach:
- Use a local network for live collaboration.
- Continue editing files locally if the network drops.
- Preserve local changes so they can be synchronized after reconnection.
- Keep the workflow inside VS Code.
Important distinction: If internet access is unavailable but Wi-Fi/LAN remains connected, live collaboration can continue when devices can reach one another locally. If the local network itself is disconnected, live communication stops; each computer must continue locally and synchronize after connectivity returns.
Current prototype
- VS Code extension with an integrated meshcode terminal.
- LAN WebSocket room hosting and joining.
- LAN address discovery support, with manual IP joining as a fallback.
- Workspace file sharing with exclusion rules.
- LAN-first transport that does not require WAN access once participants can reach the host.
- Participant names, stable room colors, native editor caret/selection presence, and Explorer collaborator decorations.
- Optional experimental Collaborative Editor webview for shared text files, with custom collaborator tabs and physical pointers inside that webview only.
Check the current source and release notes before relying on a feature in a production workflow.
Planned / in-progress capabilities
- Durable local storage for edits made while disconnected.
- Reliable reconnection and missing-update exchange.
- More robust multi-client and reconnect verification.
- Improved language-aware editing inside the experimental webview.
- Richer automated LAN integration tests.
Requirements
- Visual Studio Code.
- Node.js and npm for development.
- A local network connection for live LAN collaboration.
- Firewall permission for the MeshCode host to accept connections on its configured port.
Development setup
- Open or clone the MeshCode repository.
- Install dependencies:
npm install
- Compile:
npm run compile
- Open the project folder in VS Code.
- Press F5 to launch the Extension Development Host.
The exact scripts and supported VS Code version are defined in package.json.
Using the prototype
Open the MeshCode integrated terminal from the VS Code Command Palette, then use the commands supported by your current build.
Typical room workflow:
- On the host computer, run meshcode create.
- Share the host computer's reachable Wi-Fi/LAN IPv4 address and the room ID with participants.
- On the host, run meshcode share to share eligible workspace files.
- On another computer, run meshcode join :.
- Enter the room ID when prompted.
Example:
meshcode join 192.168.1.25:48765
Use the actual IP address and port printed by the host. Do not use 127.0.0.1 as the address for another computer; it refers to that computer itself.
Experimental Collaborative Editor
Join/create a room and run meshcode share, then invoke MeshCode: Open Experimental Collaborative Editor from the Command Palette and select a shared file. Its custom tabs show active collaborator color dots; hovering a tab shows their names. Physical pointer tracking works only inside this optional webview surface. Pointer coordinates are normalized against the document scroll extent and rendered relative to each participant's scroll position and viewport. Pointer events are temporary LAN presence and are not written to Yjs or local persistence. Text changes are applied to the existing VS Code TextDocument and then use the existing Yjs synchronization path.
This mode is experimental and limited to supported shared text files up to 2 MB. It uses a plain text area; native language tooling, rich/custom editors, binary files, and arbitrary pointer overlays inside standard VS Code editors are unsupported. Native editors remain available with their current remote caret, selection, name-label, participant, and Explorer file-presence UI. Native VS Code tabs remain untouched because the stable API does not expose arbitrary colored tab dots.
For a two-computer test, share a text workspace over LAN, open the same file in the experimental editor on each computer, type in both, move pointers, scroll and resize the editor, switch tabs, and close one editor. Verify text synchronization, pointer movement, collaborator dots, and pointer cleanup on file switch/leave. Repeat with WAN disabled while LAN remains connected.
Useful prototype commands:
meshcode help
meshcode create
meshcode share
meshcode status
meshcode join :
Command availability may vary by build.
Network behaviour
Situation Expected behaviour
Internet unavailable, Wi-Fi/LAN still connected Live collaboration can continue if peers can reach one another locally.
Local network connection lost Live communication stops. Participants can continue local work; later synchronization depends on the persistence and recovery features in the installed build.
Host computer or room process stops The hosted room becomes unreachable until it is restarted or another supported host is available.
For two-computer testing, confirm both devices are connected to the same network. On the host, check its current Wi-Fi IPv4 address and ensure the configured port is allowed through the firewall.
Workspace sharing and safety
Only share a workspace with people you trust. Review the files being shared before starting a room. MeshCode should exclude sensitive files and generated folders by default where configured, but you are responsible for checking the current exclusion rules.
Never share credentials, private keys, access tokens, .env files, or other secrets. Do not treat LAN access as authentication or encryption unless the current release explicitly provides those protections.
Architecture (high level)
- VS Code extension: commands and editor integration.
- LAN discovery: helps participants find a room on the local network.
- WebSocket relay: forwards collaboration messages through the host.
- Yjs: existing CRDT document synchronization.
- Local persistence and reconnect: existing update storage and reconnection paths; multi-computer verification remains important.
The current LAN relay is a host-based design, not decentralized direct peer-to-peer networking. Direct WebRTC transport may be explored separately.
Contributing
Contributions, bug reports, and practical LAN test results are welcome.
When reporting a problem, include:
- MeshCode version.
- VS Code version and operating system.
- Whether internet was unavailable or the local network was disconnected.
- Steps to reproduce the issue.
- Relevant logs, with sensitive information redacted.
Roadmap
- [x] Local update persistence.
- [ ] State-vector-based synchronization after reconnect.
- [x] LAN reconnect and participant identity/colors.
- [x] Remote text cursors, selections, and file decorations.
- [x] Experimental webview pointer presence and custom collaborator tabs.
- [ ] Native editor physical pointer presence (not supported by the stable VS Code API).
- [ ] Automated tests and repeatable multi-computer LAN tests.
- [ ] Security review of room access and shared-file handling.
License
MeshCode is distributed under the MIT License. See LICENSE.