Investigate `vercel-labs/scriptc` for native CLI binary distribution
Author: euxaristiaCreated Sep 9, 2026Updated Sep 9, 2026
Summary
scriptc is an experimental Vercel Labs project (July 2026) that compiles TypeScript directly to native executables via tsc → typed IR → C/LLVM → clang. Key claims: sub-200 KB binaries, ~2 ms cold start, no V8 runtime embedded.
Motivation
OpenClaude currently ships as a Bun-bundled JS file (dist/cli.mjs) executed by Node. Users need a Node installation, and cold startup includes engine initialization overhead. A native binary could:
- Eliminate the Node/Bun runtime prerequisite for end users
- Reduce startup latency — relevant for
openclaude --version, quick single-shot queries, and shell integrations - Simplify distribution — single static binary per platform (macOS / Linux / Windows / WASI)
Key considerations
- Maturity — scriptc is experimental. The
--dynamicfallback embeds QuickJS-ng forany-typed code and npm deps that can't be statically compiled. OpenClaude's dependency tree (React reconciler, Ink, gRPC, provider SDKs) likely lands heavily on the dynamic path today. - Scope — a realistic first target would be a stripped-down "headless" entrypoint (no TUI) or a startup shim that hands off to the full bundle, rather than compiling the entire app.
- Testing — the existing
smokescript (node dist/cli.mjs --version) is a natural first validation gate for a scriptc-compiled binary.
Proposed next steps
- Try compiling a minimal subset (e.g., CLI arg parsing + version print) with
scriptcto gauge binary size and startup time vs.node dist/cli.mjs. - Identify which dependencies force the QuickJS dynamic path.
- If results are promising, explore a
build:nativescript alongside the existing Bun bundle.
Source: Gitlawb/openclaude