openclaw 网盘下载
OpenClaw

技能详情(站内镜像,无评论)

首页 > 技能库 > Token Alert

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

通信与消息

许可证:MIT-0

MIT-0 ·免费使用、修改和重新分发。无需归因。

版本:v1.2.0

统计:⭐ 0 · 1.5k · 1 current installs · 1 all-time installs

0

安装量(当前) 1

🛡 VirusTotal :可疑 · OpenClaw :可疑

Package:token-alert

安全扫描(ClawHub)

  • VirusTotal :可疑
  • OpenClaw :可疑

OpenClaw 评估

The skill’s name and UI features match a token-alert purpose, but there are mismatches between what it documents (multi-provider tracking, Telegram alerts, auto-export, proxies) and what it declares (no required env/config), plus a few runtime behaviors (proxy, service-worker, auto-export, notification setup) that deserve manual review before use.

目的

The skill is legitimately a token-monitoring/dashboard tool and most files (check.py, dashboard, provider modules) fit that purpose. However, the repo contains multi-provider provider modules (OpenAI/Gemini/Anthropic) and Telegram/auto-export features while the skill metadata declares no required environment variables or primary credential — a mismatch. Those provider/notification features normally require API keys or tokens (or at least user-…

说明范围

SKILL.md instructs running Python scripts (check.py, show_dashboard.py) which is expected, but also suggests optional steps that expand scope: running setup-notifications.sh (installs notification tooling), starting a proxy-server.py (CORS proxy), and enabling auto-checks in HEARTBEAT.md. The auto-export behavior (triggers exportMemory() / summarize()) is described but the destination/mechanism of the export is not clearly documented — that co…

安装机制

There is no formal install spec (lowest-risk), but the project contains helper scripts that request installing third-party tooling (e.g., ImageMagick via brew, terminal-notifier via setup script) and a proxy server and launch scripts. Nothing in the manifest downloads arbitrary code at install time, but the optional setup scripts will install utilities and could create persistent agents if run.

证书

The codebase contains providers for Anthropic/OpenAI/Gemini and mentions Telegram alerts, which ordinarily require API keys or tokens. Yet requires.env is empty and no primary credential is declared. This asymmetry means API keys are likely collected via interactive setup or saved to config files (e.g., ~/.clawdbot/token-alert.json) rather than environment variables — acceptable but it increases risk if keys are stored insecurely. The skill al…

持久

The skill is not marked always:true and does not demand autonomous elevation. However, documentation and scripts mention optional persistent setups (macOS notifications, com.clawdbot.token-alert.plist LaunchAgent, periodic HEARTBEAT entries, proxy-server), so users can grant it persistent presence manually. That optional persistence combined with provider keys or auto-export increases blast radius if misused, but persistence is not forced by t…

安装(复制给龙虾 AI)

将下方整段复制到龙虾中文库对话中,由龙虾按 SKILL.md 完成安装。

请把本段交给龙虾中文库(龙虾 AI)执行:为本机安装 OpenClaw 技能「Token Alert」。简介:Monitors Clawdbot session token usage and sends alerts at 25%, 50%, 75%, 90%, 9…。
请 fetch 以下地址读取 SKILL.md 并按文档完成安装:https://raw.githubusercontent.com/openclaw/skills/refs/heads/main/skills/r00tid/token-alert/SKILL.md
(来源:yingzhi8.cn 技能库)

SKILL.md

打开原始 SKILL.md(GitHub raw)

# 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:
```bash
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:
```bash
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

```bash
# 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`:

```markdown
### 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

```python
# 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 🥜