#2221·openclaude

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 --dynamic fallback embeds QuickJS-ng for any-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 smoke script (node dist/cli.mjs --version) is a natural first validation gate for a scriptc-compiled binary.

Proposed next steps

  1. Try compiling a minimal subset (e.g., CLI arg parsing + version print) with scriptc to gauge binary size and startup time vs. node dist/cli.mjs.
  2. Identify which dependencies force the QuickJS dynamic path.
  3. If results are promising, explore a build:native script alongside the existing Bun bundle.