← ClaudeAtlas

usage-startlisted

새 작업의 사용량 추적을 시작합니다. 현재 세션을 기록하고 프로젝트+브랜치를 자동 등록합니다. 트리거 "사용량 추적", "추적 시작", "usage-start".
idean3885/claude-ops-agent · ★ 1 · AI & Automation · score 57
Install: claude install-skill idean3885/claude-ops-agent
# usage:start Start tracking token usage for a new task. ## Trigger - "usage start {label}" - "usage tracking {label}" - "작업 추적 시작 {label}" ## Parameters - **label** (required): Human-readable task name (e.g., "GPU Live 프로젝트 CRUD 정책서") - **approach** (optional): Method being used (e.g., "manual", "workflow-runner", "autopilot"). Default: "manual" - **tags** (optional): Comma-separated tags for grouping (e.g., "spec,planning") ## Procedure ### 1. Detect current context ```bash # Get absolute cwd (worktree path is preserved here — required for cwd-based aggregation) CWD=$(pwd) # Path-encoded project key (legacy ccusage matching fallback) PROJECT_PATH=$(echo "$CWD" | sed "s|$HOME/||" | sed 's|/|-|g' | sed 's|^|-|') # Most recent session JSONL — Claude Code stores traces under the parent project dir, # not under the worktree path. cwd-based aggregation does not depend on this lookup, # but it is kept for ccusage fallback. SESSION_ID=$(ls -t ~/.claude/projects/${PROJECT_PATH}/*.jsonl 2>/dev/null | head -1 | xargs basename 2>/dev/null | sed 's/.jsonl//') # Get current git branch (if git project) GIT_BRANCH=$(git branch --show-current 2>/dev/null || echo "none") ``` ### 2. Read or create tasks.json ```bash TRACKER_DIR="$HOME/.claude/usage-tracker" mkdir -p "$TRACKER_DIR/reports" cat "$TRACKER_DIR/tasks.json" 2>/dev/null || echo '{"tasks":{}}' ``` ### 3. Generate task ID Create a short, URL-safe ID from the label: - Lowercase, replace spaces with hyphens - Max 30 chars