Decouple semantic code intelligence from local developer machines.
Purpose-built for autonomous AI coding agent fleets, multi-worktree parallelism, and high-throughput polyglot development with native Model Context Protocol (MCP) and drop-in LSP.
Any number of gateways form a cluster: start each with --peers <one live peer> and
--advertise <its host:port>; membership spreads by gossip (every 5 s: load, engines, loaded
workspaces). Clients need one seed:
export PROD_CODE_REMOTE=192.168.2.168:9400 # any node; the rest is discovered
prod-code cluster # the gossip view of every node
A checkout is placed by the cluster on the node that already holds it, otherwise on the quietest node that serves its language (Swift lands on a macOS node); the placement is remembered per checkout and an idle workspace drifts off an overloaded node.
| Rust | Go | C/C++ | TypeScript | Python | Swift | |
|---|---|---|---|---|---|---|
| engine | rust-analyzer in-process | gopls | clangd | TypeScript 7 native LSP | basedpyright | sourcekit-lsp (macOS node) |
| hover / def / refs / symbols / callers / callees / impls | yes | yes | yes | yes | yes | yes |
| rename | yes (+ module files) | yes | yes | yes | yes | yes |
| assists / safe-delete | yes | - | - | - | - | - |
| check | cargo check | go build | cmake / meson / make | tsc (bunx / pnpm / yarn / npx) | basedpyright (uv / .venv aware) | swift build / xcodebuild |
| lint | clippy | go vet | - | eslint / biome | ruff | - |
| test | cargo test | go test | ctest / meson test | vitest / jest / bun test / mocha | pytest / unittest | swift test / xcodebuild test |
Tooling is detected from the checkout (lock files, package.json, pyproject, CMakeLists...).
Dependencies live on the node: run prod-code exec -- bun install, -- uv sync, -- npm ci
once per checkout and the language servers and test runners use them.
Put a prod-code.toml at the checkout root to tune how the gateway analyses it. It is synced
like any manifest and read when the workspace is loaded (restart or idle-evict the gateway
after changing it):
[rust]
features = "all" # or ["feat-a", "feat-b"]; default: the crate's default features
no_default_features = false
all_targets = true # tests, benches and examples are analysed (default)
sysroot = true # standard library from rust-src (default)Use features = "all" when the same module tree is compiled into several crates behind
feature flags: rust-analyzer attaches each file to one crate, and a module behind a disabled
feature is dead there.
Modern language servers (rust-analyzer, gopls, pyright, tsserver) were architected for a single human developer typing in an interactive desktop editor.
When deploying fleets of autonomous AI coding agents (Claude, Codex, Agy, Cursor Agent) across dozens of parallel Git worktrees, the architecture collapses:
| Bottleneck | Traditional Language Servers (rust-analyzer / gopls) |
prod-code Remote Code Intelligence |
|---|---|---|
| Memory Footprint | 20β60+ GB RAM duplicated per session. Developer Mac freezes or OOMs. | 0 MB on client. Entire Salsa DB / AST cache stays in server RAM (128+ GB). |
| CPU / Battery | 100% CPU lockups on AST re-indexing; fans spin at full speed on laptop. | 0% CPU on client. Heavy analysis runs on dedicated 32β64 core server CPUs. |
| Overlay Contention | Global database write locks on every text edit. Concurrent sessions queue up (p95: 71s). | Single-Owner Direct-Edits: edits write directly to in-memory inputs (p95: 12s). |
| Protocol Overhead | Heavy bidirectional JSON-RPC state synchronization gymnastics. | Dual Surface: Standard LSP for IDEs + Native MCP tools for AI agents. |
| Multi-Language Ops | Fractured supervisor processes per language (gopls, analyzed, pyright). |
Unified Polyglot Gateway: single 10G port routes Rust, Go, Python, and TS. |
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Developer Laptop / Agent Fleet Pod β
β β’ Thin Client (`prod-code`, < 15 MB binary) β
β β’ Local IDEs (Cursor / VS Code / Neovim) via stdio β
β β’ AI Agents (Claude / Codex / Agy) via MCP β
β Local Resource Usage: ~0% CPU, < 10 MB RAM β
βββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββ
β
β 10 GbE TCP / QUIC (~0.05β0.1 ms RTT, 1.2 GB/s)
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Remote Compute Node (128+ GB RAM, 32β64 Cores, NVMe) β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Universal Gateway (:9400) β β
β β β’ Dual-Surface: LSP Multiplexer + MCP Server β β
β β β’ Bi-directional Path Translation β β
β β β’ Multi-Tenant Session Registry β β
β βββββββββββββββββββββββββ¬βββββββββββββββββββββββββ β
β β β
β βββββββββββββββββββΌββββββββββββββββββ β
β βΌ βΌ βΌ β
β βββββββββββββ βββββββββββββ βββββββββββββ β
β βRust Engineβ β Go Engine β β Python/TS β β
β ββ’ RA Salsa β ββ’ gopls β ββ’ Managed β β
β β in RAM β β pool β β workers β β
β ββ’ Direct β ββ’ Shared β ββ’ Scaled β β
β β Edits β β GOCACHE β β workers β β
β βββββββββββββ βββββββββββββ βββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Over a 10 GbE local network, network latency drops to 0.05β0.1 ms with ~1.1β1.2 GB/s throughput β indistinguishable from local NVMe storage. prod-code uses a tuned TCP streaming protocol with TCP_NODELAY, binary frame headers, and connection reuse.
- For Editors: Drops directly into Cursor, VS Code, or Neovim as an ordinary language server speaking JSON-RPC LSP over
stdio. - For AI Coding Agents: Exposes clean, structured Model Context Protocol (MCP) endpoints (
code_definition,code_references,code_outline,code_diagnostics,code_type_at). No parsing multi-megabyte JSON-RPC streams in agent loops.
For ephemeral Git worktrees used by autonomous agents:
- Bypasses costly overlay crate cones and global database invalidation locks.
- Unsaved buffer edits write directly into in-memory base Salsa inputs.
- Benchmarked under 15 concurrent agent sessions: cuts query latency from 71s down to 12s.
Your client talks about /Users/alex09x/Documents/workspace/repo/src/main.rs.
The remote daemon maps it to /srv/prod-code/workspaces/repo/src/main.rs.
All response URIs, diagnostics, and symbol definitions are translated back into local client paths seamlessly.
Deploy across multiple machines on your 10G network:
- Consistent workspace hashing pins repositories to dedicated memory nodes.
- Procedural macro execution offloaded into an isolated worker pool.
prod-code/
βββ Cargo.toml # Workspace definition
βββ README.md # Project overview & architecture
βββ ROADMAP.md # 5-phase engineering plan
βββ LICENSE-MIT # MIT License
βββ LICENSE-APACHE # Apache 2.0 License
βββ crates/
β βββ prod-code-protocol/ # Binary wire framing, handshake & path translation
β βββ prod-code-client/ # Ultra-thin CLI bridge (stdio LSP -> 10G TCP)
β βββ prod-code-gateway/ # Daemon gateway, multi-tenant session dispatcher
β βββ prod-code-engine-rust/ # In-memory Rust engine (ra_ap_ide::AnalysisHost)
β βββ prod-code-engine-go/ # Managed gopls worker pool with shared caches
β βββ prod-code-mcp/ # Model Context Protocol (MCP) server for agents
βββ bench/ # Agent fleet mass load testing harness
git clone https://github.com/alex09x/prod-code.git
cd prod-code
cargo build --release# Bind to 10G interface
./target/release/prod-code-server --bind 0.0.0.0:9400 --storage /srv/prod-code/workspaces# Configure endpoint
export PROD_CODE_REMOTE=192.168.2.100:9400
# Check connectivity
./target/release/prod-code status
# Run as drop-in language server in your editor
./target/release/prod-code lsp
# Or run as an MCP server for AI coding agents
./target/release/prod-code mcpSee ROADMAP.md for the active engineering plan:
- Phase 1: Wire Protocol, 10G TCP Streaming & Path Translation.
- Phase 2: In-Memory Rust Engine Core (
ra_ap_ide::AnalysisHost+ Direct-Edits). - Phase 3: Polyglot Hub (Managed Go
goplspool + Python/TS adapters). - Phase 4: Dual-Surface Gateway (LSP Multiplexer + Native Agent MCP Server).
- Phase 5: Multi-Node Clustering, Sharding & 50-Worker Fleet Stress Verification.
Alex (@alex09x) β alex@prod.codes
Dual-licensed under either of:
- Apache License, Version 2.0 (
LICENSE-APACHE) - MIT license (
LICENSE-MIT)
at your option.