mirror of
https://github.com/joelhooks/joelclaw.git
synced 2026-09-19 01:24:04 +08:00
d6094e4b89
Three-stage approach: 1. Continuous extraction — turn_end hook monitors context %, starts extracting decisions/failures/preferences at 40% (warm), flushes to Redis + memory at 60% (hot). Zero latency on compaction itself. 2. Task checkpoint — structured Redis doc with currentTask, files, decisions, pre-computed recall queries. Updated incrementally. 3. Post-compaction pointer injection — ~100 token signpost message with task, files, decisions, and recall query refs. Pointers not content — preserves context budget (40% already consumed post-compact). Key insight: post-compaction context is 36-55% full. Every token of injection competes with actual work. Pointers + on-demand recall beats dumping observation text.