claude-home/CLAUDE.md
Cal Corum b237d6c056 Optimize CLAUDE.md and fix Gitea Actions Docker cache
CLAUDE.md optimization (329 → 104 lines):
- Compress repetitive loading rules into keyword table
- Remove 72 redundant "Note:" lines (info already in CONTEXT.md files)
- State loading convention once instead of repeating 13 times
- Preserve all functionality, special cases, and maintenance protocol
- 68% reduction in size, easier to scan and maintain

Gitea Actions Docker buildx fix:
- Remove conditional from Docker Hub login step
- Login now runs on all builds (PR and main), not just main
- Fixes "push access denied" on second build when writing cache layers
- Push flag still gates actual image publishing to main-only

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-13 15:14:35 -06:00

5.2 KiB

Home Lab Documentation System

Core Instructions

  • Always have permission to run tests
  • Check imports when writing code (prevent NameErrors)
  • Temp files go in .claude/tmp/, clean up after
  • Prefer editing existing files over creating new ones
  • After complex tasks, prompt to save learnings to cognitive memory
  • At session end, ask: "Should I update our documentation?"
  • At 25% context remaining, ask: "Should I update docs before we lose context?"

Automatic Context Loading

Loading Convention (applies to all technologies below)

For each technology directory {tech}/:

  • Auto-load: {tech}/CONTEXT.md (overview, patterns, best practices)
  • Auto-load: {tech}/troubleshooting.md (errors, debugging, emergency procedures)
  • If in {tech}/scripts/: Also load {tech}/scripts/CONTEXT.md

Keyword Triggers

Keywords Tech Directory
tdarr, transcode, ffmpeg, gpu transcoding, nvenc, scheduler tdarr/
docker, container, image, compose, kubernetes, k8s, dockerfile, podman docker/
virtual machine, vm, proxmox, kvm, hypervisor, guest, virtualization vm-management/
network, nginx, proxy, load balancer, dns, port, firewall, ssh, ssl, tls, npm, nginx proxy manager, reverse proxy, pihole, pi-hole, orbital sync networking/
monitoring, alert, notification, discord, health check, status, uptime, uptime kuma, status page, windows reboot, system monitor, gpu monitor, nvidia monitor monitoring/
task, todo, productivity, task manager, brain dump, focus, adhd, task tracking, context switch, task dashboard, n8n, workflow, automation, webhook, integration, ko-fi productivity/
openclaw, ai assistant, personal assistant, minimax, autonomous agent, agent skills productivity/openclaw/
jellyfin, plex, emby, media server, streaming, watchstate, watch history, nvidia driver, gpu transcoding media-servers/
media download, video download, yt-dlp, playwright, pokeflix, streaming scraper, web scraping, media archival media-tools/
gaming, steam, proton, steam tinker launch, stl, ready or not, gamescope, gamemode, dxvk, wine, windows games, linux gaming gaming/
server config, lxc config, docker compose deploy, infrastructure config, gitea, n8n config, foundry config, home assistant config, config sync server-configs/
database, sql, postgres, mysql, redis, mongodb, db optimization, query performance, database backup, connection pooling, schema migration databases/

Special cases:

  • Pi-hole keywords → also load networking/pihole-ha-setup.md
  • n8n keywords → also load productivity/n8n/CONTEXT.md
  • Ko-fi keywords → also load productivity/n8n/workflows/kofi-paper-dynasty.md
  • Jellyfin keywords → also load media-servers/jellyfin-ubuntu-manticore.md

Directory Triggers

  • Working in /tdarr/, /docker/, etc. → auto-load that tech's CONTEXT.md + troubleshooting.md
  • Working in /tdarr/scripts/, etc. → auto-load parent CONTEXT.md + scripts/CONTEXT.md + troubleshooting.md

Troubleshooting Triggers

Keywords: shutdown, stop, emergency, reset, recovery, crash, broken, not working, error, issue, problem, debug, troubleshoot, fix

  • Detect tech from context → load BOTH CONTEXT.md AND troubleshooting.md

File Extension Triggers

  • .pydevelopment/python-CONTEXT.md
  • .js, .mjs, .tsdevelopment/nodejs-CONTEXT.md
  • .sh, .bash, .zshdevelopment/bash-CONTEXT.md

Loading Priority

  1. File extension triggers (highest)
  2. Directory context
  3. Keyword triggers (additive)
  4. Load 3-4 files max per trigger

Documentation Structure

/{technology}/              # Each tech is self-contained
  ├── CONTEXT.md           # Overview, patterns, best practices
  ├── troubleshooting.md   # Errors, debugging, emergency recovery
  ├── examples/            # Working configs and templates
  └── scripts/
      ├── CONTEXT.md       # Script-specific docs
      └── *.py, *.sh       # Active operational scripts (production code)

/development/              # Cross-tech language patterns
  ├── python-CONTEXT.md
  ├── nodejs-CONTEXT.md
  └── bash-CONTEXT.md

Technologies: tdarr, docker, vm-management, networking, monitoring, productivity, productivity/openclaw, productivity/n8n, media-servers, media-tools, gaming, server-configs, databases

Documentation Maintenance

Auto-prompt when:

  1. New tech without dedicated directory → "Should I create /{tech}/ structure?"
  2. New error solved → "Should I add to {tech}/troubleshooting.md?"
  3. New scripts created → "Should I update {tech}/scripts/CONTEXT.md?"
  4. Session end with changes → "Should I update documentation?"

Update checklist:

  • {tech}/CONTEXT.md for new patterns/architecture
  • {tech}/troubleshooting.md for new errors/solutions
  • {tech}/scripts/CONTEXT.md for new procedures
  • Main CLAUDE.md if new keywords/triggers needed

Validation (periodic):

  • All tech dirs have keyword triggers
  • Loading paths match actual files
  • Each tech has CONTEXT.md + troubleshooting.md

Warning triggers:

  • Working with tech lacking docs structure
  • Solving problems not in troubleshooting guides
  • Creating scripts without CONTEXT.md
  • Loading rules reference missing files