- Spawns Claude Code CLI with stream-json output in session directories
- Reads stdout/stderr concurrently via asyncio.gather (no pipe deadlock)
- Handles process lifecycle with clean termination (no zombies)
- Queues messages during processing using asyncio.Queue
- Auto-restarts on crash with --continue flag (max 3 retries)
- Parses stream-json events (assistant, result, system) to callbacks
- Supports persona configuration (system_prompt, model, max_turns)
- Uses terminate() + wait_for() + kill() fallback pattern
Based on research: .planning/phases/01-session-process-foundation/01-RESEARCH.md
- Four persona templates: default, brainstorm, planner, research
- JSON schema: name, description, system_prompt, settings
- Each persona has distinct system_prompt for different modes
- Settings include model and max_turns configuration
- Fix SessionManager paths to use homelab directory
- SessionManager class with session lifecycle management
- Session CRUD: create, list, switch, get, update
- Session validation: alphanumeric, hyphens, underscores only
- Persona inheritance from library on session creation
- Session status tracking: idle, active, suspended
- Metadata persistence with JSON on disk
- Active session tracking and switching logic
- Telegram bot (@georgsen_homelab_bot) for two-way communication
- Commands: /status, /pbs, /backups, /beszel, /kuma, /ping
- Photos and files saved to inbox for Claude to read
- Runs as systemd user service
- Shared storage via ZFS bind mounts
- rpool/shared/mikkel on PVE host
- Mounted to ~/stuff in mgmt, dev, general containers
- SMB access via \\mgmt\stuff (Tailscale MagicDNS)
- Updated helper scripts list in CLAUDE.md
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>