This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a dotfiles repository containing personal shell configurations, custom utility scripts, and installation automation. The repository manages both public and private dotfiles through a dual-repository structure.
The repository follows a two-tier architecture:
- Public repository (
./): Contains shareable configurations and scripts - Private repository (
./dotfilesprivate/): Separate git clone (not a submodule) containing private/sensitive scripts and configs. It is.gitignore'd and cloned viamake clone-private
Both repositories mirror the same structure:
configs/- Shell configurations, git configs, and tool settingslocal-bin/- Custom utility scriptsskills/- Claude Code skills (symlinked to~/.claude/skills/)installers/- Installation automation scripts (public repo only)
# Install all configs, scripts, and skills
make install-all
# Install only scripts to ~/.local/bin
make install-local-bin
# Install only config files
make install-configs
# Install only Claude Code skills to ~/.claude/skills
make install-skills
# Pull latest from both public and private repos
make pull-master
# Update from upstream and reinstall (pull-master + install-all)
make update
# Clone the private dotfiles repository
make clone-private- Scripts: Symlinked from
local-bin/anddotfilesprivate/local-bin/to~/.local/bin/ - Configs: Symlinked from
configs/to home directory with OS-specific handling:- macOS: Uses
zshrc,gpg-agent-mac.conf,gpg.conf, k9s skin to~/Library/Application Support/k9s/skins/ - Linux: Uses
bashrc,gpg-agent-linux.conf, k9s skin to~/.config/k9s/skins/ - Both:
gitignore,terraformrc,tmux.conf,starship.toml,global-claude-config.md
- macOS: Uses
- Skills: Symlinked from
skills/anddotfilesprivate/skills/to~/.claude/skills/
All shell scripts must follow these standards:
- Shebang:
#!/usr/bin/env bash - Error handling:
set -euo pipefail - Formatting: 4-space indentation via
shfmt -i 4 - Linting: Must pass
shellcheck - Shared utilities: Source
util.shviasource "$(dirname "${BASH_SOURCE[0]}")"/util.sh(provideserr()for stderr output) - Output prefixes: Use emoji for status messages:
❌errors,✅success,⏳in-progress,ℹ️info - Validation: After writing or modifying any script, always run
shellfmt.sh <script-path>which runs bothshellcheckandshfmt
All installers create symlinks (not copies) so that git pull immediately updates active configs and scripts. Installers use absolute paths via realpath or pwd for reliable symlinking and handle both public and private repositories in sequence.
installers/install-configs.sh detects the OS and symlinks the appropriate files:
- macOS (Darwin):
zshrc→~/.zshrc,gpg-agent-mac.conf→~/.gnupg/gpg-agent.conf,gpg.conf→~/.gnupg/gpg.conf - Linux:
bashrc→~/.bashrc,gpg-agent-linux.conf→~/.gnupg/gpg-agent.conf - Both:
gitignore,terraformrc,tmux.conf,starship.toml, andglobal-claude-config.md→~/.claude/CLAUDE.md
configs/global-claude-config.md is symlinked to ~/.claude/CLAUDE.md during config installation. This provides system-wide Claude instructions that apply across all projects (e.g., use rg instead of grep, run shellfmt.sh after writing scripts).
Shell configs (zshrc/bashrc) add these to PATH:
~/.local/bin- Custom scripts from this repo~/go/bin- Go binaries/opt/homebrew/binand/opt/homebrew/sbin- Homebrew on macOS
- Add executable script to
local-bin/(ordotfilesprivate/local-bin/for private scripts) - Ensure it follows the shell script conventions above (shebang,
set -euo pipefail, etc.) - Run
shellfmt.sh <script-path>to lint and format - Run
make install-local-binto symlink to~/.local/bin
- Edit the script in-place (symlinks mean changes are live immediately)
- Run
shellfmt.sh <script-path>to lint and format; fix any issues it reports
- Add config file to
configs/ - Add the symlink command to
installers/install-configs.sh(follow existing patterns for OS-specific handling) - Run
make install-configsto apply
Since configs are symlinked, editing the file in the repo immediately affects the active config. No reinstall needed unless adding new files.
This repository uses Conventional Commits format. Scope should reflect the component being changed (e.g., feat(litellm-proxy):, fix(shell):, docs(conventional-commits):).
Each skill is a subdirectory under skills/ containing a SKILL.md file that defines the skill's behavior, triggers, and allowed tools. After adding or modifying skills, run make install-skills to symlink them to ~/.claude/skills/.
- The private repository (
dotfilesprivate/) is a separate standalone git clone, not a submodule - Installation scripts assume both repos are present and will attempt to process both
- Symlinks mean changes in this repo are immediately reflected in home directory
- The
make updatecommand pulls latest from both repositories and reinstalls - The
install-local-bin.shinstaller skipsutil.sh(it's a shared library, not a standalone script). If you add another library file tolocal-bin/, update the installer's skip list