Guidance for coding agents (Claude Code, Codex, Gemini CLI) working in this repository. Claude Code reads it through CLAUDE.md, which only imports this file.
Personal macOS dotfiles repo for Sami Al Mouhtaseb. Manages shell config, Homebrew packages, terminal emulator settings, and utility scripts. Targets macOS with zsh (Oh My Zsh + Powerlevel10k) as the primary shell.
# Import dotfiles from repo to home directory (creates timestamped backups first)
sh dot.sh import
# Backup current home dotfiles into the repo
sh dot.sh backup
# Diff repo dotfiles against what's currently in ~
sh dot.sh diff# Bootstrap a fresh macOS machine (installs Homebrew, zsh, Oh My Zsh, fonts, dev tools, etc.)
# Idempotent: re-runs only install what is missing. Never overwrites files in ~ (uses `dot.sh init`).
sh setup.sh
# Show what a run would do on this machine, change nothing
DRY_RUN=1 sh setup.sh# Install all packages from Brewfile
cd Brew && brew bundle
# Backup current Homebrew state to Brewfile
sh Brew/backup.sh# Apply both preference sets (also run by setup.sh)
sh macos/non-defaults.sh && sh macos/setup.sh
# Regenerate macos/non-defaults.sh from this machine's live settings
sh macos/backup.shdot.sh manages four operations (init, import, backup, diff). LOCATIONS lists filenames (without the leading dot) copied between ~/dotfiles/.<name> and ~/.<name>; EXTRAS lists "<repo path>|<home path>" pairs for files that live elsewhere (currently empty; terminal configs are pointed at the repo by iTerm/setup.sh and ghostty/setup.sh instead). All operations skip files whose content already matches. init only creates files missing from ~ and is what setup.sh runs, so re-running setup never overwrites local edits. When adding a new dotfile, update LOCATIONS or EXTRAS in dot.sh.
.zshrc— loads Oh My Zsh, Powerlevel10k theme, plugins (zsh-syntax-highlighting, zsh-autosuggestions, ssh-agent), then sources.bash_profile.bash_profile— adds~/dotfiles/binto PATH, then sources.exports,.aliases,.functions, and.extra(gitignored personal overrides).exports— PATH entries and environment variables (mise, Go, Android, etc.).aliases— shell aliases (navigation, Docker, Ruby/Rails, networking, etc.).functions— utility shell functions.history_preexec.sh— SQLite-based command history tracking (stores commands in~/.history.db)
bin/— custom scripts added to PATH (extract, ip lookup, http server, etc.)Brew/— Homebrew Brewfile and management scriptscron/— cron job scripts (history backup to~/history_logs/)ghostty/— Ghostty config;ghostty/setup.shsymlinks it to~/Library/Application Support/com.mitchellh.ghostty/config(run bysetup.sh, likeiTerm/setup.sh)iTerm/— iTerm2 preferences, fonts, and themesmacos/— macOS system preferences viadefaults write;setup.shruns both scripts on Darwin only.macos/setup.shis the hand-written opinionated set wanted on every machine (keyboard, Finder, Dock, screenshots, Safari).macos/non-defaults.shbacks up the settings changed by hand on the current machine and is generated —sh macos/backup.shregenerates it by reading the keys inmacos/keys.listoff the live system, the wayBrew/backup.shregenerates the Brewfile. To track a new setting, add it tokeys.list([-currentHost] <domain> <key> | <comment>) and re-run the backup; never editnon-defaults.shby hand.misc/— one-off utility scripts (CSV splitting, file renaming, etc.)packages/—gems.list(Ruby gems installed bysetup.sh),pip.list(legacy reference only, not restored); global npm CLIs are listed inmise.toml
Commits are GPG-signed by default (.gitconfig has gpgsign = true for both commits and tags). The git config includes branch aliases like brn which creates branches prefixed with satnami/.