Skip to content

feat(init): add --claude-settings flag to choose shared vs local hooks#135

Merged
softberries merged 1 commit into
mainfrom
feat/init-claude-settings-target
May 8, 2026
Merged

feat(init): add --claude-settings flag to choose shared vs local hooks#135
softberries merged 1 commit into
mainfrom
feat/init-claude-settings-target

Conversation

@softberries
Copy link
Copy Markdown
Member

Summary

  • Adds --claude-settings <shared|local> to tracevault init so you can choose whether Claude Code hooks land in .claude/settings.json (shared/committed) or .claude/settings.local.json (personal/git-ignored).
  • When the flag is omitted, init prompts interactively on a TTY and falls back to shared for CI/scripts — current behavior is preserved.
  • The .gitignore entry tracks the chosen file, so a committed shared settings.json is never accidentally ignored when local is picked.

Test plan

  • cargo fmt --all -- --check clean
  • cargo check --workspace clean
  • cargo clippy --workspace --all-targets -- -D warnings clean
  • cargo test -p tracevault-cli passes (15/15 init tests, including 3 new ones for local target)
  • Manual: tracevault init --claude-settings local writes hooks to .claude/settings.local.json and gitignores it
  • Manual: tracevault init on a TTY shows the interactive prompt; in CI defaults to shared
  • Manual: re-running init with the same target does not duplicate hook entries

Website docs were pushed directly to softwaremill/tracevault-website main (commit 3512583); submodule pointer bump is intentionally not included in this PR.

Adds a `--claude-settings <shared|local>` option to `tracevault init`
that selects whether Claude Code hooks are written into
`.claude/settings.json` (default, typically shared with the team) or
`.claude/settings.local.json` (personal, conventionally git-ignored).

When the flag is omitted, init prompts interactively if stdin is a TTY
and falls back to `shared` in non-interactive environments (CI, scripts),
preserving previous behavior.

The .gitignore entry follows the chosen file so a committed shared
`settings.json` is never accidentally ignored when `local` is picked.
Comment thread crates/tracevault-cli/src/commands/init.rs
@softberries softberries merged commit 861f223 into main May 8, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant