331ā
by c-drew
telegram-usage ā OpenClaw Skill
telegram-usage is an OpenClaw Skills integration for ai ml workflows. Display session usage statistics (quota, session time, tokens, context)
Skill Snapshot
| name | telegram-usage |
| description | Display session usage statistics (quota, session time, tokens, context) OpenClaw Skills integration. |
| owner | c-drew |
| repository | c-drew/telegram-usage |
| language | Markdown |
| license | MIT |
| topics | |
| security | L1 |
| install | openclaw add @c-drew/telegram-usage |
| last updated | Feb 7, 2026 |
Maintainer

name: telegram-usage description: Display session usage statistics (quota, session time, tokens, context) metadata: {"clawdbot":{"emoji":"š","requires":{"bins":["node"]}}}
Telegram Usage Stats
Display comprehensive session usage statistics by running the handler script.
What it does
Shows a quick status message with:
- Quota Remaining: Percentage of API quota left with visual indicator
- Reset Timer: Time remaining until quota resets
How to use this skill
When the user asks for usage statistics, quota info, or session data:
node /home/drew-server/clawd/skills/telegram-usage/handler.js
This will output formatted HTML suitable for Telegram's parseMode.
Output Format
The response is formatted as a clean Telegram message with:
- Section headers (bold)
- Clear percentages and time remaining
- Visual indicators (emoji)
- All in one message for quick reference
Example Output
š API Usage
š Quota: š¢ 47%
ā±ļø Resets in: 53m
Notes
- Pulls real-time data from
clawdbot models status - Updates on each invocation with current API quota values
- Uses plain text formatting for Telegram compatibility
Telegram Usage Command Skill
A custom Telegram command that displays comprehensive session usage statistics in a clean, formatted message.
Features
ā
Quota Remaining - Shows percentage of API quota left (provider-specific)
ā
Session Time - Displays time remaining before session resets
ā
Token Usage - Shows input and output tokens used in session
ā
Context Window - Displays current context window usage
ā
Visual Indicators - Color-coded emoji for quick status check
ā
Single Message - All info in one clean Telegram message
Installation
Option 1: Automatic (via ClawdHub)
clawdhub install telegram-usage
Option 2: Manual (Already in workspace)
The skill is located at /skills/telegram-usage in your Clawdbot workspace.
Setup
1. Enable the Skill
Ensure the skill is enabled in ~/.clawdbot/clawdbot.json:
{
"skills": {
"entries": {
"telegram-usage": {
"enabled": true
}
}
}
}
2. Add Custom Command to Telegram (Optional)
Register the command in Telegram's bot menu via config:
{
"channels": {
"telegram": {
"customCommands": [
{
"command": "usage",
"description": "Show session usage stats"
}
]
}
}
}
3. Restart Gateway
clawdbot gateway restart
Or if running manually:
clawdbot gateway
Usage
In Telegram
Send any of these:
/telegram_usage
/usage (if custom command registered)
/skill telegram-usage
Output Example
š Session Usage Report
š Quota Remaining
š¢ 82% of API quota available
Provider: anthropic
ā±ļø Session Time
3 hours 40 minutes remaining
(resets daily at 4:00 AM)
šÆ Tokens Used
4,370 total tokens
āā Input: 2,847
āā Output: 1,523
š¦ Context Window
š¢ 45% used
1,856 / 4,096 tokens
Model: Claude 3.5 Haiku
Configuration
No additional configuration required. The skill reads from Clawdbot's session state automatically.
Optional: Adjust Reset Time
The default session reset is 4:00 AM. Configure in ~/.clawdbot/clawdbot.json:
{
"session": {
"reset": {
"mode": "daily",
"atHour": 4
}
}
}
Color Indicators
- š¢ Green ā Good (75%+ remaining)
- š” Yellow ā Warning (50-75% remaining)
- š Orange ā Low (25-50% remaining)
- š“ Red ā Critical (<25% remaining)
How It Works
- Runs as a skill ā Loads via Clawdbot's skill system
- Uses session data ā Reads from current session store
- Formats with HTML ā Telegram-safe HTML formatting (bold, code blocks)
- Single message ā Returns all info in one Telegram message
- Real-time ā Updates on each invocation with current values
Files Included
SKILL.mdā Skill metadata and AgentSkills manifesthandler.jsā Node.js handler for formatting usage dataREADME.mdā This fileconfig-example.jsonā Example configuration
Testing
Manual Test (CLI)
node /home/drew-server/clawd/skills/telegram-usage/handler.js
Expected output: Formatted usage report in HTML
JSON Output
node /home/drew-server/clawd/skills/telegram-usage/handler.js json
Expected output: Raw statistics as JSON
In Telegram
- Send
/usagein any DM with the bot - Expect a formatted message with current stats
- Repeat to see updated values
Troubleshooting
Command not appearing in Telegram
- Make sure the skill is enabled:
clawdbot config get skills.entries.telegram-usage.enabled - Restart the gateway:
clawdbot gateway restart - Check logs:
clawdbot logs --follow
Stats show zero/wrong values
- The skill reads from your current session state
- Start a new session with
/newand try again - Verify session file exists:
~/.clawdbot/agents/main/sessions/sessions.json
HTML formatting looks wrong
- Telegram has limited HTML support
- The skill uses safe tags:
<b>,<i>,<code> - If Telegram rejects it, check gateway logs
Technical Details
Quota Source
The quota percentage comes from:
- Current provider's usage tracking (if enabled)
- Defaults to 85% if no tracking available
- Can be customized per provider
Session Time
- Resets daily at configured time (default 4:00 AM local)
- Shows time until next reset
- Can be overridden with
/resetor/newcommands
Tokens
- Input tokens: Counted from the assistant's input context
- Output tokens: Counted from the assistant's responses
- Total: Sum of input + output for the current session
Context Usage
- Shows current position in context window
- Updates as conversation grows
- Includes messages, files, tools, and system prompts
Limitations
- DMs only ā Groups show session-specific stats but structure is the same
- Session-based ā Stats reset when session resets (daily or on explicit
/reset) - Approximate ā Percentages are rounded to nearest whole number
- Provider-dependent ā Quota details vary by API provider (Anthropic, OpenAI, etc.)
Future Enhancements
Potential improvements:
- Graph visualization (text-based)
- Historical tracking across sessions
- Cost estimation per provider
- Token burn rate (tokens/minute)
- Context compression recommendations
- Quota alerts when low
License
This skill is part of the Clawdbot project.
Support
- Docs: https://docs.clawd.bot/tools/skills
- Issues: Check Clawdbot GitHub
- Questions: See
/helpin Telegram
Permissions & Security
Security level L1: Low-risk skills with minimal permissions. Review inputs and outputs before running in production.
Requirements
- OpenClaw CLI installed and configured.
- Language: Markdown
- License: MIT
- Topics:
FAQ
How do I install telegram-usage?
Run openclaw add @c-drew/telegram-usage in your terminal. This installs telegram-usage into your OpenClaw Skills catalog.
Does this skill run locally or in the cloud?
OpenClaw Skills execute locally by default. Review the SKILL.md and permissions before running any skill.
Where can I verify the source code?
The source repository is available at https://github.com/openclaw/skills/tree/main/skills/c-drew/telegram-usage. Review commits and README documentation before installing.
