Files
claw-code/rust
Yeachan-Heo 188c35f8a6 feat(cli): add safe claude-md init command
Add a genuinely useful /init command that creates a starter CLAUDE.md from the current repository shape without inventing unsupported setup flows. The scaffold pulls in real verification commands and repo-structure notes for this workspace, and it refuses to overwrite an existing CLAUDE.md.

This keeps the command honest and low-risk while moving the CLI closer to Claude Code's practical bootstrap surface.

Constraint: /init must be non-destructive and must not overwrite an existing CLAUDE.md

Constraint: Generated guidance must come from observable repo structure rather than placeholder text

Rejected: Interactive multi-step init workflow | too much unsupported UI/state machinery for this Rust CLI slice

Confidence: high

Scope-risk: moderate

Reversibility: clean

Directive: Keep generated CLAUDE.md templates concise and repo-derived; do not let /init drift into fake setup promises

Tested: cargo fmt; cargo clippy --workspace --all-targets -- -D warnings; cargo test --workspace

Not-tested: manual /init invocation in a separate temporary repository without a preexisting CLAUDE.md
2026-03-31 19:57:38 +00:00
..
2026-03-31 17:43:09 +00:00
2026-03-31 17:43:09 +00:00

Rust port foundation

This directory contains the first compatibility-first Rust foundation for a drop-in Claude Code CLI replacement.

Current milestone

This initial milestone focuses on harness-first scaffolding, not full feature parity:

  • a Cargo workspace aligned to major upstream seams
  • a placeholder CLI crate (rusty-claude-cli)
  • runtime, command, and tool registry skeleton crates
  • a compat-harness crate that reads the upstream TypeScript sources in ../src/
  • tests that prove upstream manifests/bootstrap hints can be extracted from the leaked TypeScript codebase

Workspace layout

rust/
├── Cargo.toml
├── README.md
├── crates/
│   ├── rusty-claude-cli/
│   ├── runtime/
│   ├── commands/
│   ├── tools/
│   └── compat-harness/
└── tests/

How to use

From this directory:

cargo fmt --all
cargo check --workspace
cargo test --workspace
cargo run -p rusty-claude-cli -- --help
cargo run -p rusty-claude-cli -- dump-manifests
cargo run -p rusty-claude-cli -- bootstrap-plan

Design notes

The shape follows the PRD's harness-first recommendation:

  1. Extract observable upstream command/tool/bootstrap facts first.
  2. Keep Rust module boundaries recognizable.
  3. Grow runtime compatibility behind proof artifacts.
  4. Document explicit gaps instead of implying drop-in parity too early.

Relationship to the root README

The repository root README explains the leaked TypeScript codebase. This document tracks the Rust replacement effort that lives in rust/.