feat(init): add --claude-settings flag to choose shared vs local hooks#135
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--claude-settings <shared|local>totracevault initso you can choose whether Claude Code hooks land in.claude/settings.json(shared/committed) or.claude/settings.local.json(personal/git-ignored).sharedfor CI/scripts — current behavior is preserved..gitignoreentry tracks the chosen file, so a committed sharedsettings.jsonis never accidentally ignored whenlocalis picked.Test plan
cargo fmt --all -- --checkcleancargo check --workspacecleancargo clippy --workspace --all-targets -- -D warningscleancargo test -p tracevault-clipasses (15/15 init tests, including 3 new ones forlocaltarget)tracevault init --claude-settings localwrites hooks to.claude/settings.local.jsonand gitignores ittracevault initon a TTY shows the interactive prompt; in CI defaults to sharedWebsite docs were pushed directly to
softwaremill/tracevault-websitemain(commit3512583); submodule pointer bump is intentionally not included in this PR.