Problem
Claude Code CLI and ModelWeaver proxy run on the same machine, but communicate via TCP (127.0.0.1:3456). Every request pays full TCP/IP stack overhead — handshake, Nagle, checksums — all unnecessary for local IPC.
Proposal
Replace TCP listen with Unix Domain Socket (/tmp/modelweaver.sock or similar).
Expected Benefits
- ~30-50% lower per-request latency (kernel memory copy vs TCP stack)
- No SYN/ACK, no checksums, no Nagle's algorithm
- Naturally supports SCM_RIGHTS for future zero-copy optimizations
Implementation Notes
@hono/node-server uses Node's http.createServer() — need to switch to http.createServer(app) + .listen(socketPath) or use Node net module directly
- Must preserve TCP fallback for remote GUI access (Tauri app connects from
localhost)
- Consider dual-listen: UDS for CLI, TCP for GUI/metrics
- Update
daemon.ts PID/port discovery to handle UDS paths
- Update
monitor.ts health checks for UDS
Configuration
server:
socket: /tmp/modelweaver.sock # new: UDS path (overrides port if set)
port: 3456 # kept for GUI/metrics access
Acceptance Criteria
Problem
Claude Code CLI and ModelWeaver proxy run on the same machine, but communicate via TCP (
127.0.0.1:3456). Every request pays full TCP/IP stack overhead — handshake, Nagle, checksums — all unnecessary for local IPC.Proposal
Replace TCP listen with Unix Domain Socket (
/tmp/modelweaver.sockor similar).Expected Benefits
Implementation Notes
@hono/node-serveruses Node'shttp.createServer()— need to switch tohttp.createServer(app)+.listen(socketPath)or use Nodenetmodule directlylocalhost)daemon.tsPID/port discovery to handle UDS pathsmonitor.tshealth checks for UDSConfiguration
Acceptance Criteria
server.socketis configuredANTHROPIC_BASE_URLor equivalent can point to UDS