## What Was Broken (ROADMAP #130d, filed cycle #52) `claw config --help` was silently ignored — the command executed and displayed the config dump instead of showing help: $ claw config --help Config Working directory /private/tmp/dogfood-probe-47 Loaded files 0 Merged keys 0 (displays full config, not help) Expected: help for the config command. Actual: silent acceptance of `--help`, runs config display anyway. This is the opposite outlier from #130c (which rejected help with an error). Together they form the help-parity anomaly: - #130c `diff --help` → error (rejects help) - #130d `config --help` → silent ignore (runs command, ignores help) - Others (status, mcp, export) → proper help - Expected behavior: all commands should show help on `--help` ## Root Cause (Traced) At main.rs:1050, the `"config"` parser arm parsed arguments positionally: "config" => { let tail = &rest[1..]; let section = tail.first().cloned(); // ... ignores unrecognized args like --help silently Ok(CliAction::Config { section, ... }) } Unlike the `diff` arm (#130c), `config` had no explicit check for extra args. It positionally parsed the first arg as an optional `section` and silently accepted/ignored any trailing arg, including `--help`. ## What This Fix Does Same pattern as #130c (help-surface parity): 1. **LocalHelpTopic enum extended** with new `Config` variant 2. **parse_local_help_action() extended** to map `"config"` → `LocalHelpTopic::Config` 3. **config arm guard added**: check for help flag before parsing section 4. **Help topic renderer added**: human-readable help text for config Fix locus at main.rs:1050: "config" => { // #130d: accept --help / -h and route to help topic if rest.len() >= 2 && is_help_flag(&rest[1]) { return Ok(CliAction::HelpTopic(LocalHelpTopic::Config)); } let tail = &rest[1..]; // ... existing parsing continues } ## Dogfood Verification Before fix: $ claw config --help Config Working directory ... Loaded files 0 (no help, runs config) After fix: $ claw config --help Config Usage claw config [--cwd <path>] [--output-format <format>] Purpose merge and display the resolved configuration Options --cwd overrides the workspace directory Output loaded files and merged key-value pairs Formats text (default), json Related claw status · claw doctor · claw init Short form `claw config -h` also works. ## Non-Regression Verification - `claw config` (no args) → still displays config dump ✅ - `claw config permissions` (section arg) → still works ✅ - All 180 binary tests pass ✅ - All 466 library tests pass ✅ ## Regression Tests Added (4 assertions) - `config --help` → routes to `HelpTopic(LocalHelpTopic::Config)` - `config -h` (short form) → routes to help topic - bare `config` (no args) → still routes to `Config` action - `config permissions` (with section) → still works correctly ## Pattern Note #130c and #130d form a pair: two outlier failure modes in help handling for local introspection commands: - #130c `diff` rejected help (loud error) → fixed with guard + routing - #130d `config` silently ignored help (silent accept) → fixed with same pattern Both are now consistent with the rest of the CLI (status, mcp, export, etc.). ## Related - Closes #130d (config help discoverability gap) - Completes help-parity family (#130c, #130d) - Stacks on #130c (diff help fix) on same worktree branch - Part of help-consistency thread (#141 audit)
🦞 Claw Code — Rust Implementation
A high-performance Rust rewrite of the Claw Code CLI agent harness. Built for speed, safety, and native tool execution.
For a task-oriented guide with copy/paste examples, see ../USAGE.md.
Quick Start
# Inspect available commands
cd rust/
cargo run -p rusty-claude-cli -- --help
# Build the workspace
cargo build --workspace
# Run the interactive REPL
cargo run -p rusty-claude-cli -- --model claude-opus-4-6
# One-shot prompt
cargo run -p rusty-claude-cli -- prompt "explain this codebase"
# JSON output for automation
cargo run -p rusty-claude-cli -- --output-format json prompt "summarize src/main.rs"
Configuration
Set your API credentials:
export ANTHROPIC_API_KEY="sk-ant-..."
# Or use a proxy
export ANTHROPIC_BASE_URL="https://your-proxy.com"
Or provide an OAuth bearer token directly:
export ANTHROPIC_AUTH_TOKEN="anthropic-oauth-or-proxy-bearer-token"
Mock parity harness
The workspace now includes a deterministic Anthropic-compatible mock service and a clean-environment CLI harness for end-to-end parity checks.
cd rust/
# Run the scripted clean-environment harness
./scripts/run_mock_parity_harness.sh
# Or start the mock service manually for ad hoc CLI runs
cargo run -p mock-anthropic-service -- --bind 127.0.0.1:0
Harness coverage:
streaming_textread_file_roundtripgrep_chunk_assemblywrite_file_allowedwrite_file_deniedmulti_tool_turn_roundtripbash_stdout_roundtripbash_permission_prompt_approvedbash_permission_prompt_deniedplugin_tool_roundtrip
Primary artifacts:
crates/mock-anthropic-service/— reusable mock Anthropic-compatible servicecrates/rusty-claude-cli/tests/mock_parity_harness.rs— clean-env CLI harnessscripts/run_mock_parity_harness.sh— reproducible wrapperscripts/run_mock_parity_diff.py— scenario checklist + PARITY mapping runnermock_parity_scenarios.json— scenario-to-PARITY manifest
Features
| Feature | Status |
|---|---|
| Anthropic / OpenAI-compatible provider flows + streaming | ✅ |
Direct bearer-token auth via ANTHROPIC_AUTH_TOKEN |
✅ |
| Interactive REPL (rustyline) | ✅ |
| Tool system (bash, read, write, edit, grep, glob) | ✅ |
| Web tools (search, fetch) | ✅ |
| Sub-agent / agent surfaces | ✅ |
| Todo tracking | ✅ |
| Notebook editing | ✅ |
| CLAUDE.md / project memory | ✅ |
Config file hierarchy (.claw.json + merged config sections) |
✅ |
| Permission system | ✅ |
| MCP server lifecycle + inspection | ✅ |
| Session persistence + resume | ✅ |
| Cost / usage / stats surfaces | ✅ |
| Git integration | ✅ |
| Markdown terminal rendering (ANSI) | ✅ |
| Model aliases (opus/sonnet/haiku) | ✅ |
Direct CLI subcommands (status, sandbox, agents, mcp, skills, doctor) |
✅ |
Slash commands (including /skills, /agents, /mcp, /doctor, /plugin, /subagent) |
✅ |
Hooks (/hooks, config-backed lifecycle hooks) |
✅ |
| Plugin management surfaces | ✅ |
| Skills inventory / install surfaces | ✅ |
| Machine-readable JSON output across core CLI surfaces | ✅ |
Model Aliases
Short names resolve to the latest model versions:
| Alias | Resolves To |
|---|---|
opus |
claude-opus-4-6 |
sonnet |
claude-sonnet-4-6 |
haiku |
claude-haiku-4-5-20251213 |
CLI Flags and Commands
Representative current surface:
claw [OPTIONS] [COMMAND]
Flags:
--model MODEL
--output-format text|json
--permission-mode MODE
--dangerously-skip-permissions
--allowedTools TOOLS
--resume [SESSION.jsonl|session-id|latest]
--version, -V
Top-level commands:
prompt <text>
help
version
status
sandbox
acp [serve]
dump-manifests
bootstrap-plan
agents
mcp
skills
system-prompt
init
claw acp is a local discoverability surface for editor-first users: it reports the current ACP/Zed status without starting the runtime. As of April 16, 2026, claw-code does not ship an ACP/Zed daemon entrypoint yet, and claw acp serve is only a status alias until the real protocol surface lands.
The command surface is moving quickly. For the canonical live help text, run:
cargo run -p rusty-claude-cli -- --help
Slash Commands (REPL)
Tab completion expands slash commands, model aliases, permission modes, and recent session IDs.
The REPL now exposes a much broader surface than the original minimal shell:
- session / visibility:
/help,/status,/sandbox,/cost,/resume,/session,/version,/usage,/stats - workspace / git:
/compact,/clear,/config,/memory,/init,/diff,/commit,/pr,/issue,/export,/hooks,/files,/release-notes - discovery / debugging:
/mcp,/agents,/skills,/doctor,/tasks,/context,/desktop - automation / analysis:
/review,/advisor,/insights,/security-review,/subagent,/team,/telemetry,/providers,/cron, and more - plugin management:
/plugin(with aliases/plugins,/marketplace)
Notable claw-first surfaces now available directly in slash form:
/skills [list|install <path>|help]/agents [list|help]/mcp [list|show <server>|help]/doctor/plugin [list|install <path>|enable <name>|disable <name>|uninstall <id>|update <id>]/subagent [list|steer <target> <msg>|kill <id>]
See ../USAGE.md for usage examples and run cargo run -p rusty-claude-cli -- --help for the live canonical command list.
Workspace Layout
rust/
├── Cargo.toml # Workspace root
├── Cargo.lock
└── crates/
├── api/ # Provider clients + streaming + request preflight
├── commands/ # Shared slash-command registry + help rendering
├── compat-harness/ # TS manifest extraction harness
├── mock-anthropic-service/ # Deterministic local Anthropic-compatible mock
├── plugins/ # Plugin metadata, manager, install/enable/disable surfaces
├── runtime/ # Session, config, permissions, MCP, prompts, auth/runtime loop
├── rusty-claude-cli/ # Main CLI binary (`claw`)
├── telemetry/ # Session tracing and usage telemetry types
└── tools/ # Built-in tools, skill resolution, tool search, agent runtime surfaces
Crate Responsibilities
- api — provider clients, SSE streaming, request/response types, auth (
ANTHROPIC_API_KEY+ bearer-token support), request-size/context-window preflight - commands — slash command definitions, parsing, help text generation, JSON/text command rendering
- compat-harness — extracts tool/prompt manifests from upstream TS source
- mock-anthropic-service — deterministic
/v1/messagesmock for CLI parity tests and local harness runs - plugins — plugin metadata, install/enable/disable/update flows, plugin tool definitions, hook integration surfaces
- runtime —
ConversationRuntime, config loading, session persistence, permission policy, MCP client lifecycle, system prompt assembly, usage tracking - rusty-claude-cli — REPL, one-shot prompt, direct CLI subcommands, streaming display, tool call rendering, CLI argument parsing
- telemetry — session trace events and supporting telemetry payloads
- tools — tool specs + execution: Bash, ReadFile, WriteFile, EditFile, GlobSearch, GrepSearch, WebSearch, WebFetch, Agent, TodoWrite, NotebookEdit, Skill, ToolSearch, and runtime-facing tool discovery
Stats
- ~20K lines of Rust
- 9 crates in workspace
- Binary name:
claw - Default model:
claude-opus-4-6 - Default permissions:
danger-full-access
License
See repository root.