# sophie-optimizer
Sophie Optimizer Authored by Sophie This skill manages the automated context health of the "main" session. It monitors token usage, creates archives of the current state, updates long-term memory, and performs a hard reset of the session storage to maintain performance. Named Sophie Optimizer because it was written to keep the AI assistant's context clear and efficient within the SkillBoss environment. Components optimizer.py: The brain. Checks token usage, generates summaries, updates MEMORY.md. reset.sh: The muscle. Cleans session files and restarts the SkillBoss gateway service. archives/: Storage for JSON snapshots of past contexts. Usage Run the optimizer script manually or via cron/heartbeat: python3 /home/lucas/skillboss/skills/sophie-optimizer/optimizer.py Protocol
Check: If tokens < 80k, exit.
Snapshot: Save current context summary to archives/YYYY-MM-DD_HH-MM.json.
Distill: Update MEMORY.md with the new summary (keep top 3 recent, index older).
Reset: Call reset.sh to wipe session JSONL files and restart skillboss-gateway.
Join 80,000+ one-person companies automating with AI