Auto-memory (~/.claude/projects/*/memory, 774 files across 49 projects) goes to
gitea vh/claude-memory, not this repo. The git dir is ~/claude-memory.git and its
work tree is ~/.claude/projects, and exclude rules admit only memory/ folders, so
transcripts stay local and nothing is added inside ~/.claude.
- home_root/.local/bin/claude-memory-sync: commit, rebase onto origin, push, under
a flock; --status; --init for a fresh machine. Every run records its result
for the drift check.
- home_config/systemd/user/claude-memory-sync.{service,timer}: hourly with
Persistent=true. Linked but not yet enabled.
- link-dotfiles --check now also reports uncommitted changes (a stale session
can write old content back through an intact link) and a failed or stale
(>3h) memory sync.
- CLAUDE.md and README document the backup and the never-put-credentials-in-memory rule.
127 lines
5.6 KiB
Markdown
127 lines
5.6 KiB
Markdown
# dotfiles
|
|
|
|
Personal dotfiles. Configs are organized by where they get linked:
|
|
|
|
| Folder | Links into | Examples |
|
|
| -------------- | ------------ | --------------------------------- |
|
|
| `home_root` | `~` | `.zshrc`, `.zshenv`, `.gitconfig`, `.claude/`, `.local/bin/` |
|
|
| `home_config` | `~/.config` | `nvim`, `zellij`, `ghostty`, `aerospace`, `zsh`, `git` |
|
|
| `windows` | Windows-only | `windows-terminal/settings.json` |
|
|
| `lk-installers`| n/a | helper scripts to install tooling |
|
|
|
|
## Linux / macOS (GNU stow)
|
|
|
|
One-shot, host-aware:
|
|
|
|
```bash
|
|
./link-dotfiles # link only (installs stow if missing)
|
|
./link-dotfiles --apps # fresh box: install all CLI tools, then link
|
|
./link-dotfiles --check # report drift (detached copies, dangling links); changes nothing
|
|
```
|
|
|
|
It detects the host (macOS vs Linux), installs [`stow`](https://www.gnu.org/software/stow/)
|
|
if missing (Homebrew on macOS; apt/dnf/pacman on Linux), then runs
|
|
`stow home_root` and `stow --target=$HOME/.config home_config`. Re-running is
|
|
safe — stow is idempotent.
|
|
|
|
### Installing the tools
|
|
|
|
The configs assume a handful of CLI tools (`bat`, `fd`, `fzf`, `zoxide`,
|
|
`zellij`, `nvim`, `btop`, `htop`, `tldr`, `fastfetch`, plus the `fzf-git.sh`
|
|
helper). One host-aware installer covers them:
|
|
|
|
```bash
|
|
./lk-installers/install-apps # macOS -> Homebrew; Linux -> apt + upstream
|
|
```
|
|
|
|
On macOS it bootstraps Homebrew if absent. It's idempotent — re-running only
|
|
fills gaps. `./link-dotfiles --apps` just runs this first, then links.
|
|
|
|
The zsh prompt and plugins (zinit, Powerlevel10k, autosuggestions,
|
|
syntax-highlighting, completions, vi-mode, fzf-tab) **self-install** from
|
|
`.zshrc` on first shell start, so they're not part of `install-apps`.
|
|
|
|
Secrets never live here. `.zshenv` sources `~/.config/secrets/env.sh` if it
|
|
exists; that file is per-machine and comes from the vault (`secret`), not git.
|
|
|
|
## Claude Code (`home_root/.claude`)
|
|
|
|
Tracked, and linked into `~/.claude`: `CLAUDE.md` (global instructions),
|
|
`CONTEXT.md`, `settings.json`, `keybindings.json`, `statusline-command.sh`,
|
|
`bin/ratecheck`, and the `australis-design` skill. The per-repo login helper is
|
|
`home_config/zsh/claude-config-dir.zsh` together with
|
|
`home_root/.local/bin/claude-config-dir-init`.
|
|
|
|
Deliberately **not** tracked:
|
|
- `.credentials.json` and `settings.local.json`, which are ignored.
|
|
- `projects/`, the per-project auto-memory and transcripts.
|
|
- Tool-managed skills (`graphify`, `synced`).
|
|
- The galdrabok skill links, which galdrabok owns.
|
|
|
|
**Edit the repo path, never the link with `sed -i`.** `sed -i` and other
|
|
write-temp-then-rename editors replace the link with a detached copy, and this
|
|
repo then silently goes stale. That happened to `CLAUDE.md` and
|
|
`statusline-command.sh` in September 2026. Claude Code's Edit tool refuses to
|
|
write through a link and names the target, which is the safe behaviour. Claude
|
|
Code may also rewrite `settings.json` itself when settings change from inside the
|
|
app. After that, or whenever in doubt, run `./link-dotfiles --check`.
|
|
|
|
## Claude Code auto-memory (separate private repo)
|
|
|
|
Auto-memory (`~/.claude/projects/*/memory`) is backed up to gitea
|
|
`vh/claude-memory`, not to this repo, because it changes constantly and holds
|
|
operational detail. `home_root/.local/bin/claude-memory-sync` does the work. Its
|
|
git dir is `~/claude-memory.git` and its work tree is `~/.claude/projects`, and
|
|
exclude rules admit only the `memory/` folders, so transcripts never leave the
|
|
machine and nothing extra appears inside `~/.claude`.
|
|
|
|
```bash
|
|
claude-memory-sync # commit, rebase onto the remote, push
|
|
claude-memory-sync --status # last run + uncommitted count
|
|
claude-memory-sync --init # fresh machine: clone and wire up
|
|
systemctl --user enable --now claude-memory-sync.timer # hourly (unit files in home_config/systemd/user)
|
|
```
|
|
|
|
Project folders are named after absolute paths, so memory lines up across Linux
|
|
boxes; macOS (`/Users/...`) gets its own folders. `./link-dotfiles --check` flags a
|
|
failed or stale (>3h) sync.
|
|
|
|
## Windows (PowerShell)
|
|
|
|
`stow` doesn't run natively on Windows, so use the PowerShell equivalent. It
|
|
mirrors stow by creating **junctions** for directories and **symlinks/hardlinks**
|
|
for files — none of which require administrator rights:
|
|
|
|
```powershell
|
|
pwsh -File .\link-dotfiles.ps1
|
|
```
|
|
|
|
- Re-running is safe: already-correct links are skipped.
|
|
- Any real file/dir that would be overwritten is moved aside to `<name>.bak`.
|
|
- Preview without changing anything: `pwsh -File .\link-dotfiles.ps1 -DryRun`
|
|
|
|
The repo stays the source of truth — edit files under `home_root` /
|
|
`home_config` and the linked locations update live.
|
|
|
|
### Windows Terminal
|
|
|
|
`windows/windows-terminal/settings.json` is linked into the Terminal package
|
|
folder (`...\Microsoft.WindowsTerminal_*\LocalState\settings.json`) by
|
|
`link-dotfiles.ps1`. Because it's linked, changes you make in the Terminal UI
|
|
write straight back into this repo. The settings include the **Australis**
|
|
color scheme and the **VictorMono Nerd Font Mono** profile font; install the
|
|
font (see below) so glyphs render.
|
|
|
|
## Prompt
|
|
|
|
**zsh uses [Powerlevel10k](https://github.com/romkatv/powerlevel10k)** — loaded
|
|
through zinit straight from `.zshrc`, with the instant-prompt preamble near the
|
|
top for fast startup. The theme config lives at `home_root/.p10k.zsh` (stowed to
|
|
`~/.p10k.zsh`); there's no separate installer — zinit fetches it on first shell
|
|
start.
|
|
|
|
PowerShell uses [starship](https://starship.rs/) (configured separately).
|
|
|
|
Both expect a **Nerd Font v3** (e.g. **VictorMono Nerd Font Mono**) installed and
|
|
selected in your terminal for glyphs to render.
|