Skip to content

Commit 71f5f83

Browse files
committed
feat: ultraworkers#153 — add post-build binary location and verification guide to README
## Problem Users frequently ask after building: - "Where is the claw binary?" - "Did the build actually work?" - "Why can't I run \`claw\` from anywhere?" This happens because \`cargo build\` puts the binary in \`rust/target/debug/claw\` (or \`rust/target/release/claw\`), and new users don't know: 1. Where to find it 2. How to test it 3. How to add it to PATH (optional but common follow-up) ## Fix Added new section "Post-build: locate the binary and verify" to README covering: 1. **Binary location table:** debug vs. release, macOS/Linux vs. Windows paths 2. **Verification commands:** Test the binary with \`--help\` and \`doctor\` 3. **Three ways to add to PATH:** - Symlink (macOS/Linux): \`ln -s ... /usr/local/bin/claw\` - cargo install: \`cargo install --path . --force\` - Shell profile update: add rust/target/debug to \$PATH 4. **Troubleshooting:** Common errors ("command not found", "permission denied", debug vs. release build speed) ## Impact New users can now: - Find the binary immediately after build - Run it and verify with \`claw doctor\` - Know their options for system-wide access Also filed ROADMAP ultraworkers#153 documenting the gap. Closes ROADMAP ultraworkers#153.
1 parent 79352a2 commit 71f5f83

2 files changed

Lines changed: 107 additions & 1 deletion

File tree

README.md

Lines changed: 78 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,87 @@ export ANTHROPIC_API_KEY="sk-ant-..."
9898

9999
**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.
100100

101+
## Post-build: locate the binary and verify
102+
103+
After running `cargo build --workspace`, the `claw` binary is built but **not** automatically installed to your system. Here's where to find it and how to verify the build succeeded.
104+
105+
### Binary location
106+
107+
After `cargo build --workspace` in `claw-code/rust/`:
108+
109+
**Debug build (default, faster compile):**
110+
- **macOS/Linux:** `rust/target/debug/claw`
111+
- **Windows:** `rust/target/debug/claw.exe`
112+
113+
**Release build (optimized, slower compile):**
114+
- **macOS/Linux:** `rust/target/release/claw`
115+
- **Windows:** `rust/target/release/claw.exe`
116+
117+
If you ran `cargo build` without `--release`, the binary is in the `debug/` folder.
118+
119+
### Verify the build succeeded
120+
121+
Test the binary directly using its path:
122+
123+
```bash
124+
# macOS/Linux (debug build)
125+
./rust/target/debug/claw --help
126+
./rust/target/debug/claw doctor
127+
128+
# Windows PowerShell (debug build)
129+
.\rust\target\debug\claw.exe --help
130+
.\rust\target\debug\claw.exe doctor
131+
```
132+
133+
If these commands succeed, the build is working. `claw doctor` is your first health check — it validates your API key, model access, and tool configuration.
134+
135+
### Optional: Add to PATH
136+
137+
If you want to run `claw` from any directory without the full path, choose one of these approaches:
138+
139+
**Option 1: Symlink (macOS/Linux)**
140+
```bash
141+
ln -s $(pwd)/rust/target/debug/claw /usr/local/bin/claw
142+
```
143+
Then reload your shell and test:
144+
```bash
145+
claw --help
146+
```
147+
148+
**Option 2: Use `cargo install` (all platforms)**
149+
150+
Build and install to Cargo's default location (`~/.cargo/bin/`, which is usually on PATH):
151+
```bash
152+
# From the claw-code/rust/ directory
153+
cargo install --path . --force
154+
155+
# Then from anywhere
156+
claw --help
157+
```
158+
159+
**Option 3: Update shell profile (bash/zsh)**
160+
161+
Add this line to `~/.bashrc` or `~/.zshrc`:
162+
```bash
163+
export PATH="$(pwd)/rust/target/debug:$PATH"
164+
```
165+
166+
Reload your shell:
167+
```bash
168+
source ~/.bashrc # or source ~/.zshrc
169+
claw --help
170+
```
171+
172+
### Troubleshooting
173+
174+
- **"command not found: claw"** — The binary is in `rust/target/debug/claw`, but it's not on your PATH. Use the full path `./rust/target/debug/claw` or symlink/install as above.
175+
- **"permission denied"** — On macOS/Linux, you may need `chmod +x rust/target/debug/claw` if the executable bit isn't set (rare).
176+
- **Debug vs. release** — If the build is slow, you're in debug mode (default). Add `--release` to `cargo build` for faster runtime, but the build itself will take 5–10 minutes.
177+
101178
> [!NOTE]
102179
> **Auth:** claw requires an **API key** (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, etc.) — Claude subscription login is not a supported auth path.
103180
104-
Run the workspace test suite:
181+
Run the workspace test suite after verifying the binary works:
105182

106183
```bash
107184
cd rust

ROADMAP.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5905,3 +5905,32 @@ pub fn from_cwd(cwd: impl AsRef<Path>) -> Result<Self, SessionControlError> {
59055905
**Blocker.** None. Implementation exists on worktree `jobdori-127-verb-suffix` but needs rebase against main (conflicts with #141 which already shipped).
59065906

59075907
**Source.** Clawhip nudge 2026-04-21 21:17 KST — "no excuses, always find something to ship" directive. Session tally: ROADMAP #152.
5908+
5909+
## Pinpoint #153. README/USAGE missing "add binary to PATH" and "verify install" bridge
5910+
5911+
**Gap.** After `cargo build --workspace`, new users don't know:
5912+
1. Where the binary actually ends up (e.g., `rust/target/debug/claw` vs. expecting it in `/usr/local/bin`)
5913+
2. How to verify the build succeeded (e.g., `claw --help`, `which claw`, `claw doctor`)
5914+
3. How to add it to PATH for shell integration (optional but common follow-up)
5915+
5916+
This creates a confusing gap: users build successfully but then get "command not found: claw" and assume the build failed, or they immediately ask "how do I install this properly?"
5917+
5918+
**Real examples from #claw-code:**
5919+
- "claw not found — did the build fail?"
5920+
- "do I need to `cargo install` this?"
5921+
- "why is the binary at `rust/target/debug/claw` and not just `claw`?"
5922+
5923+
**Fix shape (~50 lines).** Add a new "Post-build verification and PATH" section in README (after Quick start) covering:
5924+
1. **Where the binary lives:** `rust/target/debug/claw` (debug build) or `rust/target/release/claw` (release)
5925+
2. **Verify it works:** Run `./rust/target/debug/claw --help` and `./rust/target/debug/claw doctor`
5926+
3. **Optional: Add to PATH** — three approaches:
5927+
- symlink: `ln -s $(pwd)/rust/target/debug/claw /usr/local/bin/claw`
5928+
- `cargo install --path ./rust` (builds and installs to `~/.cargo/bin/`)
5929+
- update shell profile to export PATH
5930+
4. **Windows equivalent:** Point to `rust\target\debug\claw.exe` and `cargo install --path .\rust`
5931+
5932+
**Acceptance:** New users can find the binary location, run it directly, and know their first verification step is `claw doctor`.
5933+
5934+
**Blocker:** None. Pure documentation.
5935+
5936+
**Source:** Clawhip nudge 2026-04-21 21:27 KST — onboarding gap from #claw-code observations earlier this month.

0 commit comments

Comments
 (0)