cc-lenslisted
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