Skip to content

Guide · Open source

How to use claw-code: build from source and run the claw CLI

Updated · written with AI from the project's own documentation and checked against our catalogue data

Claw Code is a Rust implementation of a command-line agent harness called claw, which sends prompts to AI models and runs interactive sessions from the terminal. This guide is for developers who want to build the claw binary from source, try it with an Anthropic API key, and see how the Rust workspace is organised. By the end you will know the build steps, how to run a prompt and start a session, and what the project itself says about its status.

Claw Codeultraworkers/claw-code · ★ 195k · MIT

Quick start

  1. 1Confirm prerequisites. Install the Rust toolchain via rustup.rs, make sure Git is available, and have an Anthropic API key ready.
  2. 2Clone the repository. Run git clone https://github.com/ultraworkers/claw-code to get the source.
  3. 3Enter the Rust workspace. Change into claw-code/rust, where the canonical implementation lives.
  4. 4Build the workspace. Run cargo build --workspace to produce the claw binary.
  5. 5Set your API key. Export ANTHROPIC_API_KEY with your Anthropic API key. The README says a Claude subscription does not work here.
  6. 6Run a health check and a prompt. Run ./target/debug/claw doctor, then ./target/debug/claw prompt "say hello".

Check what this repository is for before you install

The README is direct about the status of this repo: it says Claw Code is not the serious production project and is closer to a museum exhibit than a product. It describes the repository as agent-managed, meaning the harnesses plan, execute, verify and maintain it rather than a person operating it by hand.

If you need a tool to get real work done, the README points you to LazyCodex or Gajae-Code instead. Claw Code is best approached as something to build, read and study.

  • Good fit: learning how a Rust agent CLI is structured, building claw from source, reading the rust/ workspace.
  • Poor fit: dependable production work, or anyone unwilling to install Rust and build from source.

Prerequisites: Rust, Git and an Anthropic API key

You need three things: the Rust toolchain (installed via rustup.rs), Git, and an Anthropic API key. The README specifies that the key must be an Anthropic API key and states it is not a Claude subscription.

On Windows, the README recommends installing Rust from https://rustup.rs/, then closing and reopening your terminal. Run cargo --version to confirm Rust is on your PATH.

  • Rust toolchain, installed through rustup.rs
  • Git
  • An Anthropic API key (not a Claude subscription)
cargo --version

Clone and build the claw binary from source

This repository is build-from-source only, according to the README. Clone it, move into the Rust workspace in the rust/ directory, and build the whole workspace.

The README warns against running cargo install claw-code. That crates.io package is a deprecated stub that installs claw-code-deprecated.exe rather than claw, and only prints that the project was renamed to agent-code.

git clone https://github.com/ultraworkers/claw-code cd claw-code/rust cargo build --workspace

Set your API key and run your first prompt

Export your Anthropic API key as an environment variable, then run claw doctor as the first health check the README recommends after building. Then send a prompt with claw prompt.

The README's build output lives under ./target/debug/. On Windows PowerShell the binary is claw.exe, so use .\target\debug\claw.exe, or run cargo run -- prompt "say hello" to skip the path lookup.

  • Use claw doctor right after building to confirm the setup is wired correctly.
  • Run claw with no arguments to start an interactive session.
  • On Windows, set the key with $env:ANTHROPIC_API_KEY instead of export.
export ANTHROPIC_API_KEY="sk-ant-..." ./target/debug/claw doctor ./target/debug/claw prompt "say hello" ./target/debug/claw

Use the PowerShell route on Windows

PowerShell is a supported Windows path. The README lists the same clone and build steps, then shows the PowerShell variant for setting the key and running the binary with .exe and backslashes.

Git Bash and WSL are optional alternatives. The README notes that the MINGW64 prompt in Git Bash is normal and not a sign of a broken install.

git clone https://github.com/ultraworkers/claw-code cd claw-code/rust cargo build --workspace $env:ANTHROPIC_API_KEY = "sk-ant-..." .\target\debug\claw.exe prompt "say hello"

Explore the repository structure and further docs

The canonical implementation lives in rust/, which holds the Rust workspace and the claw CLI binary. USAGE.md covers build, auth, CLI, session and parity-harness workflows. rust/README.md has crate-level details.

The src/ and tests/ folders are a companion Python/reference workspace and audit helpers, and the README says they are not the primary runtime surface. ACP/Zed support is not shipped yet; running claw acp reports status.

  • rust/: canonical Rust workspace and claw CLI binary
  • USAGE.md: task-oriented usage guide
  • PARITY.md: Rust-port parity status
  • ROADMAP.md: roadmap and cleanup backlog
  • PHILOSOPHY.md: project intent and system-design framing
  • src/ and tests/: companion Python/reference workspace, not the main runtime

What people use it for

  • Reading the rust/ workspace to learn how a terminal agent harness is laid out.
  • Building claw from source and sending it a one-off prompt with claw prompt.
  • Starting an interactive claw session from the terminal to see how it behaves.
  • Studying an agent-managed repository and the project philosophy described in PHILOSOPHY.md.
  • Comparing its structure with other agent CLIs such as Aider, Claude Code or OpenAI Codex CLI.

Frequently asked questions

Is claw-code free to use?

The repository is licensed under MIT. You still need an Anthropic API key, and the README states that a Claude subscription is not the same thing and will not work for this setup.

How do I install claw-code?

The README describes build-from-source as the only route. Clone the repository, cd into claw-code/rust, and run cargo build --workspace after installing Rust through rustup.rs.

Why does cargo install claw-code not work?

The claw-code crate on crates.io is a deprecated stub. It installs claw-code-deprecated.exe, not claw, and only prints that the project was renamed to agent-code. Build from source instead.

What do I need before I can run claw?

You need the Rust toolchain from rustup.rs, Git, and an Anthropic API key. Once built, run claw doctor as a first health check.

Is claw-code good for production use?

No. The README says it is not the serious production project and is closer to a museum exhibit. For running real work, the README recommends LazyCodex or Gajae-Code.

How does claw-code compare to Aider, Claude Code or OpenAI Codex CLI?

The source does not compare these tools in detail. It only frames claw-code as a Rust agent CLI for study and building from source, so check each project's own documentation for a feature comparison.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Claw Code suits developers who want to build a Rust agent CLI from source, study its workspace, or explore an agent-managed repository. It is a poor choice if you need a dependable production tool, or if you do not want to install Rust and supply an Anthropic API key. For real work, the README points you to LazyCodex or Gajae-Code.

Install options & downloads