cct — Rust core for claude-code-templates
A Rust port of the core of the claude-code-templates CLI: component
installation (agents, commands, mcps, settings, hooks, skills),
verified at byte-for-byte parity with the Node.js CLI.
Everything else (dashboards, sandbox, global agents, stats, health-check, interactive setup) is delegated to the existing Node CLI for now — see Delegation.
Install
Released as a standalone binary from GitHub Releases (tagged cli-rust-v*),
separate from the existing claude-code-templates npm package so nothing
about the current npx experience changes.
Available now (v0.1.0 preview):
| Channel | Command |
|---|---|
| Shell script | curl -fsSL https://raw.githubusercontent.com/davila7/claude-code-templates/main/cli-rust/dist/install.sh | sh |
| cargo-binstall | cargo binstall --git https://github.com/davila7/claude-code-templates claude-code-templates |
| From source | cargo install --path cli-rust |
The
--gitform reads the prebuilt-binary metadata straight from this repo, so no crates.io publish is required. (A plaincargo binstall claude-code-templates/cargo install claude-code-templateswould need the crate published to crates.io — optional, later.)
Planned (not wired up yet):
| Channel | Command |
|---|---|
| Homebrew tap | brew install davila7/tap/cct |
| npm (new name) | npx @davila7/cct |
The npm path (when enabled) ships a tiny JS shim (npm/cct/bin/cct.js) that
execs the prebuilt binary for the current platform, pulled in as an
optionalDependency (@davila7/cct-<os>-<arch>). The existing
claude-code-templates npm package stays on Node until the binary is proven.
Usage
cct --agent deep-research-team/research-synthesizer # install an agent
cct --mcp devtools/elasticsearch # merge into .mcp.json
cct --setting api/custom-headers --hook monitoring/desktop-notification-on-stop
cct --skill creative-design/algorithmic-art # recursive skill tree
cct --agent a,b --command c -d ./project -y # batch into a directory
Opt out of anonymous telemetry with CCT_NO_TRACKING=1 (also disabled when
CI=true).
Architecture
src/
main.rs dispatch: native install path vs Node delegation
cli.rs clap flag surface (mirrors the commander options)
constants.rs GitHub raw/API bases, tracking URLs, version
github.rs raw fetch + recursive contents-API tree (skills)
tracking.rs fire-and-forget analytics (3 endpoints, detached threads)
merge.rs .mcp.json / settings / hooks merge semantics (+ unit tests)
python_compat.rs Windows python3->python shim
commands/
install.rs installIndividual* + installMultipleComponents
delegate.rs forward argv to the Node CLI
util/{fs_ext,paths}.rs
Parity-critical details preserved: 2-space JSON with trailing newline,
shift_remove (not swap-remove) so key order matches JS delete,
permissions.{allow,deny,ask} Set-union, hook array concatenation, category
dropping in target filenames, .py/.sh sidecar downloads, skills via the
GitHub contents API.
Delegation
Non-install flags forward verbatim to the Node CLI:
CCT_NODE_BIN— path tocli-tool/bin/create-claude-config.js(run withnode) or an executable. Used for local testing.- Fallback:
npx -y claude-code-templates@latest <args>.
CCT_NODE_BIN=../cli-tool/bin/create-claude-config.js cct --list-agents
Develop
cargo build # debug build
cargo test # unit tests (merge semantics)
cargo build --release # optimized binary at target/release/cct
Parity check vs Node
RDIR=$(mktemp -d); NDIR=$(mktemp -d)
ARGS="--agent deep-research-team/research-synthesizer --mcp devtools/elasticsearch -y"
CCT_NO_TRACKING=1 target/release/cct $ARGS -d "$RDIR"
CCT_NO_TRACKING=1 node ../cli-tool/bin/create-claude-config.js $ARGS -d "$NDIR"
diff -r "$RDIR" "$NDIR" && echo "IDENTICAL"
Release
v0.1.0 preview (GitHub Releases + curl + cargo-binstall)
- Merge this branch to
main(so the workflow andinstall.shexist there). - Tag and push:
git tag cli-rust-v0.1.0 && git push origin cli-rust-v0.1.0..github/workflows/build-rust-cli.ymlbuilds all 5 targets and uploadscct-<target>.tgzto the GitHub Release (contents: writeis granted). - Verify the channels:
The tag must keep the
curl -fsSL https://raw.githubusercontent.com/davila7/claude-code-templates/main/cli-rust/dist/install.sh | sh cargo binstall --git https://github.com/davila7/claude-code-templates claude-code-templatescli-rust-vprefix — both the binstall metadata (Cargo.toml) andinstall.sh's tag filter depend on it.
Later channels (when enabled)
- Homebrew tap: create
davila7/homebrew-tap, drop indist/homebrew/cct.rb, fill thesha256per asset (shasum -a 256 cct-<target>.tgz). - npm (new name):
node npm/build-packages.mjs <version> <dist-dir>(accepts the release.tgzs), then publish eachnpm/platforms/*andnpm/cctunder a new name (e.g.@davila7/cct) — leavesclaude-code-templatesuntouched.