🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

Token Alert

by @r00tid

Monitors Clawdbot session token usage and sends alerts at 25%, 50%, 75%, 90%, 95%, and 100% thresholds with a dashboard and Telegram notifications.

Versionv1.2.0
Downloads2,706
TERMINAL
clawhub install token-alert

πŸ“– About This Skill

Token Alert Skill

🚨 Monitor session tokens and get alerts at 75%/90%/95%

Overview

The Token Alert Skill automatically monitors your Clawdbot session token usage and sends alerts when you approach limits. Never lose context mid-conversation again!

Features

  • βœ… 6-Level Threshold System - Alerts at 25%, 50%, 75%, 90%, 95%, 100%
  • βœ… Material Design Progress Bar - Box-style (β–°/β–±) with color gradients
  • βœ… Rich UI Dashboard - Interactive HTML dashboard with animations
  • βœ… Session Status - Shows current token usage on demand
  • βœ… Telegram Alerts - Get notified before hitting limits
  • βœ… HEARTBEAT Integration - Optional automated checks
  • βœ… Stateless - No state file needed, calculates on-demand
  • βœ… Session Estimates - Predicts remaining sessions (~50k avg)
  • Usage

    Interactive Dashboard

    Ask Grym:

  • "Show token dashboard"
  • "Open dashboard"
  • Or run directly:

    python3 ~/clawd/skills/token-alert/scripts/show_dashboard.py
    

    Terminal Check

    Ask Grym:

  • "Wie viele Tokens habe ich noch ΓΌbrig?"
  • "Check token status"
  • "Token usage?"
  • Or run:

    python3 ~/clawd/skills/token-alert/scripts/check.py
    

    Automatic Alerts

    Grym will automatically alert you when:

  • 🟑 25% - Low warning (~150k tokens left)
  • 🟠 50% - Medium warning (~100k tokens left)
  • πŸ”Ά 75% - High warning (~50k tokens left)
  • πŸ”΄ 90% - Critical warning (~20k tokens left)
  • 🚨 95% - Emergency! (<10k tokens left)
  • Example Output

    πŸ”Ά Token Alert: Achtung!

    πŸ”Ά β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–±β–±β–±β–±β–±β–± 78.0% 156,000 / 200,000 Tokens verwendet

    ⚠️ Status: High Warning (Rot-Orange Zone) πŸ’‘ Verbleibend: ~44k Tokens ⏰ GeschΓ€tzte Sessions: <1 Session

    πŸ”§ Empfehlung: βœ… Wichtige Entscheidungen jetzt treffen βœ… Neue Session vorbereiten βœ… Token-sparend arbeiten

    Installation

    # Via ClawdHub
    clawdhub install token-alert

    Manual

    cd ~/clawd/skills git clone https://github.com/r00tid/clawdbot-token-alert token-alert

    Configuration

    HEARTBEAT Integration (Optional)

    Add to ~/clawd/HEARTBEAT.md:

    ### Token Usage Check (tΓ€glich)
    
  • [ ] python3 ~/clawd/skills/token-alert/scripts/check.py
  • Warning ab 70%: "⚠️ Session bei XX% - Token-Sparend ab jetzt!"
  • How It Works

    1. Uses Clawdbot's session_status tool 2. Calculates percentage of token usage 3. Compares against thresholds (75%, 90%, 95%) 4. Sends Telegram alert if threshold crossed

    Technical Details

    Files

    skills/token-alert/
    β”œβ”€β”€ SKILL.md                    # This file
    β”œβ”€β”€ README.md                   # GitHub documentation
    β”œβ”€β”€ LICENSE                     # MIT License
    β”œβ”€β”€ .clawdhub/
    β”‚   └── manifest.json           # ClawdHub metadata
    β”œβ”€β”€ assets/
    β”‚   β”œβ”€β”€ dashboard-78-high.png   # Screenshot (High Warning)
    β”‚   └── dashboard-96-emergency.png  # Screenshot (Emergency)
    └── scripts/
        β”œβ”€β”€ check.py                # Token checker (Terminal)
        β”œβ”€β”€ dashboard.html          # Rich UI dashboard
        └── show_dashboard.py       # Dashboard launcher
    

    Dependencies

  • Python 3.8+
  • Clawdbot session_status tool
  • Optional: Telegram channel configured
  • Script API

    # scripts/check.py
    def get_session_tokens():
        """Get current session token usage via session_status tool"""
        
    def check_thresholds(percent):
        """Check if usage exceeds thresholds"""
        
    def format_alert(used, limit, percent, level):
        """Format alert message for Telegram"""
    

    When to Use

  • Before long tasks - Check if you have enough tokens
  • Mid-conversation - Monitor usage during long sessions
  • Daily check - Add to HEARTBEAT for automatic monitoring
  • Limitations

  • Only monitors session tokens (not Claude.ai API limits)
  • Requires active Clawdbot session
  • Alert frequency can be noisy if near threshold
  • Future Enhancements

  • [ ] Claude.ai API limits scraping (optional)
  • [ ] Historical token usage tracking
  • [ ] Weekly/monthly usage reports
  • [ ] Integration with token-router skill
  • Support

  • GitHub Issues: https://github.com/r00tid/clawdbot-token-alert/issues
  • ClawdHub: https://clawdhub.com/skills/token-alert
  • Docs: https://docs.clawd.bot
  • License

    MIT License - See LICENSE file


    Built with ❀️ by Grym πŸ₯œ

    ⚑ When to Use

    TriggerAction
    - **Mid-conversation** - Monitor usage during long sessions
    - **Daily check** - Add to HEARTBEAT for automatic monitoring

    πŸ’‘ Examples

    Interactive Dashboard

    Ask Grym:

  • "Show token dashboard"
  • "Open dashboard"
  • Or run directly:

    python3 ~/clawd/skills/token-alert/scripts/show_dashboard.py
    

    Terminal Check

    Ask Grym:

  • "Wie viele Tokens habe ich noch ΓΌbrig?"
  • "Check token status"
  • "Token usage?"
  • Or run:

    python3 ~/clawd/skills/token-alert/scripts/check.py
    

    Automatic Alerts

    Grym will automatically alert you when:

  • 🟑 25% - Low warning (~150k tokens left)
  • 🟠 50% - Medium warning (~100k tokens left)
  • πŸ”Ά 75% - High warning (~50k tokens left)
  • πŸ”΄ 90% - Critical warning (~20k tokens left)
  • 🚨 95% - Emergency! (<10k tokens left)
  • Example Output

    πŸ”Ά Token Alert: Achtung!

    πŸ”Ά β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–°β–±β–±β–±β–±β–±β–± 78.0% 156,000 / 200,000 Tokens verwendet

    ⚠️ Status: High Warning (Rot-Orange Zone) πŸ’‘ Verbleibend: ~44k Tokens ⏰ GeschΓ€tzte Sessions: <1 Session

    πŸ”§ Empfehlung: βœ… Wichtige Entscheidungen jetzt treffen βœ… Neue Session vorbereiten βœ… Token-sparend arbeiten

    βš™οΈ Configuration

    HEARTBEAT Integration (Optional)

    Add to ~/clawd/HEARTBEAT.md:

    ### Token Usage Check (tΓ€glich)
    
  • [ ] python3 ~/clawd/skills/token-alert/scripts/check.py
  • Warning ab 70%: "⚠️ Session bei XX% - Token-Sparend ab jetzt!"