$npx skillfedfor your agent
REPO

CometixCode's value isn't the Rust port — it's the reverse-engineering trail

on: Haleclipse/CometixCode

CometixCode is a Rust reimplementation of Claude Code's terminal interface, built by reading the published Claude Code CLI and porting it component by component rather than redesigning from scratch. The structural logic is deliberate: where Claude Code uses TypeScript on React plus Ink, CometixCode uses Rust on iocraft — a React-style retained-mode TUI framework that the author describes as Ink's structural counterpart. Components map to components, hooks to hooks, and wherever the port deviates from the original, the deviation is documented in the source at the point it occurs.

The dependency chain is worth understanding. CometixCode builds against CometixTUI, a fork of iocraft that adds the primitives the port specifically needs: row-level diffing, event propagation, SIGCONT self-healing, IME cursor support, bracketed paste, and grid layout. These aren't incidental features — they represent the gap between what upstream iocraft provides and what a faithful Ink-parity port requires. The author forked the framework rather than working around its limits.

The binary itself has no system library dependencies. Unicode segmentation and collation come from ICU4X compiled directly into the binary. File search delegates to ripgrep via a resolution chain — vendored binary first, then source-tree vendor path, then whatever rg is on PATH — mirroring how Claude Code bundles ripgrep inside its npm package. Cross-compilation to Windows is supported, though it requires a mingw-w64 toolchain because four C or assembly dependencies (onig_sys, ring, tree-sitter, tree-sitter-bash) link statically.

One testing detail stands out as genuinely useful for anyone building similar tools: cargo test is explicitly marked invalid as a test gate. The codebase has process-wide state — environment variables, OnceLock caches — that leaks between tests when they run as threads in a single process. The project uses cargo-nextest instead, which isolates each test in its own process. The README notes that the justfile header documents the measurements behind that decision, which suggests this wasn't a stylistic preference but something they measured.

The implementation is incomplete. The interactive loop, tool execution, permissions, MCP integration, and slash commands are partially or substantially implemented; other areas are still partial. This is a work in progress by the author's own description, not a finished drop-in replacement.

What makes this interesting for agent builders isn't the novelty of the port itself — it's the existence of a companion reverse-engineering repository (ClaudeCodeRev) that the author says every behavior here was derived from. The port is downstream of that analysis work. Anyone trying to understand how Claude Code's tool loop or permission model actually functions has a documented reading path here, even if the Rust implementation isn't yet complete.

A file-by-file Rust port of Claude Code's TUI, backed by its own iocraft fork and a companion reverse-engineering repo — incomplete but architecturally honest.

Install it

Sources & links