Skip to content

Commit 074bd5b

Browse files
committed
Make Claude project bootstrap available from a real init command
The Rust CLI previously hid init behind the REPL slash-command surface and only created a starter CLAUDE.md. This change adds a direct `init` subcommand and moves bootstrap behavior into a shared helper so `/init` and `init` create the same project scaffolding: `.claude/`, `.claude.json`, starter `CLAUDE.md`, and local-only `.gitignore` entries. The generated guidance now adapts to a small, explicit set of repository markers so new projects get language/framework-aware starting instructions without overwriting existing files. Constraint: Runtime config precedence already treats `.claude.json`, `.claude/settings.json`, and `.claude/settings.local.json` as separate scopes Constraint: `.claude/sessions/` is used for local session persistence and should not be committed by default Rejected: Keep init as REPL-only `/init` behavior | would not satisfy the requested direct init command and keeps bootstrap discoverability low Rejected: Ignore all of `.claude/` | would hide shared project config that the runtime can intentionally load Confidence: high Scope-risk: moderate Reversibility: clean Directive: Keep direct `init` and `/init` on the same helper path and keep detection heuristics bounded to explicit repository markers Tested: cargo fmt --all; cargo clippy --workspace --all-targets -- -D warnings; cargo test --workspace Not-tested: interactive manual run of `rusty-claude-cli init` against a non-test repository
1 parent d6341d5 commit 074bd5b

4 files changed

Lines changed: 555 additions & 138 deletions

File tree

rust/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@ cd rust
109109
cargo run -p rusty-claude-cli -- --allowedTools read,glob
110110
```
111111

112+
Bootstrap Claude project files for the current repo:
113+
114+
```bash
115+
cd rust
116+
cargo run -p rusty-claude-cli -- init
117+
```
118+
112119
### 2) REPL mode
113120

114121
Start the interactive shell:
@@ -179,7 +186,7 @@ cargo run -p rusty-claude-cli -- --resume session.json /memory /config
179186
- `/resume <session-path>` — load a saved session into the REPL
180187
- `/config [env|hooks|model]` — inspect discovered Claude config
181188
- `/memory` — inspect loaded instruction memory files
182-
- `/init`create a starter `CLAUDE.md`
189+
- `/init`bootstrap `.claude.json`, `.claude/`, `CLAUDE.md`, and local ignore rules
183190
- `/diff` — show the current git diff for the workspace
184191
- `/version` — print version and build metadata locally
185192
- `/export [file]` — export the current conversation transcript

rust/crates/commands/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ const SLASH_COMMAND_SPECS: &[SlashCommandSpec] = &[
101101
},
102102
SlashCommandSpec {
103103
name: "init",
104-
summary: "Create a starter CLAUDE.md for this repo",
104+
summary: "Bootstrap Claude project files for this repo",
105105
argument_hint: None,
106106
resume_supported: true,
107107
},

0 commit comments

Comments
 (0)