Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ ssh/.ssh/agent/
# Local tool settings (runtime state only — claude/ stow package is tracked)
/.claude/

# Claude Code owns ~/.claude/settings.json and rewrites it on every /model
# switch, so it's installed as a plain file rather than stowed from here.
claude/.claude/settings.json

# Nested git repos (managed as submodules instead)
zprezto/.git

Expand Down
12 changes: 0 additions & 12 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,6 @@ Personal dotfiles managed with GNU stow. Full details: README.md.
`doctor.sh` detect it's missing.
- The repo must stay cloned at `~/Development/dotfiles`; stow's symlinks are
relative to that path.
- `claude/.claude/settings.json` is owned by Claude Code, which rewrites it on
every `/model` switch, so it's handled in two halves. `.gitattributes` runs it
through `claude-settings-clean.py` (drops the volatile keys, sorts the rest)
so commits only ever carry durable config; a new key Claude Code writes back
as state goes in that script's `VOLATILE`. The file is also marked
`skip-worktree`, because a clean filter alone doesn't quiet `git status` —
git's refresh path hashes the file raw. Both halves are per-clone index and
config state: `bootstrap.sh` sets them, `doctor.sh` checks them.
- To commit a deliberate change to that settings file, unhide it first:
`git update-index --no-skip-worktree claude/.claude/settings.json`, commit,
then re-hide with `--skip-worktree`. While it's hidden, git ignores every
local edit to it, including one you meant to keep.
- Shell scripts: keep `shellcheck`-clean
(`shellcheck bootstrap.sh doctor.sh lib.sh macos/*.sh`).

Expand Down
8 changes: 0 additions & 8 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,6 @@ else
sudo apt-get install -y git curl stow zsh tmux neovim xclip ripgrep fd-find
fi

# ---- Register the Claude settings clean filter ----
# .gitattributes names the filter; git only ever runs one it has been given a
# command for, so an unregistered clone silently commits the volatile keys.
echo ">>> Registering the Claude settings clean filter..."
cd "$DOTFILES_DIR"
git config "$CLAUDE_SETTINGS_FILTER" "$CLAUDE_SETTINGS_FILTER_CMD"
git update-index --skip-worktree "$CLAUDE_SETTINGS_FILE"

# ---- Init git submodules ----
echo ">>> Initializing git submodules..."
cd "$DOTFILES_DIR"
Expand Down
42 changes: 0 additions & 42 deletions claude-settings-clean.py

This file was deleted.

61 changes: 0 additions & 61 deletions claude/.claude/settings.json

This file was deleted.

15 changes: 0 additions & 15 deletions doctor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,21 +134,6 @@ else
ok "submodules at recorded commits"
fi

configured_filter="$(cd "$DOTFILES_DIR" && git config --get "$CLAUDE_SETTINGS_FILTER" 2>/dev/null)"
if [[ "$configured_filter" == "$CLAUDE_SETTINGS_FILTER_CMD" ]]; then
ok "Claude settings clean filter registered"
else
bad "Claude settings clean filter not registered"
hint "git -C $DOTFILES_DIR config $CLAUDE_SETTINGS_FILTER $CLAUDE_SETTINGS_FILTER_CMD"
fi

if [[ "$(cd "$DOTFILES_DIR" && git ls-files -v "$CLAUDE_SETTINGS_FILE" 2>/dev/null)" == S* ]]; then
ok "Claude settings marked skip-worktree"
else
bad "Claude settings not marked skip-worktree"
hint "git -C $DOTFILES_DIR update-index --skip-worktree $CLAUDE_SETTINGS_FILE"
fi

if [[ -n "$(cd "$DOTFILES_DIR" && git status --porcelain 2>/dev/null)" ]]; then
bad "working tree is dirty"
hint "git -C $DOTFILES_DIR status"
Expand Down
12 changes: 0 additions & 12 deletions lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,6 @@ MACHINE_FILE="$DOTFILES_DIR/.machine"
# Stow packages carrying no special options.
STOW_PACKAGES=(zsh git tmux ghostty nvim base16 claude)

# Claude Code rewrites ~/.claude/settings.json whenever a runtime option
# changes, which dirties the stowed copy on every /model switch. .gitattributes
# routes the file through this clean filter so git only sees the durable config;
# the filter command itself lives in each clone's git config, set by bootstrap.
# The filter keeps volatile keys out of commits; git still reports the file as
# modified though, because its refresh path hashes the file raw and only the
# diff machinery applies the filter. skip-worktree is what actually silences
# that — see CLAUDE.md for how to commit a deliberate change to the file.
CLAUDE_SETTINGS_FILE="claude/.claude/settings.json"
CLAUDE_SETTINGS_FILTER="filter.claude-settings.clean"
CLAUDE_SETTINGS_FILTER_CMD="$DOTFILES_DIR/claude-settings-clean.py"

# ssh is stowed on its own: --no-folding keeps ~/.ssh a real directory holding a
# symlinked config. Folded, ~/.ssh would itself be a symlink into this repo, and
# every key or known_hosts file written there would land in the working tree.
Expand Down
Loading