← ClaudeAtlas

cc-lenslisted

Token usage intelligence for Claude Code via the cc-lens dashboard (http://localhost:3001). Four operations: SETUP (install & start), ANALYZE (full top-N workflow with forensics report), PROJECT (deep dive into one project), FORENSICS (single-session replay analysis). Generates self-contained HTML reports with Chart.js visualizations, waste classification, and actionable optimization recommendations. Loads /token-efficiency for industry-standard waste taxonomy, scoring thresholds, and optimization playbook. Trigger on: "analyze token usage", "token report", "what's burning tokens", "cc-lens", "session forensics", "why is [project] so expensive", "optimize token usage", "setup cc-lens", "start the dashboard", "top projects by cost", "session outliers".
anhermon/claude-public · ★ 0 · AI & Automation · score 76
Install: claude install-skill anhermon/claude-public
# cc-lens Token usage intelligence for Claude Code. Reads from `~/.claude/` via the cc-lens dashboard API (`http://localhost:3001`) and generates forensics reports with waste classification and actionable optimization recommendations. --- ## Dashboard URL `npx cc-lens` may bind to **any free port** (often **3001**). The bundled analyzer auto-discovers `http://localhost:3001`–`3010` for `/api/stats`, or use **`CC_LENS_BASE_URL`**. If you see a **blank page on :3002**, a server is usually already running on **:3001** — use that URL; do not start a second cc-lens. --- ## Operation: SETUP **Triggered by:** "setup cc-lens", "install cc-lens", "start the dashboard", "launch cc-lens" ### Steps 1. **Check if already running:** ```bash curl -s http://localhost:3001/api/stats > /dev/null 2>&1 && echo "running" || echo "not running" ``` 2. **If not running — start it** (either works): ```bash context-os cc-lens up # or: npx --yes cc-lens@latest & sleep 3 curl -s http://localhost:3001/api/stats > /dev/null 2>&1 && echo "Dashboard live at http://localhost:3001" || echo "Still starting..." ``` 3. **Verify and report:** ```bash curl -s http://localhost:3001/api/stats | python3 -c " import json, sys d = json.load(sys.stdin) print(f'Sessions indexed: {d.get(\"total_sessions\", d.get(\"session_count\", \"?\"))}') print(f'Total cost tracked: \${d.get(\"total_cost\", 0):.2f}') " ``` 4. Tell the user the dashboard is live and offer to