usage-tracker-1-basic-usage-logging
Sub-skill of usage-tracker: 1. Basic Usage Logging (+1).
Best use case
usage-tracker-1-basic-usage-logging is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Sub-skill of usage-tracker: 1. Basic Usage Logging (+1).
Teams using usage-tracker-1-basic-usage-logging should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/1-basic-usage-logging/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How usage-tracker-1-basic-usage-logging Compares
| Feature / Agent | usage-tracker-1-basic-usage-logging | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Sub-skill of usage-tracker: 1. Basic Usage Logging (+1).
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# 1. Basic Usage Logging (+1)
## 1. Basic Usage Logging
Pipe-delimited log format for easy parsing:
```bash
#!/bin/bash
# ABOUTME: Basic usage tracking with timestamped logs
# ABOUTME: Pattern from workspace-hub check_claude_usage.sh
# Configuration
USAGE_LOG="${HOME}/.workspace-hub/usage.log"
USAGE_DIR="$(dirname "$USAGE_LOG")"
# Ensure directory exists
mkdir -p "$USAGE_DIR"
# Initialize log if needed
if [[ ! -f "$USAGE_LOG" ]]; then
cat > "$USAGE_LOG" << EOF
# Usage Log
# Format: TIMESTAMP|CATEGORY|ITEM|VALUE|METADATA
# Created: $(date)
EOF
fi
# Log a usage event
log_usage() {
local category="$1"
local item="$2"
local value="${3:-1}"
local metadata="${4:-}"
local timestamp=$(date '+%Y-%m-%d_%H:%M:%S')
echo "${timestamp}|${category}|${item}|${value}|${metadata}" >> "$USAGE_LOG"
}
# Examples
log_usage "model" "opus" "1" "task:architecture"
log_usage "model" "sonnet" "1" "task:implementation"
log_usage "api" "requests" "100" "endpoint:/data"
log_usage "tokens" "input" "2500" "model:opus"
```
## 2. Usage Aggregation
Aggregate usage by time period:
```bash
#!/bin/bash
# ABOUTME: Usage aggregation functions
# ABOUTME: Summarize by day, week, month
# Get usage for a specific period
get_usage_period() {
local period="$1" # today, week, month
local category="${2:-}"
local filter_date
case "$period" in
today)
filter_date=$(date +%Y-%m-%d)
;;
week)
filter_date=$(date -d '7 days ago' +%Y-%m-%d)
;;
month)
filter_date=$(date -d '30 days ago' +%Y-%m-%d)
;;
*)
filter_date=$(date +%Y-%m-%d)
;;
esac
if [[ -n "$category" ]]; then
grep "$filter_date" "$USAGE_LOG" 2>/dev/null | grep "|${category}|" || true
else
grep "$filter_date" "$USAGE_LOG" 2>/dev/null || true
fi
}
# Count usage by category
count_by_category() {
local period="$1"
get_usage_period "$period" | \
awk -F'|' '{count[$2]+=$4} END {for (c in count) print c, count[c]}' | \
sort -k2 -nr
}
# Count usage by item within category
count_by_item() {
local period="$1"
local category="$2"
get_usage_period "$period" "$category" | \
awk -F'|' '{count[$3]+=$4} END {for (i in count) print i, count[i]}' | \
sort -k2 -nr
}
# Get total usage
get_total() {
local period="$1"
local category="${2:-}"
get_usage_period "$period" "$category" | \
awk -F'|' '{sum+=$4} END {print sum+0}'
}
```Related Skills
github-issue-tracker
Intelligent issue management and project coordination with automated tracking, progress monitoring, and team coordination. Use for issue creation with smart templates, progress tracking with swarm coordination, multi-agent collaboration, and cross-repository synchronization.
usage-optimization
Optimize AI usage efficiency through script-first patterns, batch operations, and input preparation
agent-usage-optimizer
Reads quota state and recommends optimal Codex/Codex/Gemini allocation per task
mkdocs-basic-code-block
Sub-skill of mkdocs: Basic Code Block.
web-artifacts-builder-basic-template
Sub-skill of web-artifacts-builder: Basic Template.
skill-creator-advanced-usage
Sub-skill of skill-creator: Advanced Usage.
usage-tracker-5-trend-analysis
Sub-skill of usage-tracker: 5. Trend Analysis (+1).
usage-tracker-3-usage-summary-reports
Sub-skill of usage-tracker: 3. Usage Summary Reports (+1).
parallel-batch-executor-1-basic-parallel-execution-with-xargs
Parallel batch processing with xargs. Use when running commands concurrently over a list of items with controlled parallelism.
interactive-menu-builder-1-basic-menu-structure
Sub-skill of interactive-menu-builder: 1. Basic Menu Structure.
docker-1-basic-dockerfile-patterns
Sub-skill of docker: 1. Basic Dockerfile Patterns.
github-actions-1-basic-workflow-structure
Sub-skill of github-actions: 1. Basic Workflow Structure.