What's New
Five features that extend Token Optimizer from audit-only to active context protection.
Progressive Checkpoints
Captures session state at 50%, 65%, and 80% context fill -- not just the emergency save at ~98%. Richer checkpoints because there's more transcript to extract from. Restores prefer the earliest (richest) checkpoint.
Tool Result Archive
PostToolUse hook archives large tool results (>4KB) to disk. After compaction wipes them from context, use expand <tool-use-id> to retrieve any archived result instead of re-running the command.
Savings Dashboard
Tracks cumulative dollar savings from setup optimization, checkpoint restores, and tool archiving. savings command shows breakdown by category with daily averages.
JSONL Toolkit
Three utilities for session JSONL files:
jsonl-inspect-- record counts, token distribution, largest recordsjsonl-trim-- replace oversized tool results with placeholdersjsonl-dedup-- detect and remove duplicate system reminders
All use streaming I/O and atomic writes. Safe for 50MB+ session files.
Lost-in-the-Middle Optimizer
Scores CLAUDE.md against the U-shaped attention curve. Flags critical rules (NEVER/ALWAYS/MUST) sitting in the low-attention zone (30-70% position). attention-optimize generates a reordered version.
Security Hardening (Torture Room Audit)
- Path traversal guard on dashboard skill management + tool_use_id sanitization
- CORS restricted to localhost-only for POST endpoints
- 64KB body limit on dashboard POST
- Atomic writes for all file modifications
- SQLite connection leak fixes
- Manifest switched to append-only JSONL (eliminates race condition)
Full Changelog
5 files changed, +1,738 lines
v2.6.3...v3.0.0