[Bug]: --dir and --bridge-script are not validated, so a bad path ends at the trust prompt or a "Bridge spawn failure"
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start in Cli::validate() in src/lib.rs, where the -C/--dir and --bridge-script values arrive, and in inspect_bridge_script, which already produces the missing-script error. Reproduce with a nonexistent path and a plain file passed to -C, and confirm that the trust prompt and the projects entry in .claude.json happen after parsing. Done means both bad inputs exit 2 with a usage error naming the argument, before logging, trust or the bridge run, and that doctor is unchanged.
Written by the indexing model from the issue text.
Description
Description
Path arguments are checked only on use. A -C/--dir that is missing or a file still gets the trust prompt, saved trust, then a misleading SDK error. A missing --bridge-script exits 21 and suggests claude-rs doctor --strict, which passes: doctor checks the default script and takes no --bridge-script.
Steps to Reproduce
With a scratch CLAUDE_CONFIG_DIR:
claude-rs -C /nonexistent/dir, choose Yes.claude-rs -C ./notes.txt(a file), choose Yes.claude-rs --bridge-script /nonexistent/bridge.js, thenclaude-rs doctor --strict
Expected Behavior
Each exits 2 with a usage error naming the argument; nothing is saved.
Actual Behavior
/nonexistent/diris added toprojectsin.claude.json, then exit 22 withConnection failed: agent stream failed: Claude Code native binary at .../claude exists but failed to launch.and a libc-mismatch hint. An existing directory connects.error=ENOTDIR: not a directory, posix_spawn '.../claude', exit 22.-
doctor:Bridge spawn failure detail: bridge script does not exist: /nonexistent/bridge.js: Agent bridge process failed to start exit_code: 21 next_step: claude-rs doctor --strict13 passed, 2 warnings, 0 failures, exit 0.
Version
claude-rs 0.15.2 (main at 70c04ef)
Operating System
macOS (Apple Silicon), macOS 27.2
Rust Version
rustc 1.89.0 (29483883e 2025-08-04)
Proposed approach
Check both in Cli::validate() (src/lib.rs), so a bad value is a usage error before logging, trust or the bridge: --dir must be a directory, and --bridge-script reuses the error inspect_bridge_script already produces. No SDK change. My fork has a version of this: https://github.com/ayush5harma/claude-code-rust/pull/32 (second commit).
- Dominant language
- Rust
- Stars
- 261
- Forks
- 57
- Avg merge
- 10h 15m
- Merged PRs (30d)
- 58
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from srothgan/claude-code-rust
-
area: tui good first issue help wanted type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
srothgan/claude-code-rust#473 ·
Maintainers usually reply within 1 day
-
area: agent-sdk area: tui help wanted status: discussion type: bug
Difficulty 4/5 3-5 days Newbie friendliness 25/100
srothgan/claude-code-rust#469 · 2 comments ·
Maintainers usually reply within 1 day
-
[FEATURE]: Make footer information and layout configurablePossibly taken @srothgan claimed this 2 days ago. Openarea: core area: tui type: feature
srothgan/claude-code-rust#466 · 1 assignee ·
Maintainers usually reply within 1 day
-
area: agent-sdk area: core good first issue help wanted type: feature
Difficulty 4/5 3-5 days Newbie friendliness 45/100
srothgan/claude-code-rust#465 · 2 comments ·
Maintainers usually reply within 1 day
-
area: agent-sdk area: core good first issue help wanted type: feature
Difficulty 4/5 3-5 days Newbie friendliness 42/100
srothgan/claude-code-rust#464 · 2 comments ·
Maintainers usually reply within 1 day
All issues in srothgan/claude-code-rust
Similar issues
-
documentation good first issue
Difficulty 2/5 Half a day Newbie friendliness 72/100
sujithputta02/Esapay#13 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
tursodatabase/turso#10002 ·
Maintainers usually reply within 1 day
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
topgrade-rs/topgrade#2419 ·
Maintainers usually reply within 1 day
-
review-bot
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
midagedev/bloomery#318 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Chia-Network/clvm_rs#863 ·
Maintainers usually reply within 1 day