## Problem Identified ContextPressureMonitor reports "NORMAL" (6.7%) pressure while frequent compaction events occur. User observed disconnect between pressure scores and actual session sustainability. ## Root Cause Current monitor only tracks response token generation, NOT total context window consumption: - ✅ Tracks: Response tokens, message counts - ❌ Missing: Tool result sizes, system prompts, function schemas ## Example from This Session - Reported tokens: ~50k (25% of budget) - Actual context used: ~90k+ tokens - instruction-history.json read twice (12k tokens) - concurrent-session-architecture doc (large) - Multiple bash outputs - System prompts and reminders Result: Compaction at "NORMAL" pressure ## inst_019 Requirements Track total context window consumption: - Response tokens (current) - User messages (current) - Tool result sizes (NEW - estimate from file reads, grep, bash) - System overhead (NEW - ~5k tokens baseline) - Compaction risk prediction (NEW - warn when >70% context used) ## Implementation Timeline - Priority: MEDIUM (doesn't block current work) - Phase: 4 or 6 (validation engine or polish phase) - Complexity: 4-6 hours (requires instrumentation of tool calls) ## Impact - Better compaction prediction - Earlier handoff warnings - More accurate pressure reporting - Reduced unexpected session terminations Quadrant: OPERATIONAL | Persistence: HIGH | Session: 2025-10-10-api-memory-transition 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| sessions | ||
| instruction-history.json | ||
| tractatus-config.json | ||