tractatus/.claude
TheFlow 51f6712090 feat: add inst_019 for improved context pressure monitoring
## 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>
2025-10-10 23:42:01 +13:00
..
sessions feat: fix CSP violations & implement three audience paths 2025-10-07 12:21:00 +13:00
instruction-history.json feat: add inst_019 for improved context pressure monitoring 2025-10-10 23:42:01 +13:00
tractatus-config.json feat: ACTIVATE Tractatus Governance Framework 🤖 2025-10-07 09:22:05 +13:00