This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
- Language: Use English (UK) spelling and conventions throughout this entire project
- Documentation: All comments, documentation, and text should follow British English standards
This is a personal dotfiles repository for macOS/Linux development environment setup. The repository contains shell configurations, aliases, automated setup scripts, and Homebrew package management.
- Library Functions (
lib/): Shared utility librariesplatform.sh: Platform detection (macOS/Linux) and OS-specific logicinteractive.sh: Interactive prompts, colours, and formatting utilitiesbackup.sh: File backup and symlink managementbrewfile-profiles.sh: Installation profile management for minimal/developer/full setups
- Shell Scripts (
shell/): Modular setup scripts for different componentsaliases.sh: Symlinks shell aliases configurationzshrc.sh: Symlinks Zsh configurationvim.sh: Symlinks Vim configurationclaude.sh: Symlinks Claude Code settings and global CLAUDE.mdcrontab.sh: Configures scheduled maintenance tasksterminal.sh: macOS Terminal.app configuration (macOS only)misc.sh: Additional miscellaneous configurationssudo-touch-id/: Touch ID for sudo authentication (macOS only)setup.sh: Configures Touch ID authentication for sudo commandsverify.sh: Verifies Touch ID configurationrestore.sh: Restores original PAM configuration
- Setup Scripts (
setup/): Core installation scriptsinstall-homebrew.sh: Homebrew installation for macOS/Linux
- Configuration Files (
config/): Symlinked dotfiles and settings.zshrc,.aliases,.vimrc: Shell and editor configurationscrontab: Scheduled maintenance job definitions.claude/settings.json: Claude Code user settings.claude/CLAUDE.md: Global Claude Code instructionssetup-profiles/: Installation profile Brewfiles (minimal.brewfile, developer.brewfile)
- Scripts (
scripts/): Utility scriptslink-node.sh: Node.js symlink management
- Testing (
test-setup.sh,docker-compose.yml,Dockerfile,TESTING.md): Docker-based testing infrastructure for validating setup scripts - Brewfile: Homebrew package manifest for consistent package installation across machines (full installation)
# Clone and setup (interactive - recommended)
git clone https://github.com/ruchernchong/dotfiles.git $HOME/dotfiles
cd $HOME/dotfiles
# Preview installation (dry-run mode)
./setup.sh --dry-run # or -n
# Run interactive setup
./setup.sh
# Skip interactive prompts (uses defaults)
./setup.sh --no-interactive
# Use specific profile without prompts
./setup.sh --no-interactive --profile=minimal
# OR: One-line installation
curl -L https://raw.githubusercontent.com/ruchernchong/dotfiles/master/install.sh | bash# Install all Homebrew packages
brew bundle install
# Update Brewfile
brew bundle dump --force# Reload zsh configuration
zshreload # alias for 'source $HOME/.zshrc'
# Edit zsh configuration
zshconfig # alias for 'vi $HOME/.zshrc'# View current cron jobs
crontab -l
# Apply dotfiles crontab configuration
crontab $HOME/dotfiles/config/crontab
# View maintenance logs
tail -f /tmp/brew-weekly.log # Weekly Homebrew updates (Sunday 2 AM)
tail -f /tmp/brew-cleanup.log # Monthly cleanup (1st of month, 3:30 AM)
tail -f /tmp/brew-health.log # Quarterly health checks (Jan/Apr/Jul/Oct, 4 AM)
tail -f /tmp/pnpm-cleanup.log # Weekly pnpm store pruning (Monday 3 AM)# Test setup script with Docker (dry-run mode)
./test-setup.sh
# Test specific profile
./test-setup.sh minimal
./test-setup.sh developer
./test-setup.sh full
# Test all scenarios
./test-setup.sh all
# Interactive debugging
./test-setup.sh shell
# Clean up test containers
./test-setup.sh clean# Setup Touch ID for sudo commands
sudo zsh shell/sudo-touch-id/setup.sh
# Verify Touch ID configuration
zsh shell/sudo-touch-id/verify.sh
# Restore original PAM configuration
sudo zsh shell/sudo-touch-id/restore.shThe setup.sh script provides both interactive and automated setup:
Interactive mode (default):
- Dry-run mode: Use
--dry-runor-nflag to preview configuration without making changes - Profile selection: Choose between minimal, developer, or full installation
- minimal: Essential tools only (~15 packages) - Git, GitHub CLI, shell tools, Node.js (fnm, pnpm), utilities
- developer: Development environment (~40-50 packages) - Everything in minimal + databases, containers, cloud tools, essential VSCode extensions
- full: Complete installation (~120 packages) - Everything in developer + multiple Python versions, additional cloud SDKs, all VSCode extensions, media tools
- Backup handling: Options to backup, skip, or overwrite existing dotfiles
- Crontab management: Configure scheduled maintenance tasks
- Tool selection: Choose Node.js version manager (fnm/nvm/both)
- Python version: Select primary Python version (3.13/3.12/3.11/all) - only for full profile
- Database options: Select whether to install PostgreSQL and Redis - only for developer and full profiles
Non-interactive mode (--no-interactive):
- Uses default settings (full profile)
- Can specify profile via
--profile=minimal|developer|full
Installation sequence:
- Collects user preferences (interactive mode only)
- Makes all
.shscripts executable - Runs scripts in
setup/directory (Homebrew installation) - Runs scripts in
shell/directory (dotfile symlinking, crontab configuration) - Installs Homebrew packages via
brew bundle install
- Zsh: Oh-My-Zsh with syntax highlighting plugin
- Theme: Starship prompt
- Node: Uses
fnmfor Node.js version management - Environment: Configured for development with PostgreSQL, Python, Android SDK
User-level Claude Code settings and global instructions are backed up and version-controlled:
- Settings Location:
config/.claude/settings.json→ symlinked to~/.claude/settings.json - Global Instructions:
config/.claude/CLAUDE.md→ symlinked to~/.claude/CLAUDE.md - Setup: Automatically configured via
shell/claude.shduringsetup.shexecution - Manual restore: Run
source $HOME/dotfiles/shell/claude.shto restore the symlinks
Extensive git aliases defined in .aliases:
g→gitgs→git statusgcm→git checkout mainglog→ formatted git log with graph- Full list available in
.aliasesfile
Automated maintenance tasks via crontab:
- Weekly:
- Homebrew update check (Sundays 2 AM)
- pnpm store pruning (Mondays 3 AM)
- Monthly: Homebrew cleanup (1st of month, 3:30 AM)
- Quarterly: Homebrew health diagnostics (Jan/Apr/Jul/Oct, 4 AM)
- Logs: All maintenance logged to
/tmp/for review
Enable Touch ID authentication for sudo commands:
- Setup: Modifies PAM configuration to enable Touch ID
- Security: Uses
/etc/pam.d/sudo_local(survives macOS updates) - Requirements: macOS 10.15 (Catalina) or later
- Verification: Includes verify script to test configuration
- Restore: Can restore original configuration if needed
- macOS (10.15+)
- Linux (Ubuntu 20.04+, Fedora 33+)
- Development: git, gh, nvm, pnpm, yarn, bun
- Cloud: vercel-cli, aws-sam-cli, pulumi, doctl
- Databases: postgresql@17, redis
- Utilities: jq, ripgrep, httpie, direnv
- VSCode with comprehensive extension set
NEXT_TELEMETRY_DISABLED=1: Disables Next.js telemetryPNPM_HOME: pnpm global package directory- PostgreSQL and Android SDK paths configured