logo
0
2
WeChat Login

Claw Code

ultraworkers/claw-code · Usage · Rust workspace · Parity · Roadmap · UltraWorkers Discord · 中文

Star history for ultraworkers/claw-code

Claw Code

Claw Code is the public Rust implementation of the claw CLI agent harness. The canonical implementation lives in rust/, and the current source of truth for this repository is ultraworkers/claw-code.

IMPORTANT

Start with USAGE.md for build, auth, CLI, session, and parity-harness workflows. Make claw doctor your first health check after building, use rust/README.md for crate-level details, read PARITY.md for the current Rust-port checkpoint, and see docs/container.md for the container-first workflow.

Current repository shape

  • rust/ — canonical Rust workspace and the claw CLI binary
  • npm/ — npm package for cross-platform binary installation via npm install claw
  • USAGE.md — task-oriented usage guide for the current product surface
  • PARITY.md — Rust-port parity status and migration notes
  • ROADMAP.md — active roadmap and cleanup backlog
  • PHILOSOPHY.md — project intent and system-design framing
  • scripts/ — cross-build and release automation scripts
  • skills/ — Claude Code skills for build/release workflows
  • src/ + tests/ — companion Python/reference workspace and audit helpers; not the primary runtime surface

Quick start

NOTE

[!WARNING] cargo install claw-code installs the wrong thing. The claw-code crate on crates.io is a deprecated stub that places claw-code-deprecated.exe — not claw. Running it only prints "claw-code has been renamed to agent-code". Do not use cargo install claw-code. Either build from source (this repo) or install the upstream binary:

cargo install agent-code # upstream binary — installs 'agent.exe' (Windows) / 'agent' (Unix), NOT 'agent-code'

This repo (ultraworkers/claw-code) is build-from-source only — follow the steps below.

# 1. Clone and build git clone https://github.com/ultraworkers/claw-code cd claw-code/rust cargo build --workspace # 2. Set your API key (Anthropic API key — not a Claude subscription) export ANTHROPIC_API_KEY="sk-ant-..." # 3. Verify everything is wired correctly ./target/debug/claw doctor # 4. Run a prompt ./target/debug/claw prompt "say hello"

NOTE

Windows (PowerShell): the binary is claw.exe, not claw. Use .\target\debug\claw.exe or run cargo run -- prompt "say hello" to skip the path lookup.

Windows setup

PowerShell is a supported Windows path. Use whichever shell works for you. The common onboarding issues on Windows are:

  1. Install Rust first — download from https://rustup.rs/ and run the installer. Close and reopen your terminal when it finishes.
  2. Verify Rust is on PATH:
    cargo --version
    If this fails, reopen your terminal or run the PATH setup from the Rust installer output, then retry.
  3. Clone and build (works in PowerShell, Git Bash, or WSL):
    git clone https://github.com/ultraworkers/claw-code cd claw-code/rust cargo build --workspace
  4. Run (PowerShell — note .exe and backslash):
    $env:ANTHROPIC_API_KEY = "sk-ant-..." .\target\debug\claw.exe prompt "say hello"

Git Bash / WSL are optional alternatives, not requirements. If you prefer bash-style paths (/c/Users/you/... instead of C:\Users\you\...), Git Bash (ships with Git for Windows) works well. In Git Bash, the MINGW64 prompt is expected and normal — not a broken install.

NOTE

Auth: claw requires an API key (ANTHROPIC_API_KEY, OPENAI_API_KEY, etc.) — Claude subscription login is not a supported auth path.

Run the workspace test suite:

cd rust cargo test --workspace

npm 安装

通过 npm 一键安装预编译二进制(支持 Linux x86_64 / ARM64、Windows x86_64):

# 使用 --registry 指定 CNB 源(公开,无需 token) npm install -g claw --registry=https://npm.cnb.cool/ccdecode/claw/-/packages/ # 验证 claw doctor

也可以在项目内本地安装或使用 npx 一次性运行,详见 USAGE.md

npm 包源码位于 npm/ 目录,包含 postinstall 脚本用于自动下载和校验平台对应的二进制文件。

Downloads

Pre-built binaries are available from CNB Releases.

PlatformFileArch
Linuxclaw-linux-amd64x86_64
Linux (ARM)claw-linux-arm64aarch64
Windowsclaw-windows-amd64.exex86_64
# Download and verify (Linux x86_64 example) curl -LO https://cnb.cool/ccdecode/claw-code/-/releases/download/v2026.4.10/claw-linux-amd64 curl -LO https://cnb.cool/ccdecode/claw-code/-/releases/download/v2026.4.10/checksums-sha256.txt sha256sum -c checksums-sha256.txt --ignore-missing chmod +x claw-linux-amd64 ./claw-linux-amd64 doctor

Cross-build & Release

Use scripts/cross-build-release.sh to build all platforms and publish a release to CNB:

CNB_TOKEN="your-token" ./scripts/cross-build-release.sh v2026.4.10

The script handles: toolchain setup, parallel cross-compilation, git tagging, release creation, and asset upload via CNB OpenAPI.

Documentation map

What's new in v2026.4.10

  • REPL resilience: The interactive REPL no longer exits on API errors (429 rate limit, 419, 5xx server errors, etc.). Errors are caught and displayed in-session — type a new message or /exit to leave.
  • Auto-retry: Retryable API failures (rate limits, transient server errors) are automatically retried up to 3 times at the REPL level with 5-second backoff, on top of the per-request exponential-backoff retries built into the API provider layer.
  • HTTP 419 support: Status code 419 is now classified as retryable, ensuring automatic retry for gateways and proxies that return it during temporary overload.

Ecosystem

Claw Code is built in the open alongside the broader UltraWorkers toolchain:

Ownership / affiliation disclaimer

  • This repository does not claim ownership of the original Claude Code source material.
  • This repository is not affiliated with, endorsed by, or maintained by Anthropic.

About

https://github.com/ultraworkers/claw-code

Language
Rust95.7%
Python3.4%
Shell0.7%
JavaScript0.2%