Skip to content

Latest commit

 

History

History
533 lines (423 loc) · 24.9 KB

File metadata and controls

533 lines (423 loc) · 24.9 KB

CLAUDE.md - Global Configuration for Claude Code

This file provides permanent context and permissions for Claude Code when working anywhere on this system.

System Overview

  • Hardware: Framework Laptop 13 AMD (Ryzen 7040 series, AMD Radeon 780M)
  • OS: Arch Linux with CachyOS kernel (linux-cachyos) — znver4 optimized
  • Display Manager: greetd + ReGreet (GTK4 Wayland greeter via cage)
  • Window Managers: Hyprland (Wayland), i3wm (X11), Sway (Wayland) — synced configs
  • Shell: zsh with starship prompt
  • Terminal: kitty
  • Dual-boot: Arch Linux + Windows 11

Window Manager Architecture

Three WMs with synchronized configurations via ~/.config/wm-common/:

WM Display Bar Status
Hyprland Wayland waybar Primary/daily driver
i3wm X11 polybar Available (fallback)
Sway Wayland waybar Available (battery-focused)

Shared configs (wm-common/): keybindings, colors, workspaces, modes, window-rules WM-specific: Display output, compositor, clipboard, screenshots, lock screen

Sync scripts in ~/rice/dotfiles-repo/:

  • sync-wm.sh — Main dispatcher (./sync-wm.sh all --collect)
  • translate-hyprland.sh — Regenerate Hyprland from wm-common

See ~/rice/dotfiles-repo/WM-SETUP.md for complete documentation.

Display Manager (greetd + ReGreet)

greetd is the login daemon, ReGreet is the GTK4 greeter, hosted inside cage (minimal Wayland kiosk compositor).

Config Files

File Purpose
/etc/greetd/config.toml greetd daemon config (launches cage -s -mlast -- regreet)
/etc/greetd/regreet.toml ReGreet settings (wallpaper, font, theme, clock)
/etc/greetd/regreet.css Gruvbox Material Dark CSS (colors from wm-common/colors.conf)
/etc/systemd/system/greetd.service.d/crash-limit.conf Limits restarts to 3/60s (prevents crash loops)
/usr/share/backgrounds/gruvbox/ Login wallpapers (dark-archlinux2.png is active)

Key Details

  • Runs on VT1, greeter process runs as greeter user (UID 944, in video group)
  • cage -s enables VT switching — Ctrl+Alt+F2 always reaches a TTY even if greeter crashes
  • Sessions auto-discovered from /usr/share/xsessions/ and /usr/share/wayland-sessions/
  • Logs: /var/log/regreet/log, state: /var/lib/regreet/

Rollback

# If greetd fails (from TTY via Ctrl+Alt+F2):
sudo systemctl disable greetd
# lightdm was removed (Feb 2026) — reinstall if needed:
# sudo pacman -S lightdm lightdm-gtk-greeter
# sudo systemctl enable lightdm
sudo reboot

History

  • lylightdm + nody-greetergreetd + ReGreet (Feb 2026)
  • nody-greeter was orphaned on AUR; greetd + regreet are in official Arch repos
  • lightdm + nody-greeter fully removed (Feb 2026) — greetd is the only DM installed

Boot Architecture (IMPORTANT)

rEFInd Bootloader Setup

This system uses rEFInd as the primary bootloader, having replaced the Windows Boot Manager on the EFI partition. This was done because Windows updates would overwrite the Linux bootloader.

Boot flow:

  1. UEFI loads rEFInd from /boot/EFI/refind/refind_x64.efi
  2. rEFInd presents: Arch Linux | Windows 11
  3. Selecting "Arch" and pressing Insert/F2 shows kernel submenu (manually configured, scanfor manual)
  4. Select "Boot with standard options" (default) or choose a specific kernel from submenu

Critical Boot Files

  • /boot/EFI/refind/refind.conf - rEFInd main configuration (manual menuentry) — this is the actual boot source (line 743 options)
  • /boot/refind_linux.conf - Kernel boot parameters (only used if scanfor internal; currently unused since scanfor manual is set)

Available Kernels

Kernel File Purpose
linux-cachyos /boot/vmlinuz-linux-cachyos Default — CachyOS kernel (znver4 optimized, EEVDF scheduler)
linux-lts /boot/vmlinuz-linux-lts LTS kernel (stable fallback, submenu option)

Note: /boot is 600MB with ~250MB free. Standard linux kernel was removed to save space.

Future expansion: /dev/nvme0n1p6 (2GB, formatted as swap but not mounted) sits between boot and root — can be reclaimed to expand /boot via live USB if needed.

Kernel Parameters (Framework 13 AMD)

These parameters are critical for proper power management:

amd_pstate=active              # Enable AMD P-State EPP driver (required for amd-pstate-epp)
zswap.enabled=0                # Disable zswap (using zram via cachyos-settings instead)
amd_pmc.enable_stb=0           # Disable Smart Trace Buffer (critical for S0i3 sleep)
amdgpu.dcdebugmask=0x10        # Disable PSR (Panel Self Refresh) - prevents black screen on resume
amdgpu.sg_display=0            # Disable scatter-gather display
pcie_aspm.policy=default       # ASPM default policy (powersupersave caused GPU MES timeouts under compute)
amdgpu.reset_method=2          # Force MODE2 reset (most reliable for RDNA3 iGPU recovery)
amdgpu.gpu_recovery=1          # Ensure GPU recovery is enabled
amdgpu.mes_log_enable=1        # Enable MES logging for GPU crash diagnostics
rtc_cmos.use_acpi_alarm=1      # ACPI alarm for wake from hibernation
gpiolib_acpi.ignore_interrupt=AMDI0030:00@18  # Framework-specific GPIO interrupt fix

Permissions

Repository Defaults

This repository keeps .claude/settings.json sandboxed by default and does not opt into bypassPermissions. Use a local, gitignored override (.claude/settings.local.json) if you intentionally want less restrictive behavior on your own machine.

Normal work in this repo should assume permission prompts and sandboxing are part of the default safety posture.

Auto-Backup Hook (Safety Net)

A PreToolUse hook automatically backs up files before every Edit and Write operation:

  • Hook script: ~/.local/bin/claude-backup
  • Backup location: ~/.claude/backups/
  • Format: <safe_filename>.<YYYYMMDD-HHMMSS> with history log at .history
  • Configured in: ~/.claude/settings.jsonhooks.PreToolUse

Undo any change with ~/.local/bin/claude-undo:

claude-undo              # Interactive picker (uses fzf)
claude-undo last         # Undo the most recent edit
claude-undo last 3       # Undo the last 3 edits
claude-undo list         # Show all backups
claude-undo search foo   # Find backups by filename
claude-undo clean 7      # Delete backups older than 7 days

Settings Hierarchy

Settings merge across 3 levels (project overrides global):

  1. ~/.claude/settings.json — global (autonomous mode, hooks, all tool permissions)
  2. <project>/.claude/settings.json — project-level (checked into git)
  3. <project>/.claude/settings.local.json — project-local (gitignored)

General Preferences

PREFERENCE: Always use modern tool alternatives over legacy ones:

Task Use Not
Search file contents rg (ripgrep) grep
Find files fd find
View files bat cat
List dirs eza ls
Grep + bat highlight batgrep grep
Read man pages batman man
View diffs batdiff / delta diff
Pipe viewer batpipe less
Watch files batwatch watch + cat
Format code prettybat
Replace in files sd sed
Disk usage dust / duf du / df
Process list procs ps
HTTP requests xh curl (unless piping)
Duplicate finder czkawka_cli fdupes

PREFERENCE: Built-in Read tool is faster than Bash cat and provides line numbers.

Development Workflow

ALWAYS use Plan Mode before making code changes. Enter Plan Mode (Shift+Tab) to explore the codebase and create an implementation plan before editing or writing files. The workflow is:

  1. Plan Mode — Read files, explore, ask questions, write a plan
  2. User approves plan — ExitPlanMode, user reviews
  3. Implement — Execute against the approved plan
  4. Verify — Run tests, confirm correctness

Only skip Plan Mode for trivial changes (typo fixes, single-line edits the user explicitly dictated).

Search & File Discovery (Always Allowed)

  • Preferred: rg (ripgrep), fd, fzf, batgrep (ripgrep + bat highlighting)
  • Also allowed: grep, find, locate, ag, ack
  • Globbing: Glob, Grep (built-in tools)
  • File info: file, stat, wc, du, dust
  • Duplicate finder: czkawka_cli (dup, empty-folders, big, similar images, broken files)

File Viewing (Always Allowed)

  • Preferred: bat (syntax highlighting), batman (man pages via bat), batpipe (pipe viewer)
  • Also allowed: cat, head, tail, less, more
  • Built-in: Read tool
  • File watching: batwatch (watch file changes with syntax highlighting)
  • Binary viewing: hexdump, xxd, od

Directory Listing (Always Allowed)

  • Preferred: eza (modern ls), tree
  • Also allowed: ls, dir, exa
  • Disk usage: duf, df, ncdu

Text Processing (Always Allowed)

  • Stream: awk, sed, cut, tr, sort, uniq, paste, join
  • Modern: sd (sed alternative), choose
  • Diff: batdiff (preferred — bat + delta), diff, comm, cmp, delta (git diffs)
  • Formatting: prettybat (auto-format + syntax highlight)
  • JSON: jq (query/transform JSON)
  • YAML: yq (query/transform YAML)

Git & Version Control (Always Allowed)

  • Preferred: lazygit (TUI), tig (history viewer)
  • Core: git (all read operations: status, log, diff, branch, show, blame)
  • GitHub: gh (CLI for issues, PRs, repos)
  • Git helpers: git-lfs

System Monitoring (Always Allowed)

  • Preferred: btop, htop, procs
  • Also: ps, top, pgrep, pidof, lsof
  • Performance: hyperfine (benchmarks)
  • Memory/CPU: free, vmstat, uptime
  • Temperature: sensors (lm_sensors)
  • System: uname, hostname, hostnamectl, lscpu, lsblk

Network Tools (Always Allowed)

  • HTTP: curl, wget, xh (httpie-like)
  • DNS: dig, nslookup, host
  • Connections: ss, ip, nmcli
  • Firewall: ufw (Uncomplicated Firewall — active, deny incoming / allow outgoing)
  • Testing: ping, traceroute

Package Management (Always Allowed)

  • Query: pacman -Q, pacman -Qi, pacman -Ql, pacman -Si, pacman -Ss
  • AUR: yay -Q, yay -Si, yay -Ss
  • Updates: topgrade (system-wide updater), topgrade --dry-run

Shell TUI Tools (Always Allowed)

  • gum (glamorous shell scripts - prompts, spinners, inputs)

Development Tools (Always Allowed)

  • Python: python, python3, pip, uv (replaces pip/pyenv for venvs and version management)
  • Node.js: node, npm
  • Rust: cargo, rustc
  • R/Stats: R, Rscript
  • Other: lua, ruby, perl
  • Build: make, cmake, gcc, clang, gdb

LaTeX & Documents (Always Allowed — BLANKET PERMISSION)

All LaTeX, BibTeX, and PDF operations run WITHOUT confirmation.

  • Engines: latex, pdflatex, xelatex, lualatex, context, tex
  • Build: latexmk, arara, rubber, texliveonfly
  • Bibliography: bibtex, biber, bibtex8, bib2bib, bibexport, bibclean
  • Linting/QA: chktex, lacheck, latexindent, latexdiff, latexdiff-vc, detex, texcount
  • Indexing: makeindex, xindy, makeglossaries, splitindex
  • DVI/PS: dvips, dvipdf, dvipdfm, dvipdfmx, ps2pdf, pdf2ps
  • PDF tools: pdfcrop, pdfjam, pdfinfo, pdftotext, pdftoppm, pdfimages, pdffonts, pdfseparate, pdfunite, pdftk, qpdf, pdfannotextractor
  • Ghostscript: gs, ghostscript
  • Graphics: epstopdf, eps2pdf, svg2pdf, img2pdf, convert, magick, inkscape, mpost, metapost, ltximg, mutool
  • TeX Live: tlmgr, texhash, mktexlsr, fmtutil, updmap, kpsewhich, texdoc
  • Conversion: pandoc (universal document converter)
  • Viewers: zathura, evince, okular, mupdf, xdg-open

Database (Always Allowed)

  • PostgreSQL: psql
  • SQLite: sqlite3

Terminal Multiplexer (Always Allowed)

  • tmux, screen

Media/Files (Always Allowed)

  • Media info: ffprobe, mediainfo, exiftool
  • Archives: tar, zip, unzip, 7z, gzip, gunzip, bzip2, xz, zstd
  • Sync: rsync

Editors (for viewing, Always Allowed)

  • vim -R, nvim -R (read-only mode)
  • nano, emacs
  • bat + bat-extras (preferred — batgrep, batman, batdiff, batpipe, batwatch, prettybat)

Dotfile Management (Always Allowed)

  • stow

Shell History & Navigation (Always Allowed)

  • zoxide (smart cd)
  • atuin (shell history)
  • tldr (command examples)

Container Tools (Always Allowed)

  • docker ps, docker images, docker logs, docker inspect

Sudo Operations (Allowed for Reading)

  • Read configs: sudo cat /etc/*, sudo ls /etc/*
  • Boot configs: sudo cat /boot/*
  • Systemd: systemctl status, systemctl list-units, systemctl is-active
  • Logs: journalctl
  • Network: sudo cat /etc/NetworkManager/*

Common Directories

Path Purpose
/home/dro Home directory, general work
/home/dro/rice/ All coding projects (NFL analytics, dotfiles, etc.)
/home/dro/.config/ User application configs (i3, polybar, kitty, etc.)
/home/dro/.config/wm-common/ Shared WM configs (keybindings, colors, modes)
/home/dro/.local/bin/ Custom scripts and binaries
/home/dro/.claude/plans/ Claude Code plan files
/boot/ Kernel and bootloader files
/etc/ System configuration
/etc/NetworkManager/ Network configuration
/etc/systemd/ Systemd service configs
/etc/modprobe.d/ Kernel module options
/etc/scx_loader/ sched-ext scheduler config

Project Structure

Projects are organized under /home/dro/rice/:

  • nfl-analytics/ - Main NFL prediction system
  • nfl-dissertation/ - Academic dissertation LaTeX
  • nfl-experiments/ - ML experiments and prototypes
  • nfl-backtest/ - Backtesting framework
  • nfl-hotfix/ - Quick fixes and patches
  • dotfiles-repo/ - System dotfiles (synced with update.sh)

Each project may have its own CLAUDE.md that extends/overrides this global config.

Framework 13 AMD Specifics

Power Management Files

  • /etc/modprobe.d/amd-pmc.conf - AMD PMC module options
  • /etc/modprobe.d/amdgpu.conf - AMD GPU module options
  • /etc/modprobe.d/blacklist-amdxdna.conf - NPU driver blacklist (prevents SMU crash on udev events)
  • /etc/systemd/sleep.conf.d/framework-amd.conf - Sleep/hibernate settings (HibernateMode=shutdown)
  • /etc/systemd/logind.conf.d/lid-suspend-hibernate.conf - Lid switch → suspend-then-hibernate
  • /usr/lib/systemd/system-sleep/framework-s0i3-fix.sh - Thunderbolt NHI wakeup disable for S0i3
  • /home/dro/.local/bin/power-switch - AC/battery power profile script

Known Issues & Workarounds

  1. Black screen on resume: Fixed with amdgpu.dcdebugmask=0x10 kernel param
  2. High power in sleep: Must use amd_pmc.enable_stb=0
  3. Captive portals: NetworkManager dispatcher at /etc/NetworkManager/dispatcher.d/90-captive-portal
  4. WiFi power: Intel AX210 (WiFi 6E), managed by NetworkManager with iwd backend
  5. Temperature reporting: Use cros_ec hwmon (cpu_f75303@4d) for actual CPU temp, NOT k10temp Tctl which has +40°C offset. Polybar config: hwmon-path = /sys/class/hwmon/hwmon8/temp2_input
  6. Tray icon black background: GTK CSS fix at ~/.config/gtk-3.0/gtk.css forces transparent backgrounds on StatusNotifierItem icons (nm-applet, etc.)
  7. ABM color wash in power-saver: Fixed with systemd drop-in at /etc/systemd/system/power-profiles-daemon.service.d/disable_panel_powersavings.conf — passes --block-action=amdgpu_panel_power to prevent AMD Automatic Brightness Management from washing out colors
  8. XDNA NPU crash risk: amdxdna driver blacklisted in /etc/modprobe.d/blacklist-amdxdna.conf — auto-loading caused SMU death spiral on udev reload (2026-02-28). Manual modprobe amdxdna still works.
  9. EFI boot resilience: rEFInd copied to UEFI fallback path /boot/EFI/BOOT/BOOTX64.EFI — survives NVRAM corruption. Original Windows bootloader backed up as .bak-windows. Boot entries saved to ~/efi-boot-entries-backup.txt.
  10. GPU MES crashes during ML training: RDNA3 780M MES (Micro Engine Scheduler) fails under sustained ROCm/HIP compute, causing hard reboots. Mitigated with amdgpu.reset_method=2, pcie_aspm.policy=default (was powersupersave), and raised vm.min_free_kbytes=131072. Monitor with journalctl -f --grep="MES|GPU|reset". If MES errors persist, escalate to pinning ROCm 6.x or switching to linux-lts.
  11. GPU crash on hibernate resume (ACPI S4): RDNA3 780M SDMA0 ring timeout + MES unresponsive on S4 wake. Fixed with HibernateMode=shutdown in sleep.conf — kernel writes image to swap then powers off completely; resume goes through cold boot → GPU inits fresh → restore from image. Config: /etc/systemd/sleep.conf.d/framework-amd.conf
  12. S0i3 blocked by Thunderbolt NHI: NHI0/NHI1 (c3:00.5/c3:00.6) ACPI wakeup prevents SoC from reaching deepest idle state during s2idle, causing ~5-10%/hr drain instead of ~1-2%/hr. Fixed with sleep hook at /usr/lib/systemd/system-sleep/framework-s0i3-fix.sh that disables PCI wakeup pre-suspend and re-enables post-resume.

Hibernate Setup

  • Uses swap file /swapfile (64GB) on root partition (not separate partition)
  • IMPORTANT: Swapfile must be formatted with mkswap /swapfile and enabled with swapon /swapfile
  • zram is also active for regular swap (priority 100), swapfile is for hibernate (priority -2)
  • resume=UUID=c367a553-2673-40c2-87f3-7db256ef1447 and resume_offset=3989504 in kernel params
  • HibernateMode=shutdown — avoids ACPI S4 which crashes RDNA3 GPU; does clean power off instead
  • Lid close on battery → suspend-then-hibernate (fast wakes + zero drain after 30min)
  • Lid close on AC → suspend only (no hibernate, saves SSD wear)
  • To verify hibernate is ready: swapon --show should list both zram0 AND /swapfile

System Backup (Borg)

Borg Backup (v1.4.3) replaces Timeshift (removed March 2026 — rsync mode caused USB drive corruption during sleep). Borg uses atomic commits and dedup+zstd compression.

  • Repo: /mnt/borg-backup/system (125.5G ext4 USB drive, label borg-backup, /dev/sda2)
  • Script: /usr/local/bin/borg-system-backup (AC-only, 24h cooldown stamp, auto-mount, sleep-inhibit)
  • Trigger: udev rule (85-borg-backup.rules) starts timer on AC connect → 2min delay → backup
  • Timer: borg-backup.timer — AC-triggered (OnActiveSec=2min) + daily 2 AM fallback, 30min jitter, persistent catch-up
  • Cooldown: /var/lib/borg-backup-last-run stamp file — skips if backup ran within 24h
  • Retention: 3 daily, 2 weekly, 1 monthly
  • Excludes: /home, /root, /tmp, /var/cache/pacman, /swapfile, /dev, /proc, /sys, /run, /mnt, /media, docker/containerd
  • fstab: LABEL=borg-backup /mnt/borg-backup ext4 noauto,nofail,relatime 0 0
  • First backup: 51 GB → 19.4 GB deduplicated (62% savings), ~10 min
# Check timer
systemctl list-timers | grep borg

# Manual backup
sudo systemctl start borg-backup.service

# List/inspect archives
sudo mount /mnt/borg-backup
sudo borg list /mnt/borg-backup/system
sudo borg info /mnt/borg-backup/system
sudo umount /mnt/borg-backup

# Restore (from live USB)
sudo mount /dev/nvme0n1p7 /mnt
sudo mount /mnt/borg-backup
cd /mnt && sudo borg extract /mnt/borg-backup/system::ARCHIVE_NAME

CachyOS Kernel Setup

CachyOS repositories are installed for znver4-optimized packages (Zen 4 specific builds).

Repository source: https://mirror.cachyos.org Repo installer backup: Can remove with ./cachyos-repo.sh --remove from the original tarball

Kernel features:

  • Built with Clang/LLVM (better optimization than GCC)
  • EEVDF scheduler (default, 1000Hz tickrate)
  • PREEMPT_DYNAMIC enabled (runtime preemption switching)
  • sched-ext support (BPF-based scheduler hot-swapping)
  • Enhanced AMD P-State patches

sched-ext via scx_loader (auto-managed service): The scx_loader systemd service automatically runs scx_lavd on boot. To manually test other schedulers:

sudo systemctl stop scx_loader  # Stop auto-managed scheduler
sudo scx_rusty   # Good for mixed workloads
sudo scx_lavd    # Good for gaming/latency (default)
# Ctrl+C to stop and revert to EEVDF
sudo systemctl start scx_loader  # Resume auto-managed scheduler

Verify running CachyOS kernel:

uname -r                              # Should show *-cachyos
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver  # amd-pstate-epp
ls /sys/kernel/sched_ext              # Verify sched-ext available

Performance Optimization Stack

The following packages and services are installed for system-wide performance:

Packages:

  • cachyos-settings — sysctl tweaks, udev rules, ZRAM config, helper scripts
  • ananicy-cpp + cachyos-ananicy-rules — automatic process prioritization
  • irqbalance — distributes hardware interrupts across CPU cores
  • power-profiles-daemon — AMD-recommended power management (not TLP)
  • easyeffects — audio EQ for Framework's downward-firing speakers

Enabled Services:

systemctl is-active scx_loader ananicy-cpp irqbalance power-profiles-daemon ufw

Additional Kernel Parameters (in refind.conf menuentry line 743, NOT refind_linux.conf):

  • amdgpu.reset_method=2 — Force MODE2 GPU reset for RDNA3 stability
  • amdgpu.mes_log_enable=1 — MES scheduler logging for crash diagnostics

sysctl Optimizations (from cachyos-settings, with local overrides):

  • vm.swappiness=100 — balanced ZRAM usage. Set via udev override /etc/udev/rules.d/30-zram.rules (vendor rule in /usr/lib/ sets 150; 150 caused compositor thrashing during GPU compute)
  • vm.vfs_cache_pressure=10 — aggressively keep dentries/inodes in cache
  • vm.min_free_kbytes=131072 — 128MB emergency reserve (raised from 32MB for GPU compute safety)
  • vm.watermark_boost_factor=15000 — kswapd boost for burst GPU allocations (was disabled)
  • ZRAM with ZSTD compression matching RAM size

I/O Scheduler: adios for NVMe (Adaptive Deadline I/O Scheduler — better latency than none while maintaining throughput)

Polybar Configuration

Theme: hack (Gruvbox Material Dark)

  • Config: ~/.config/polybar/hack/config.ini
  • Colors: ~/.config/polybar/hack/colors.ini (background #CC32302f with 80% opacity)
  • Modules: ~/.config/polybar/hack/modules.ini and user_modules.ini
  • Scripts: ~/.config/polybar/hack/scripts/

Git Commit Style

NEVER add Co-Authored-By or AI attribution headers to commits. This applies globally to ALL repositories.

Use simple commit messages:

git commit -m "Description of change"

This preference is also enforced in ~/.claude/settings.json via the attribution setting.

Critical File Backup Policy

ALWAYS backup before editing these files:

# Boot configuration (CRITICAL - can brick system)
sudo cp /boot/refind_linux.conf /boot/refind_linux.conf.backup-$(date +%Y%m%d-%H%M%S)
sudo cp /boot/EFI/refind/refind.conf /boot/EFI/refind/refind.conf.backup-$(date +%Y%m%d-%H%M%S)

NEVER use sed for rEFInd config edits — pattern matching on multi-line blocks is error-prone and has deleted entire menuentries. For /boot/EFI/refind/refind.conf:

  • Use line-number specific edits: sed -i '740s|old|new|'
  • Or manually edit with sudo nvim
  • Always verify with grep -A 20 'menuentry "Arch"' after changes
# System configs
sudo cp /etc/fstab /etc/fstab.backup-$(date +%Y%m%d-%H%M%S)
sudo cp /etc/mkinitcpio.conf /etc/mkinitcpio.conf.backup-$(date +%Y%m%d-%H%M%S)

Recovery if boot fails:

  1. Boot from Arch USB
  2. Mount root: mount /dev/nvme0n1p7 /mnt (or mount UUID=c367a553-2673-40c2-87f3-7db256ef1447 /mnt)
  3. Mount EFI: mount /dev/nvme0n1p5 /mnt/boot (or mount UUID=ACE6-9D1E /mnt/boot)
  4. Restore backup: cp /mnt/boot/refind_linux.conf.backup-* /mnt/boot/refind_linux.conf

Partition Quick Reference:

Partition UUID Mount Purpose
nvme0n1p5 ACE6-9D1E /boot Arch EFI (600M)
nvme0n1p6 2463db77-... Swap (2G, not mounted - using /swapfile)
nvme0n1p7 c367a553-... / Arch root (876G)

Documentation Sync

When making code changes, keep these in sync:

  • CLAUDE.md — module map, key classes, exchange auth, dependencies, stats
  • ~/.claude/projects/-home-dro/memory/MEMORY.md — project status, test counts
  • MCP knowledge graph — entities, relations, paths (via mcp__memory__* tools)
  • README.md — CLI commands, architecture description

A Stop hook automatically reminds you to check at session end. Run /sync for a thorough manual audit.

Troubleshooting Commands

# Check current kernel params
cat /proc/cmdline

# Check power state capability
cat /sys/power/state
cat /sys/power/disk

# Check AMD PMC status (if debug enabled)
cat /sys/kernel/debug/amd_pmc/s0i3_stats

# Check NetworkManager connectivity
nmcli general status
nmcli connection show

# Restart polybar
~/.config/polybar/hack/launch.sh

# Check systemd services
systemctl status NetworkManager
systemctl status bluetooth