You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chezmoi git … — chezmoi's git passthrough; currently not covered at all.
Same story for the deny list (branch -d / -D / --delete), which today only mirrors git and rtk git.
Maintaining these by hand means every new allowed/denied git verb has to be added in up to four places — and the prefixes are already out of sync (git -C * partial, chezmoi git missing).
Proposal
Make settings.json a chezmoi template (settings.json.tmpl) and generate the git rules from a single source of truth:
one list of read-only allow verbs: log *, diff *, show *, status *, blame *, tag -l*, tag, remote -v, remote show *, remote get-url *, ls-files *, stash list *, rev-parse *, describe *, worktree list *, for-each-ref *, shortlog *, reflog show *, reflog
one list of deny verbs: branch -d *, branch -D *, branch --delete *
one list of providers/prefixes: git, git -C *, rtk git, chezmoi git
A template loop then emits the cross-product as Bash(<provider> <verb>) into the allow / deny arrays. Adding a verb or a provider becomes a one-line change that fans out everywhere, in sync.
Notes / acceptance
Only the git block is generated; the rest of settings.json (kubectl/helm entries, hooks, non-git tools) stays literal in the template.
Emit valid JSON — handle trailing commas (build the list and toJson it, or guard the last element).
Add a render check (a run_onchange_ step or dotfiles doctor assertion) that chezmoi cat ~/.claude/settings.json | jq . parses — a template bug must not silently break all permissions.
Decide whether git -C * should compose with rtk/chezmoi (probably unnecessary — git -C is bare-git only).
Why now
Surfaced while hardening the permission allowlist in #26, where the rtk git deny mirrors were added by hand — exactly the maintenance burden this would remove.
Problem
home/dot_claude/settings.jsonhand-maintains git permission rules separately for several invocation prefixes, and they've already drifted:git …—Bash(git log *),Bash(git diff *), … plus the narrowedtag -l/remote -v/reflog showread forms.git -C * …— only a partial mirror (a subset of the verbs is duplicated).rtk git …— the rtk Bash hook rewritesgit X→rtk git X, so deny rules must be mirrored under this prefix (see Harden distill skill, audit permission allowlist, track rtk hook #26).chezmoi git …— chezmoi's git passthrough; currently not covered at all.Same story for the deny list (
branch -d/-D/--delete), which today only mirrorsgitandrtk git.Maintaining these by hand means every new allowed/denied git verb has to be added in up to four places — and the prefixes are already out of sync (
git -C *partial,chezmoi gitmissing).Proposal
Make
settings.jsona chezmoi template (settings.json.tmpl) and generate the git rules from a single source of truth:log *,diff *,show *,status *,blame *,tag -l*,tag,remote -v,remote show *,remote get-url *,ls-files *,stash list *,rev-parse *,describe *,worktree list *,for-each-ref *,shortlog *,reflog show *,reflogbranch -d *,branch -D *,branch --delete *git,git -C *,rtk git,chezmoi gitA template loop then emits the cross-product as
Bash(<provider> <verb>)into theallow/denyarrays. Adding a verb or a provider becomes a one-line change that fans out everywhere, in sync.Notes / acceptance
settings.json(kubectl/helm entries,hooks, non-git tools) stays literal in the template.toJsonit, or guard the last element).run_onchange_step ordotfiles doctorassertion) thatchezmoi cat ~/.claude/settings.json | jq .parses — a template bug must not silently break all permissions.git …→rtk git …, so thertk gitdeny mirror must remain (that's why branch-delete is denied under both prefixes — see Harden distill skill, audit permission allowlist, track rtk hook #26).git -C *should compose withrtk/chezmoi(probably unnecessary —git -Cis bare-git only).Why now
Surfaced while hardening the permission allowlist in #26, where the
rtk gitdeny mirrors were added by hand — exactly the maintenance burden this would remove.