This file provides permanent context and permissions for Claude Code when working anywhere on this system.
- 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
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.
greetd is the login daemon, ReGreet is the GTK4 greeter, hosted inside cage (minimal Wayland kiosk compositor).
| 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) |
- Runs on VT1, greeter process runs as
greeteruser (UID 944, invideogroup) cage -senables 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/
# 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- ly → lightdm + nody-greeter → greetd + 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
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:
- UEFI loads rEFInd from
/boot/EFI/refind/refind_x64.efi - rEFInd presents: Arch Linux | Windows 11
- Selecting "Arch" and pressing Insert/F2 shows kernel submenu (manually configured,
scanfor manual) - Select "Boot with standard options" (default) or choose a specific kernel from submenu
/boot/EFI/refind/refind.conf- rEFInd main configuration (manual menuentry) — this is the actual boot source (line 743options)/boot/refind_linux.conf- Kernel boot parameters (only used ifscanfor internal; currently unused sincescanfor manualis set)
| 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.
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
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.
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.json→hooks.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 daysSettings merge across 3 levels (project overrides global):
~/.claude/settings.json— global (autonomous mode, hooks, all tool permissions)<project>/.claude/settings.json— project-level (checked into git)<project>/.claude/settings.local.json— project-local (gitignored)
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.
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:
- Plan Mode — Read files, explore, ask questions, write a plan
- User approves plan — ExitPlanMode, user reviews
- Implement — Execute against the approved plan
- Verify — Run tests, confirm correctness
Only skip Plan Mode for trivial changes (typo fixes, single-line edits the user explicitly dictated).
- 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)
- Preferred:
bat(syntax highlighting),batman(man pages via bat),batpipe(pipe viewer) - Also allowed:
cat,head,tail,less,more - Built-in:
Readtool - File watching:
batwatch(watch file changes with syntax highlighting) - Binary viewing:
hexdump,xxd,od
- Preferred:
eza(modern ls),tree - Also allowed:
ls,dir,exa - Disk usage:
duf,df,ncdu
- 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)
- 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
- 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
- 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
- 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
gum(glamorous shell scripts - prompts, spinners, inputs)
- 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
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
- PostgreSQL:
psql - SQLite:
sqlite3
tmux,screen
- Media info:
ffprobe,mediainfo,exiftool - Archives:
tar,zip,unzip,7z,gzip,gunzip,bzip2,xz,zstd - Sync:
rsync
vim -R,nvim -R(read-only mode)nano,emacsbat+bat-extras(preferred —batgrep,batman,batdiff,batpipe,batwatch,prettybat)
stow
zoxide(smart cd)atuin(shell history)tldr(command examples)
docker ps,docker images,docker logs,docker inspect
- 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/*
| 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 |
Projects are organized under /home/dro/rice/:
nfl-analytics/- Main NFL prediction systemnfl-dissertation/- Academic dissertation LaTeXnfl-experiments/- ML experiments and prototypesnfl-backtest/- Backtesting frameworknfl-hotfix/- Quick fixes and patchesdotfiles-repo/- System dotfiles (synced with update.sh)
Each project may have its own CLAUDE.md that extends/overrides this global config.
/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
- Black screen on resume: Fixed with
amdgpu.dcdebugmask=0x10kernel param - High power in sleep: Must use
amd_pmc.enable_stb=0 - Captive portals: NetworkManager dispatcher at
/etc/NetworkManager/dispatcher.d/90-captive-portal - WiFi power: Intel AX210 (WiFi 6E), managed by NetworkManager with iwd backend
- Temperature reporting: Use
cros_echwmon (cpu_f75303@4d) for actual CPU temp, NOTk10tempTctl which has +40°C offset. Polybar config:hwmon-path = /sys/class/hwmon/hwmon8/temp2_input - Tray icon black background: GTK CSS fix at
~/.config/gtk-3.0/gtk.cssforces transparent backgrounds on StatusNotifierItem icons (nm-applet, etc.) - 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_powerto prevent AMD Automatic Brightness Management from washing out colors - XDNA NPU crash risk:
amdxdnadriver blacklisted in/etc/modprobe.d/blacklist-amdxdna.conf— auto-loading caused SMU death spiral on udev reload (2026-02-28). Manualmodprobe amdxdnastill works. - 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. - 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(waspowersupersave), and raisedvm.min_free_kbytes=131072. Monitor withjournalctl -f --grep="MES|GPU|reset". If MES errors persist, escalate to pinning ROCm 6.x or switching tolinux-lts. - GPU crash on hibernate resume (ACPI S4): RDNA3 780M SDMA0 ring timeout + MES unresponsive on S4 wake. Fixed with
HibernateMode=shutdownin 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 - 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.shthat disables PCI wakeup pre-suspend and re-enables post-resume.
- Uses swap file
/swapfile(64GB) on root partition (not separate partition) - IMPORTANT: Swapfile must be formatted with
mkswap /swapfileand enabled withswapon /swapfile - zram is also active for regular swap (priority 100), swapfile is for hibernate (priority -2)
resume=UUID=c367a553-2673-40c2-87f3-7db256ef1447andresume_offset=3989504in kernel paramsHibernateMode=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 --showshould list both zram0 AND /swapfile
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, labelborg-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-runstamp 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_NAMECachyOS 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 schedulerVerify 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 availableThe following packages and services are installed for system-wide performance:
Packages:
cachyos-settings— sysctl tweaks, udev rules, ZRAM config, helper scriptsananicy-cpp+cachyos-ananicy-rules— automatic process prioritizationirqbalance— distributes hardware interrupts across CPU corespower-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 ufwAdditional Kernel Parameters (in refind.conf menuentry line 743, NOT refind_linux.conf):
amdgpu.reset_method=2— Force MODE2 GPU reset for RDNA3 stabilityamdgpu.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 cachevm.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)
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.inianduser_modules.ini - Scripts:
~/.config/polybar/hack/scripts/
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.
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:
- Boot from Arch USB
- Mount root:
mount /dev/nvme0n1p7 /mnt(ormount UUID=c367a553-2673-40c2-87f3-7db256ef1447 /mnt) - Mount EFI:
mount /dev/nvme0n1p5 /mnt/boot(ormount UUID=ACE6-9D1E /mnt/boot) - 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) |
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.
# 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