RCP-001-001-005-TOKEN-MONITOR – Intelligent Token Usage Monitor with Weighted Tracking and Velocity


Requirements
How To Start
- After hundreds (perhaps thousands) of hours of using these recipes, I rarely need to use any of the CORE Cookbook recipes aside from Recipes RCP-001-001-002-HANDOFF-SNAPSHOT and RCP-001-001-002-HANDOFF-SNAPSHOT, but when I do, they are essential to the functioning of CRAFT. Also, the A.I. reads all of these recipes at the start of each session. This happens quietly in the background. Even though you may never need to call the recipe, the A.I. will know all of them and it helps the A.I. to understand what CRAFT is and how it works. Even if you rarely need to use these recipes, they are still working for you and are essential to the CRAFT Framework.
- This recipe operates in three modes: AUTOMATIC: Silent monitoring with threshold warnings ON_DEMAND: User-requested status report BEFORE_TASK: Capacity check before large tasks
- Different content types consume tokens at different rates: CONTENT TYPE WEIGHTS: – Simple exchanges (Q&A): 1x weight – Code blocks: 2x weight – Test results/detailed outputs: 3x weight – Tables/structured data: 2.5x weight – Long analyses/reports: 3x weight CALCULATION: Weighted_Tokens = Sum(Content_Units x Weight x Base)
- The recipe uses these warning thresholds: TYPICAL CHAT LIMIT: ~100,000 tokens 75% THRESHOLD: ~75,000 tokens (plan handoff) 85% THRESHOLD: ~85,000 tokens (execute handoff)
- Track token consumption rate for predictions: VELOCITY METRICS: – Tokens used in last 5 exchanges – Average tokens per exchange – Acceleration pattern (increasing/steady/decreasing) PREDICTION FORMULA: Exchanges until 85% = (85 – current%) / (velocity / 1000)
- In automatic mode, the AI monitors silently and alerts: AT 85% (MAXIMUM WARNING): #AI->H::Caution: (~85% token limit reached) #AI->H::Status: (Handoff recommended immediately) #AI->H::Note: (At current velocity: ~X exchanges left) AT 75% (PLANNING WARNING): #AI->H::Note: (~75% token limit reached) #AI->H::Status: (Plan for handoff soon) #AI->H::Note: (At current velocity: ~X to 85%) BELOW 75%: No warning (silent operation)
- When you ask about token status: #AI->H::Note: (Token usage: ~X% of typical limit) #AI->H::Note: (Velocity: ~Y tokens/exchange) #AI->H::Note: (Estimated exchanges remaining: ~Z) STATUS GUIDANCE: – Below 75%: Continue normally – 75-85%: Prepare handoff – At 85%: Execute handoff now
- Before large tasks, estimate capacity: TASK ESTIMATES: – Develop recipe: ~5% of limit – Comprehensive analysis: ~10% of limit – Multiple test cases: ~15% of limit – Full documentation: ~10% of limit IF current + task > 75%: #AI->H::Caution: (~X% used, task needs ~Y%) #AI->H::RecommendedChange: (Handoff before starting)
When to Use This Recipe
Recipe FAQ
A: Estimates are approximate. The weighted system provides
better accuracy than raw counts but is not exact. Q: Why two warning thresholds?
A: 75% gives time to plan and wrap up naturally. 85% is
the maximum warning – handoff should happen immediately. Q: What is velocity tracking?
A: Velocity measures how fast tokens are being consumed.
Accelerating velocity means less time remaining. Q: Can I ask for token status anytime?
A: Yes, use on_demand mode or ask “How much token capacity
do we have left?” to trigger a status report.
