Skip to content
Back to skills

Usage Tracker

ASecurity

Track and analyze usage metrics with timestamped logging, reporting,

  • 17 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 9, 2026
devopsgobash

Works with

  • cli

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add vamseeachanta/workspace-hub --skill usage-tracker --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Usage Tracker?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Usage Tracker
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vamseeachanta-usage-tracker/badge)](https://www.skillsdirectory.com/skills/vamseeachanta-usage-tracker)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: usage-tracker
version: 1.0.0
description: Track and analyze usage metrics with timestamped logging, reporting,
  and trend detection
author: workspace-hub
category: _core
tags:
- bash
- metrics
- logging
- analytics
- tracking
- reporting
platforms:
- linux
- macos
see_also:
- usage-tracker-1-basic-usage-logging
- usage-tracker-3-usage-summary-reports
- usage-tracker-5-trend-analysis
- usage-tracker-best-practices
---

# Usage Tracker

## When to Use This Skill

✅ **Use when:**
- Need to track tool/resource usage over time
- Generating usage reports (daily, weekly, monthly)
- Monitoring quotas or limits
- Analyzing usage patterns
- Building dashboards

❌ **Avoid when:**
- Real-time metrics (use proper monitoring tools)
- High-frequency events (>100/second)
- Sensitive data without encryption

## Summary

$(generate_summary "$period" | sed 's/\x1b\[[0-9;]*m//g')

## Daily Breakdown

| Date | Opus | Sonnet | Haiku | Total |
|------|------|--------|-------|-------|
EOF

    for i in $(seq 6 -1 0); do
        local date=$(date -d "$i days ago" +%Y-%m-%d)
        local opus=$(grep "$date" "$USAGE_LOG" | grep "|opus|" | wc -l)
        local sonnet=$(grep "$date" "$USAGE_LOG" | grep "|sonnet|" | wc -l)
        local haiku=$(grep "$date" "$USAGE_LOG" | grep "|haiku|" | wc -l)
        local total=$((opus + sonnet + haiku))

        echo "| $date | $opus | $sonnet | $haiku | $total |" >> "$output"
    done

    cat >> "$output" << EOF

## Recommendations

Based on current usage patterns:
$(generate_recommendations)

---
Generated: $(date)
EOF

    echo "Report generated: $output"
}
```

## Complete Example: Usage Monitor CLI

```bash
#!/bin/bash
# ABOUTME: Complete usage monitoring CLI tool
# ABOUTME: Track, analyze, and report on usage metrics

set -e

# ─────────────────────────────────────────────────────────────────
# Configuration
# ─────────────────────────────────────────────────────────────────

SCRIPT_NAME="usage-monitor"
USAGE_DIR="${HOME}/.${SCRIPT_NAME}"
USAGE_LOG="$USAGE_DIR/usage.log"

# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
CYAN='\033[0;36m'
NC='\033[0m'

# ─────────────────────────────────────────────────────────────────
# Core Functions

*See sub-skills for full details.*

## Resources

- [awk One-Liners](https://catonmat.net/awk-one-liners-explained-part-one)
- [sed/awk Tutorial](https://www.grymoire.com/Unix/Awk.html)
- [Date Manipulation in Bash](https://www.cyberciti.biz/faq/linux-unix-formatting-dates-for-display/)

---

## Version History

- **1.0.0** (2026-01-14): Initial release - extracted from workspace-hub check_claude_usage.sh

## Sub-Skills

- [1. Basic Usage Logging (+1)](1-basic-usage-logging/SKILL.md)
- [3. Usage Summary Reports (+1)](3-usage-summary-reports/SKILL.md)
- [5. Trend Analysis (+1)](5-trend-analysis/SKILL.md)
- [Best Practices](best-practices/SKILL.md)

Files in this skill

  • 1-basic-usage-logging/SKILL.md2.7 KB
  • 3-usage-summary-reports/SKILL.md4.5 KB
  • 5-trend-analysis/SKILL.md3.5 KB
  • SKILL.md3.2 KB
  • best-practices/SKILL.md479 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.