RTK Savings Dashboard
Daily trend
Tokens saved by command
Top 10 — a hard cap in the tool itself, not a display choice.
\")\nopen(\"brief.html\", \"w\").write(html)\nC = \"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\"\nprof = tempfile.mkdtemp()\nbase = [C, \"--headless=new\", \"--disable-gpu\", \"--hide-scrollbars\", f\"--user-data-dir={prof}\", \"--no-first-run\"]\nt = time.time()\ndom = subprocess.run(base + [\"--window-size=430,200\", \"--virtual-time-budget=2000\", \"--dump-dom\", \"file://\" + __import__(\"os\").path.abspath(\"brief.html\")], capture_output=True, text=True, timeout=60).stdout\nh = int(re.search(r\"
H(\\d+)\", dom)[1]); print(\"height\", h, round(time.time()-t,1), \"s\")\nt = time.time()\nr = subprocess.run(base + [\"--force-device-scale-factor=3\", f\"--window-size=430,{h}\", \"--virtual-time-budget=2000\", \"--screenshot=\" + __import__(\"os\").path.abspath(\"brief.png\"), \"file://\" + __import__(\"os\").path.abspath(\"brief.html\")], capture_output=True, text=True, timeout=60)\nprint(r.returncode, round(time.time()-t,1), \"s\"); print(r.stderr[-300:])\nEOF\n/usr/bin/python3 proto.py; sips -g pixelWidth -g pixelHeight brief.png; ls -la brief.png"}, {"base_command": "mdls", "count": 2, "example": "mdls -name kMDItemIsScreenCapture \"Screenshot 2026-09-23 at 12.12.02.png\""}, {"base_command": "git restore", "count": 2, "example": "git restore --staged shortcuts/__pycache__"}, {"base_command": "-m1 '^DERIVED='", "count": 2, "example": "D=$(grep -m1 '^DERIVED=' ~/Projects/Iphone-Widgets/resign.sh"}, {"base_command": "command", "count": 2, "example": "command -v docker"}, {"base_command": "t=$(pbpaste", "count": 2, "example": "t=$(pbpaste"}, {"base_command": "sharecheck", "count": 2, "example": "S=/private/tmp/claude-501/-Users-jd9hall/28fcd8c7-e827-45e7-b61c-d4afe9adbdd8/scratchpad/sharecheck"}, {"base_command": "( umask", "count": 2, "example": "( umask 077"}, {"base_command": "build.sh", "count": 2, "example": "./build.sh --install 2>&1"}, {"base_command": "wid.swift", "count": 2, "example": "W=$(swift wid.swift 2>/dev/null"}, {"base_command": "-n \"export", "count": 2, "example": "T=/private/tmp/claude-501/bundled-skills/2.1.302/36d2061eaecb9c330d6a2466d11fbf1a/plugin-authoring/types/claude-code.d.ts; L=$(grep -n \"export type PromptOrigin\" $T | cut -d: -f1); sed -n \"$((L+50)),$((L+95))p\" $T | rtk proxy grep -n -B3 -A12 \"kind: 'plugin'\""}, {"base_command": "Developer", "count": 2, "example": "X=/Applications/Xcode-beta.app/Contents/Developer"}, {"base_command": "notify.sh hi", "count": 2, "example": "NTFY_TOPIC=x NTFY_SERVER=http://127.0.0.1:9 ./notify.sh hi"}, {"base_command": "exit 1", "count": 2, "example": "exit 1\nopen -a \"Microsoft PowerPoint\" \"$D/CSCUpdate10_15_26_Foundry.pptx\"\nfor i in $(seq 1 15)"}, {"base_command": "sleep 4", "count": 2, "example": "/bin/sleep 4"}, {"base_command": "Update 10-15-26\"", "count": 2, "example": "D=\"$HOME/Projects/jd/CSC Update 10-15-26\""}, {"base_command": "launchctl unload", "count": 2, "example": "launchctl unload $P"}, {"base_command": "watch-profile.sh", "count": 2, "example": "./watch-profile.sh --dry-run"}, {"base_command": "timeout 180", "count": 2, "example": "timeout 180 claude update &1"}, {"base_command": "bun", "count": 2, "example": "bun --version"}, {"base_command": "sysctl", "count": 2, "example": "sysctl -n kern.boottime"}, {"base_command": "[ \"$(git", "count": 2, "example": "[ \"$(git -C \"$d\" rev-parse --show-toplevel 2>/dev/null)\" = \"$PWD/$d\" ]"}, {"base_command": "f=dd47eb9b-a446-46c2-bab0-cc61658c7ef7.jsonl", "count": 2, "example": "f=dd47eb9b-a446-46c2-bab0-cc61658c7ef7.jsonl"}, {"base_command": "timeout 100", "count": 2, "example": "timeout 100 node /private/tmp/claude-501/-Users-jd9hall/1b56ad43-9eed-446f-9ab0-b3f6e8bf6310/scratchpad/prop.mjs"}, {"base_command": "ghostty", "count": 2, "example": "/Applications/Ghostty.app/Contents/MacOS/ghostty --version 2>&1"}, {"base_command": "sleep 1", "count": 2, "example": "/bin/sleep 1\n~/Projects/energy/.venv/bin/python -I $S/build_foundry.py \"$D/CSCUpdate10_15_26.pptx\" \"$D/CSCUpdate10_15_26_Foundry.pptx\""}, {"base_command": "done 2>&1", "count": 2, "example": "done 2>&1"}, {"base_command": "62c82f39-68e1-4193-a371-3a79f80b4d6d_72d0c793-a627-4d4d-a78d-5c3c1b5f79a6", "count": 2, "example": "D=~/.claude/skills/synced/62c82f39-68e1-4193-a371-3a79f80b4d6d_72d0c793-a627-4d4d-a78d-5c3c1b5f79a6"}, {"base_command": "-c \"import", "count": 2, "example": "P=$(python3 -c \"import plistlib;print(plistlib.load(open('nt.plist','rb'))['WFWorkflowActions'][0]['WFWorkflowActionParameters']['WFTextActionText'])\")"}, {"base_command": "+%Y%m%d).log; n0=$(wc", "count": 2, "example": "L=~/Projects/gmail-warehouse/data/logs/sync-$(date +%Y%m%d).log; n0=$(wc -l < \"$L\"); launchctl kickstart gui/$(id -u)/com.justin.gmailwarehouse.sync && echo kicked; for i in $(seq 1 120); do tail -n +$((n0+1)) \"$L\" | grep -qE \"=== run done|ERROR: sync failed\" && break; sleep 10; done; tail -n +$((n0+1)) \"$L\" | grep -E \"run start|ok|done|ERROR|ALERT|failed|invalid\" | cut -c1-150 | tail -12"}, {"base_command": "npm init", "count": 2, "example": "npm init -y"}, {"base_command": "f=$(grep", "count": 2, "example": "f=$(grep -rlE 'run_local_server|InstalledAppFlow' src"}, {"base_command": "PUNCH_TOKEN", "count": 2, "example": "PUNCH_TOKEN=$(grep PUNCH_TOKEN .dev.vars"}, {"base_command": "capture_token", "count": 2, "example": "f=/private/tmp/claude-501/-Users-jd9hall/f3c33310-2366-4930-a1ed-22c5b791d198/scratchpad/capture_token"}, {"base_command": "ioreg", "count": 2, "example": "ioreg -p IOUSB -w0"}, {"base_command": "# Split", "count": 2, "example": "# Split conditions from the generated SQL into separate chunk files\nawk '\n/^INSERT INTO public.conditions/ {\n if (file != \"\") close(file);\n chunk_num++;\n file = sprintf(\"/tmp/conditions_chunk_v2_%d.sql\", chunk_num - 1);\n print \"INSERT INTO public.conditions (fhir_id, data_source, name, category, onset_date, recorded_date, clinical_status, verification_status)\" > file;\n print \"VALUES\" > file;\n next;\n}\nfile != \"\" && /^ON CONFLICT/ {\n print >> file;\n close(file);\n file = \"\";\n next;\n}\nfile != \"\" {\n print >> file;\n}\n' /tmp/f_inserts.sql\n\n# Verify chunk files were created\nls -1 /tmp/conditions_chunk_v2_*.sql"}, {"base_command": "r=$(git", "count": 2, "example": "r=$(git -C \"$d\" remote get-url origin 2>/dev/null"}, {"base_command": "open \"Health", "count": 2, "example": "open \"Health Pull v2.shortcut\""}, {"base_command": "npm ls", "count": 2, "example": "npm ls -g --depth=0 2>/dev/null"}, {"base_command": "(timeout 60", "count": 2, "example": "(timeout 60 npx wrangler tail --format json > /private/tmp/claude-501/-Users-jd9hall/1b56ad43-9eed-446f-9ab0-b3f6e8bf6310/scratchpad/tail.json 2>/dev/null &)"}, {"base_command": "mdfind \"kMDItemCFBundleIdentifier", "count": 2, "example": "/usr/bin/mdfind \"kMDItemCFBundleIdentifier == 'eu.dennis-jordan.virtualdisplay*'\" 2>/dev/null"}, {"base_command": "-v tsc", "count": 1, "example": "TSC=$(command -v tsc"}, {"base_command": "synced", "count": 1, "example": "S=$(find ~/.claude/skills/synced -path '*wrap-up*' -name SKILL.md 2>/dev/null"}, {"base_command": "rmdir", "count": 1, "example": "rmdir ~/Projects/Iphone-Widgets/.profile-quarantine"}, {"base_command": "until launchctl", "count": 1, "example": "until launchctl print gui/$(id -u)/com.jd9hall.calendar-brief-test 2>/dev/null"}, {"base_command": "tail", "count": 1, "example": "tail -1 ~/Library/Logs/rtk-stats-push.log\n# failure path: temp copy pointed at a dead host, separate log\nT=/private/tmp/claude-501/-Users-jd9hall/0edbe788-cfb6-4acd-80b0-1f5265932ffa/scratchpad/push_test.sh\nsed -e 's#https://sports-proxy.jd9hall.workers.dev#https://nonexistent.invalid#' -e 's#rtk-stats-push.log#rtk-push-test.log#' -e 's#sleep 20#sleep 1#' -e \"s#HERE=.*#HERE=$HOME/Projects/my-team/scripts#\" $S > $T"}, {"base_command": "time node", "count": 1, "example": "time node --max-old-space-size=8192 --env-file=../supabase-dashboard/.env scripts/backfill.mjs ~/Downloads/export.zip --out /private/tmp/claude-501/-Users-jd9hall/1b56ad43-9eed-446f-9ab0-b3f6e8bf6310/scratchpad/backfill-preview.csv 2>&1"}, {"base_command": "n=$(grep", "count": 1, "example": "n=$(grep -n 'gmail-oauth-is-production.md' MEMORY.md"}, {"base_command": "{print $2}'", "count": 1, "example": "W=$(awk '/preview-window-number/{print $2}' $TMPDIR/mc.out)"}, {"base_command": "gather.sh newsfeed-app", "count": 1, "example": "LINES_PER=25 /private/tmp/claude-501/-Users-jd9hall/8e5dbc48-90c1-4612-8baa-65427fa02763/scratchpad/gather.sh newsfeed-app Notion personal-website Router-Table rtk-dashboard screenshot-filer 2>&1"}, {"base_command": "file \"$f\"", "count": 1, "example": "file \"$f\""}, {"base_command": "_deckcheck", "count": 1, "example": "OUT=~/Documents/_deckcheck"}, {"base_command": "gain", "count": 1, "example": "P=$(~/.local/bin/rtk gain -a --format json 2>/dev/null)"}, {"base_command": "shot desk-light", "count": 1, "example": "shot desk-light 1440,1000 light 1"}, {"base_command": "timeout 600", "count": 1, "example": "timeout 600 npx wrangler tail --format json > /private/tmp/claude-501/-Users-jd9hall/1b56ad43-9eed-446f-9ab0-b3f6e8bf6310/scratchpad/tail2.json 2>/dev/null"}, {"base_command": "-d", "count": 1, "example": "P=$(ls -d *.xcodeproj"}, {"base_command": "fi\n[", "count": 1, "example": "fi\n[ -f /tmp/.sbkey ]"}, {"base_command": "U=00008150-001825963E10C01C", "count": 1, "example": "U=00008150-001825963E10C01C"}, {"base_command": "xcode-select", "count": 1, "example": "xcode-select -p"}, {"base_command": "security find-identity", "count": 1, "example": "security find-identity -v -p codesigning 2>&1"}, {"base_command": "readlink", "count": 1, "example": "readlink ~/projects/gmail-warehouse"}, {"base_command": "until tail", "count": 1, "example": "until tail -1 ~/Projects/hub/logs/refresh.log"}, {"base_command": "IMG_1691.png\"", "count": 1, "example": "f=\"$D/IMG_1691.png\""}, {"base_command": "launchctl disable", "count": 1, "example": "launchctl disable gui/$(id -u)/com.jd9hall.punch-refresh"}, {"base_command": "\\\nls", "count": 1, "example": "\\\nls -lh health-report/scripts/build_deck.js files/build_deck.js files2/build_deck.js 2>/dev/null"}, {"base_command": "\\\ngrep", "count": 1, "example": "\\\ngrep -E \"'@[0-9]+'::timestamp\" /tmp/encounters.sql /tmp/medications.sql /tmp/conditions.sql /tmp/lab_results.sql 2>/dev/null"}, {"base_command": "git mv", "count": 1, "example": "git mv routines/evening-alarm.md routines/evening.md"}, {"base_command": "d=$(find", "count": 1, "example": "d=$(find ~/.claude/plugins -maxdepth 6 -type d -name \"usage-meter\" 2>/dev/null"}, {"base_command": "sports-proxy.jd9hall.workers.dev", "count": 1, "example": "B=https://sports-proxy.jd9hall.workers.dev"}, {"base_command": "cd $D", "count": 1, "example": "D=/private/tmp/claude-501/-Users-jd9hall/1be57e79-599f-42c5-bb0a-182a277c7dd9/scratchpad; cd $D && python3 - <<'EOF'\n# Day strip 5:00-17:00 for Fri Oct 2 (test data from the calendar read)\nW,H,L,R=1000,360,60,960\nt0,t1=5,17\nx=lambda h:L+(h-t0)/(t1-t0)*(R-L)\nbusy=[(7.5,8.5),(9.5,12),(13,14)]; tent=[(8.5,9.5)]\ns=[f'')\nopen('day.svg','w').write(\"\\n\".join(s))\nEOF\nqlmanage -t -s 1000 -o . day.svg >/dev/null 2>&1; ls -la day.svg.png 2>&1 | awk '{print $5, $NF}'"}, {"base_command": "authorization-server.md", "count": 1, "example": "F=node_modules/@cloudflare/workers-oauth-provider/docs/authorization-server.md"}, {"base_command": "sleep 10", "count": 1, "example": "/bin/sleep 10"}, {"base_command": "xattr \"Screen", "count": 1, "example": "xattr \"Screen Shot 2026-09-30 at 21.16.19 PM.png\" \"Screenshot 2026-09-23 at 12.12.02.png\""}, {"base_command": "workers-oauth-provider", "count": 1, "example": "D=node_modules/@cloudflare/workers-oauth-provider"}, {"base_command": "devicectl device", "count": 1, "example": "$DEVELOPER_DIR/usr/bin/devicectl device process launch --device 00008150-001825963E10C01C --terminate-existing com.jd9hall.Widgets 2>&1"}, {"base_command": "devicectl", "count": 1, "example": "D=$DEVELOPER_DIR/usr/bin/devicectl"}, {"base_command": "date +\"%Y-%m-%d", "count": 1, "example": "TZ=America/Chicago date +\"%Y-%m-%d %H:%M %Z\""}, {"base_command": "file \"$F\"", "count": 1, "example": "file \"$F\""}, {"base_command": "digests", "count": 1, "example": "S=/private/tmp/claude-501/-Users-jd9hall/dd47eb9b-a446-46c2-bab0-cc61658c7ef7/scratchpad/digests"}, {"base_command": "n=0; for", "count": 1, "example": "n=0; for t in ~/.claude/projects/*/*.jsonl; do echo \"{\\\"transcript_path\\\":\\\"$t\\\"}\" | ~/.claude/hooks/archive-session.sh && n=$((n+1)); done; echo \"archived $n\"; du -sh ~/Archive/claude-code"}, {"base_command": "2026-10-04", "count": 1, "example": "q=~/Projects/_cleanup_quarantine/2026-10-04"}, {"base_command": "prog=$(plutil", "count": 1, "example": "prog=$(plutil -extract ProgramArguments json -o - $f 2>/dev/null"}, {"base_command": "gather.sh shortcuts-runner", "count": 1, "example": "LINES_PER=22 /private/tmp/claude-501/-Users-jd9hall/8e5dbc48-90c1-4612-8baa-65427fa02763/scratchpad/gather.sh shortcuts-runner spotify-player spotify-widget-api spotify-widget supabase-dashboard task-capture youtube-widget 2>&1"}, {"base_command": "tmutil destinationinfo", "count": 1, "example": "tmutil destinationinfo 2>&1"}, {"base_command": "punch-ui\"", "count": 1, "example": "O=\"$TMPDIR/punch-ui\""}, {"base_command": "project.pbxproj", "count": 1, "example": "P=Widgets.xcodeproj/project.pbxproj"}, {"base_command": "cd $S;", "count": 1, "example": "S=/private/tmp/claude-501/-Users-jd9hall/28fcd8c7-e827-45e7-b61c-d4afe9adbdd8/scratchpad; cd $S; swift wid.swift 2>/dev/null; read X Y < <(swift bounds.swift 2>/dev/null); W=$(swift wid.swift 2>/dev/null | awk '$2==0{print $3; exit}'); swift click.swift $((X+530*W/1400)) $((Y+300*W/1400)); sleep 4; N=$(swift wid.swift 2>/dev/null | awk '$2==0{print $1; exit}'); screencapture -x -o -l $N mac6.png && sips -Z 1400 mac6.png >/dev/null"}, {"base_command": "ntfy-topic", "count": 1, "example": "F=~/.config/status-dashboard/ntfy-topic"}, {"base_command": "timeout 300", "count": 1, "example": "timeout 300 node parse-health-export.js 2>&1"}, {"base_command": "^NOTION_TOKEN=", "count": 1, "example": "N=$(grep ^NOTION_TOKEN= ~/Projects/hub/.env.local"}, {"base_command": "date +%Z", "count": 1, "example": "date +%Z"}, {"base_command": "vm_stat", "count": 1, "example": "vm_stat"}, {"base_command": "-E '^oauth_token'", "count": 1, "example": "CFG=~/Library/Preferences/.wrangler/config/default.toml; TOK=$(grep -E '^oauth_token' $CFG | cut -d'\"' -f2); ACC=$(cd ~/Projects/task-capture && rtk proxy npx wrangler whoami 2>/dev/null | grep -oE '[0-9a-f]{32}' | head -1); echo \"acc=$ACC tok=${#TOK}\"\nNOW=$(($(date +%s)*1000)); FROM=$((NOW-26*3600*1000))\ncurl -s -X POST \"https://api.cloudflare.com/client/v4/accounts/$ACC/workers/observability/telemetry/query\" -H \"Authorization: Bearer $TOK\" -H 'Content-Type: application/json' -d \"{\\\"queryId\\\":\\\"adhoc\\\",\\\"view\\\":\\\"events\\\",\\\"limit\\\":100,\\\"timeframe\\\":{\\\"from\\\":$FROM,\\\"to\\\":$NOW},\\\"parameters\\\":{\\\"filters\\\":[{\\\"key\\\":\\\"\\$metadata.service\\\",\\\"operation\\\":\\\"eq\\\",\\\"type\\\":\\\"string\\\",\\\"value\\\":\\\"task-capture\\\"}]}}\" > /private/tmp/claude-501/-Users-jd9hall/dd47eb9b-a446-46c2-bab0-cc61658c7ef7/scratchpad/logs.json\npython3 - <<'EOF'\nimport json\nd=json.load(open('/private/tmp/claude-501/-Users-jd9hall/dd47eb9b-a446-46c2-bab0-cc61658c7ef7/scratchpad/logs.json'))\nif not d.get('success'): print(json.dumps(d)[:800]); raise SystemExit\nev=d['result'].get('events',{}).get('events',[])\nprint(len(ev))\nfrom datetime import datetime,timezone\nfor e in sorted(ev,key=lambda e:e.get('timestamp',0)):\n w=e.get('$workers',{}); m=e.get('$metadata',{})\n ts=datetime.fromtimestamp(e['timestamp']/1000,timezone.utc).strftime('%H:%M:%S')\n req=w.get('event',{}).get('request',{}); resp=w.get('event',{}).get('response',{})\n print(ts, m.get('type',''), (m.get('message') or '')[:160].replace('\\n',' '), resp.get('status',''), (req.get('headers',{}) or {}).get('user-agent','')[:40])\nEOF"}, {"base_command": "bwg234s38.output", "count": 1, "example": "F=/private/tmp/claude-501/-Users-jd9hall/c6194814-d4bb-4b20-a437-51c26bc6ca4e/tasks/bwg234s38.output"}, {"base_command": "ghostty +validate-config", "count": 1, "example": "/Applications/Ghostty.app/Contents/MacOS/ghostty +validate-config"}, {"base_command": "shot.sh\" v2-desk-dark", "count": 1, "example": "S=/private/tmp/claude-501/-Users-jd9hall/c6194814-d4bb-4b20-a437-51c26bc6ca4e/scratchpad/sd\n\"$S/shot.sh\" v2-desk-dark 1440,1000 dark 1 8765 &\n\"$S/shot.sh\" v2-desk-light 1440,1000 light 1 8765 &\n\"$S/shot.sh\" v2-phone-dark 390,1500 dark 2 8765 &\n\"$S/shot.sh\" v2-phone-light 390,1500 light 2 8765 &\n\"$S/shot.sh\" v2-off-dark 1440,1000 dark 1 8766 &\nwait"}, {"base_command": "killall MenuBarAgent", "count": 1, "example": "killall MenuBarAgent 2>/dev/null"}, {"base_command": "-u NTFY_TOPIC", "count": 1, "example": "env -u NTFY_TOPIC ./notify.sh hi"}, {"base_command": "claude-api", "count": 1, "example": "S=/private/tmp/claude-501/bundled-skills/2.1.289/0c6224ea761ddfb66f7b6943c7c7fe1f/claude-api"}, {"base_command": "defaults import", "count": 1, "example": "defaults import com.apple.MenuBarAgent $SP/mba-new.plist"}, {"base_command": "MenuCapture", "count": 1, "example": "(build/MenuCapture.app/Contents/MacOS/MenuCapture --preview-window > $TMPDIR/mc.out 2>&1 &)"}, {"base_command": "Shortcuts", "count": 1, "example": "DB=$(find ~/Library/Shortcuts ~/Library/Group\\ Containers -maxdepth 3 -name 'Shortcuts.sqlite' 2>/dev/null"}, {"base_command": "}", "count": 1, "example": "}"}, {"base_command": "git grep", "count": 1, "example": "git grep -c \"dn-126677\" $(git rev-parse HEAD) -- ."}, {"base_command": "livecheck.sh", "count": 1, "example": "./livecheck.sh"}, {"base_command": "-f \"$(which", "count": 1, "example": "F=$(readlink -f \"$(which claude)\")"}, {"base_command": "bmmm9njyy.output", "count": 1, "example": "F=/private/tmp/claude-501/-Users-jd9hall/3b7043bd-b29c-4fbf-9e42-7edad5f3c594/tasks/bmmm9njyy.output"}, {"base_command": "date \"+%H:%M\"", "count": 1, "example": "date \"+%H:%M\""}, {"base_command": "pdftotext", "count": 1, "example": "pdftotext -layout \"71630-17018 JOHN DEERE WATERLOO WORKS - 08-26 BILL.pdf\" - 2>&1"}, {"base_command": "lsof", "count": 1, "example": "lsof -i :8791"}, {"base_command": "shot phone-light", "count": 1, "example": "shot phone-light 390,1700 light 2\nls -la \"$S\"/*.png"}, {"base_command": "wrap-up", "count": 1, "example": "D=~/.claude/skills/synced/62c82f39-68e1-4193-a371-3a79f80b4d6d_72d0c793-a627-4d4d-a78d-5c3c1b5f79a6/wrap-up"}, {"base_command": "npm i", "count": 1, "example": "npm i puppeteer-core@23 --silent 2>&1"}, {"base_command": "g=\"-\"", "count": 1, "example": "g=\"-\""}, {"base_command": "timeout 900", "count": 1, "example": "timeout 900 npx wrangler tail --format json > /private/tmp/claude-501/-Users-jd9hall/1b56ad43-9eed-446f-9ab0-b3f6e8bf6310/scratchpad/tail3.json 2>/dev/null"}, {"base_command": "wrap-up.zip", "count": 1, "example": "Z=~/Projects/hub/skills/dist/wrap-up.zip"}, {"base_command": "git auth", "count": 1, "example": "git -c credential.helper= -c 'credential.helper=!gh auth git-credential' push 2>&1"}, {"base_command": "python3.14", "count": 1, "example": "/Library/Frameworks/Python.framework/Versions/3.14/bin/python3.14 -m venv --clear .venv"}, {"base_command": "-d '\\n'", "count": 1, "example": "TOK=$(tr -d '\\n' < /private/tmp/claude-501/-Users-jd9hall/f3c33310-2366-4930-a1ed-22c5b791d198/scratchpad/capture_token)"}, {"base_command": "security add-generic-password", "count": 1, "example": "security add-generic-password -U -s punch-icloud -a \"jd9hall@gmail.com\" -l \"Punch iCloud calendar (app-specific password)\" -w \"$(pbpaste | tr -d '[:space:]')\""}, {"base_command": "# Try", "count": 1, "example": "# Try using curl to execute the SQL via Supabase REST API\n# First, check if we can detect the API key from Supabase CLI config\n\n# Check Supabase config\nls -la ~/.supabase/ 2>/dev/null"}, {"base_command": "Google", "count": 1, "example": "\"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\" --headless --disable-gpu --window-size=900,1500 --screenshot=\"$SP/report.png\" \"file://$SP/report.html\" 2>&1"}, {"base_command": "bash $T", "count": 1, "example": "/bin/bash $T"}, {"base_command": "uptime", "count": 1, "example": "uptime"}, {"base_command": "head", "count": 1, "example": "head -c 30000 /tmp/enc_combined_1_2.sql > /tmp/batch_1_2_truncated.sql"}, {"base_command": "strings \"$f\"", "count": 1, "example": "strings \"$f\" 2>/dev/null"}, {"base_command": "backup.sh", "count": 1, "example": "./scripts/backup.sh"}, {"base_command": "gunzip", "count": 1, "example": "gunzip -c /tmp/widgets-dd/Logs/Build/AFAD6BC1-5DE4-48E9-B958-CCC501DA8A75.xcactivitylog"}, {"base_command": "until", "count": 1, "example": "until /usr/bin/grep -E \"^\\[2026-10-03 1[7-9]\" \"$L\""}, {"base_command": "com.apple.windowserver.displays.*.plist);", "count": 1, "example": "SP=/private/tmp/claude-501/-Users-jd9hall-Claude/81b76ba6-9f05-4ee3-8347-fe6cff75a934/scratchpad; F=$(ls ~/Library/Preferences/ByHost/com.apple.windowserver.displays.*.plist); /usr/bin/plutil -convert json -o $SP/disp.json \"$F\" 2>/dev/null && python3 - <<'EOF'\nimport json\nd=json.load(open(\"/private/tmp/claude-501/-Users-jd9hall-Claude/81b76ba6-9f05-4ee3-8347-fe6cff75a934/scratchpad/disp.json\"))\nsets=d.get('DisplayAnyUserSets') or d.get('DisplayUserSets') or {}\nprint(\"top keys:\",list(d.keys()))\ndef walk(o,path=\"\"):\n if isinstance(o,dict):\n if 'UUID' in o and 'CurrentInfo' in o:\n ci=o['CurrentInfo']\n yield (o['UUID'], ci.get('Wide'), ci.get('High'), ci.get('Scale'), ci.get('OriginX'), ci.get('OriginY'), path)\n for k,v in o.items():\n yield from walk(v,path+\"/\"+str(k))\n elif isinstance(o,list):\n for i,v in enumerate(o): yield from walk(v,path+f\"[{i}]\")\nrows=list(walk(d))\nprint(f\"\\n{len(rows)} display config entries:\\n\")\nfor u,w,h,s,ox,oy,p in rows:\n flag=\" <-- DEGENERATE\" if (w is not None and w<100) else \"\"\n print(f\" {u[:13]} {str(w):>5} x {str(h):<5} scale={s} origin=({ox},{oy}){flag}\")\nEOF"}, {"base_command": "dea8d76f-bde9-416a-91c0-6261da0430a7.jsonl", "count": 1, "example": "T=$HOME/.claude/projects/-Users-jd9hall/dea8d76f-bde9-416a-91c0-6261da0430a7.jsonl"}, {"base_command": "cp", "count": 1, "example": "S=/private/tmp/claude-501/-Users-jd9hall/c6194814-d4bb-4b20-a437-51c26bc6ca4e/scratchpad/sd\ncp ~/Projects/\"Status Dashboard\"/worker/public/* \"$S/site/\"\nmkdir -p \"$S/off/api\" && cp ~/Projects/\"Status Dashboard\"/worker/public/* \"$S/off/\"\npython3 - \"$S\" <<'EOF'\nimport json,sys,copy\nS=sys.argv[1]; d=json.load(open(S+\"/site/api/status\"))\no=copy.deepcopy(d); o[\"mac\"].update(status=\"yellow\", age_min=47)\nfor s in o[\"services\"]:\n for c in s[\"checks\"]:\n if c[\"source\"]==\"mac\": c[\"detail\"]=\"Mac offline \u00b7 last reported %s: %s\"%(c[\"status\"],c[\"detail\"]); c[\"status\"]=\"grey\"\n if s[\"id\"]==\"my-team\":\n s[\"checks\"][0].update(status=\"yellow\", detail=\"slow: 2310 ms (max 1500)\")\n R={\"green\":0,\"grey\":1,\"yellow\":2,\"red\":3}\n s[\"status\"]=max((c[\"status\"] for c in s[\"checks\"]), key=R.get)\no[\"services\"].sort(key=lambda s:-{\"green\":0,\"grey\":1,\"yellow\":2,\"red\":3}[s[\"status\"]])\njson.dump(o,open(S+\"/off/api/status\",\"w\"))\nEOF\ncat > \"$S/shot.sh\" <<'EOF'\n#!/bin/zsh\n# shot.sh \nS=${0:h}\nperl -e 'alarm 30; exec @ARGV' \"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\" --headless=new --disable-gpu --hide-scrollbars \\\n --user-data-dir=\"$S/prof-$1\" --force-device-scale-factor=$4 --window-size=$2 --virtual-time-budget=3000 \\\n --screenshot=\"$S/$1.png\" \"http://localhost:$5/?theme=$3\" >/dev/null 2>&1\necho \"$1: $?\"\nEOF\nchmod +x \"$S/shot.sh\"\n(cd \"$S/site\" && python3 -m http.server 8765 >/dev/null 2>&1 &) ; (cd \"$S/off\" && python3 -m http.server 8766 >/dev/null 2>&1 &); sleep 1\nlsof -iTCP:8765 -iTCP:8766 -sTCP:LISTEN | awk 'NR>1{print $9}'"}, {"base_command": "timeout 75", "count": 1, "example": "timeout 75 npx wrangler tail --format json > /private/tmp/claude-501/-Users-jd9hall/1b56ad43-9eed-446f-9ab0-b3f6e8bf6310/scratchpad/tail.json 2>/dev/null"}, {"base_command": "config.ghostty\"", "count": 1, "example": "F=\"$HOME/Library/Application Support/com.mitchellh.ghostty/config.ghostty\""}, {"base_command": "+%Y%m%d-%H%M)", "count": 1, "example": "Q=~/Projects/Iphone-Widgets/.profile-quarantine/$(date +%Y%m%d-%H%M)"}, {"base_command": "last reboot", "count": 1, "example": "last reboot shutdown 2>/dev/null"}, {"base_command": "\\\nfor", "count": 1, "example": "\\\nfor f in mcp-claude_ai_HealthEx-get_*.txt"}, {"base_command": "npm test", "count": 1, "example": "npm test 2>&1)"}, {"base_command": "log stats", "count": 1, "example": "/usr/bin/log stats 2>/dev/null"}, {"base_command": "md5", "count": 1, "example": "md5 -q \"$D/Nudge Alarm.shortcut\" \"shortcut/Nudge Alarm.shortcut\""}, {"base_command": "# Take", "count": 1, "example": "# Take first 5 encounter IDs as a test batch\nhead -5 /tmp/encounter_ids.txt > /tmp/sample_encounter_ids.txt"}, {"base_command": "cd $SP", "count": 1, "example": "SP=/private/tmp/claude-501/-Users-jd9hall/6ae5decf-3ab7-4f27-9aa8-e566c0b6a69b/scratchpad; cd $SP && python3 - <<'EOF'\np='comet_punch_check.mjs'; s=open(p).read()\ns=s.replace(\"const TOKEN = process.env.PUNCH_TOKEN;\\nif (!TOKEN) { console.error('no PUNCH_TOKEN'); process.exit(1); }\\nconst PUNCH = 'https://jdh-punch.pages.dev';\",\n \"const TOKEN = process.env.PUNCH_TOKEN || 'test-token';\\nconst PUNCH = process.env.PUNCH_BASE || 'http://localhost:8798';\")\nopen(p,'w').write(s)\nEOF\ngrep -n \"const TOKEN\\|const PUNCH \" comet_punch_check.mjs\npkill -f \"wrangler dev --port 8799\"; sleep 1\n(node mock_punch.mjs > $SP/mock.log 2>&1 &)\ncd ~/Projects/Comet-Homepage && (npx wrangler dev --port 8799 --var PUNCH_ORIGIN:http://localhost:8798 > $SP/dev.log 2>&1 &)\nfor i in $(seq 1 30); do grep -q \"Ready on\" $SP/dev.log && break; sleep 1; done; tail -1 $SP/dev.log; cat $SP/mock.log"}, {"base_command": "date\necho", "count": 1, "example": "date\necho"}, {"base_command": "Google Chrome\"", "count": 1, "example": "C=\"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\""}, {"base_command": "# Quick", "count": 1, "example": "# Quick row count check via curl\ncurl -s -X POST \"https://ywblwmbaiplnphiqzalm.supabase.co/rest/v1/rpc/exec_sql\" \\\n -H \"apikey: $SUPABASE_KEY\" \\\n -H \"Authorization: Bearer $SUPABASE_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"query\": \"SELECT 1 as test;\"\n }'"}, {"base_command": "done", "count": 1, "example": "done 2>/dev/null"}, {"base_command": "bash $S", "count": 1, "example": "/bin/bash $S"}, {"base_command": "-f $(which", "count": 1, "example": "C=$(readlink -f $(which claude))"}, {"base_command": "shasum", "count": 1, "example": "shasum -a 256 migrations/001_init.sql"}, {"base_command": "\\\nfind", "count": 1, "example": "\\\nfind . -name \"*get_visits*\" -type f 2>/dev/null"}, {"base_command": "pic", "count": 1, "example": "S=/private/tmp/claude-501/-Users-jd9hall/5e44d160-e1f2-49e9-9a3e-366464a4c469/scratchpad/pic"}, {"base_command": "# Regenerate", "count": 1, "example": "# Regenerate combined files\nnode /tmp/split_tables.js > /dev/null 2>&1"}, {"base_command": "gather.sh Health-skill", "count": 1, "example": "LINES_PER=30 /private/tmp/claude-501/-Users-jd9hall/8e5dbc48-90c1-4612-8baa-65427fa02763/scratchpad/gather.sh Health-skill Iphone-Widgets mac-cleanup mailroom my-team 2>&1"}, {"base_command": "filer-start-line2); tail", "count": 1, "example": "L=~/Library/Logs/screenshot-filer.log; S0=$(cat /private/tmp/claude-501/-Users-jd9hall/c6194814-d4bb-4b20-a437-51c26bc6ca4e/scratchpad/filer-start-line2); tail -n +$((S0+1)) \"$L\" | head -6"}, {"base_command": "defaults read", "count": 1, "example": "defaults read com.apple.MenuBarAgent TrailingItemPreferredPositions 2>/dev/null"}, {"base_command": "--sdk macosx", "count": 1, "example": "SDK=$(xcrun --sdk macosx --show-sdk-path 2>&1)"}, {"base_command": "capture_token)\necho", "count": 1, "example": "D=/private/tmp/claude-501/-Users-jd9hall/dd47eb9b-a446-46c2-bab0-cc61658c7ef7/scratchpad\nTOK=$(cat /private/tmp/claude-501/-Users-jd9hall/f3c33310-2366-4930-a1ed-22c5b791d198/scratchpad/capture_token)\necho \"passcode check:\"; curl -s -o /dev/null -w '%{http_code}\\n' -X POST https://task-capture.jd9hall.workers.dev -H \"Authorization: Bearer $TOK\" --data ''\nTOK=\"$TOK\" python3 - <&1 | tail -3; ls -la \"$D/Capture Task.shortcut\""}, {"base_command": "MEMORY.md", "count": 1, "example": "M=/Users/jd9hall/.claude/projects/-Users-jd9hall/memory/MEMORY.md"}, {"base_command": "$G +list-themes", "count": 1, "example": "$G +list-themes --plain 2>/dev/null"}, {"base_command": "filer-start-line2); for", "count": 1, "example": "L=~/Library/Logs/screenshot-filer.log; S0=$(cat /private/tmp/claude-501/-Users-jd9hall/c6194814-d4bb-4b20-a437-51c26bc6ca4e/scratchpad/filer-start-line2); for i in $(seq 1 180); do tail -n +$((S0+1)) \"$L\" | grep -qE \"^.{21}filed [0-9]+|ERROR\" && break; sleep 10; done; launchctl bootout gui/$(id -u)/com.jd9hall.filer-once 2>/dev/null; tail -n +$((S0+1)) \"$L\" | grep -vE \" -> |SKIP \\(unreadable\\)\" ; echo \"moved: $(tail -n +$((S0+1)) \"$L\" | grep -c ' -> ') unreadable: $(tail -n +$((S0+1)) \"$L\" | grep -c 'SKIP (unreadable)')\"; D=~/\"Library/Mobile Documents/com~apple~CloudDocs/Screenshots\"; echo \"loose files left in iCloud root: $(find \"$D\" -maxdepth 1 -type f ! -name '.*' | wc -l | tr -d ' ')\""}, {"base_command": "README.md", "count": 1, "example": "R=node_modules/@cloudflare/workers-oauth-provider/README.md"}, {"base_command": "pbcopy <", "count": 1, "example": "pbcopy < ~/Projects/task-capture/TRIAGE_HANDOFF.md"}, {"base_command": "echo \"synced", "count": 1, "example": "SYN=~/.claude/skills/synced/62c82f39-68e1-4193-a371-3a79f80b4d6d_72d0c793-a627-4d4d-a78d-5c3c1b5f79a6/health-report\necho \"synced SKILL.md : $(wc -c < \"$SYN/SKILL.md\" | tr -d ' ') bytes, $(stat -f '%Sm' \"$SYN/SKILL.md\")\"\necho \"mine : $(wc -c < ~/Projects/health-skill/health-report/SKILL.md | tr -d ' ') bytes\"\necho \"\"\necho \"clinical scripts present in synced copy?\"\nfor f in freshness.sql history.sql labs.sql"}, {"base_command": "$p", "count": 1, "example": "$p -c \"import matplotlib; print('$p', matplotlib.__version__)\" 2>/dev/null"}, {"base_command": "-l <", "count": 1, "example": "L=$(wc -l < ~/Library/Logs/widgets-resign.log); ~/Projects/Iphone-Widgets/watch-profile.sh; echo \"exit $?\"; rtk proxy tail -n +$((L+1)) ~/Library/Logs/widgets-resign.log | rtk proxy grep -vE \"^\\s*$|^[\u2022?] (installationURL|launchServicesIdentifier|databaseUUID|databaseSequenceNumber|options)\"; echo \"-- now\"; ~/Projects/hub/ios/install.sh --check; rtk proxy ls \"$HOME/Library/Application Support/widgets-resign/profile-quarantine/\""}, {"base_command": "tc", "count": 1, "example": "S=/private/tmp/claude-501/-Users-jd9hall/32055904-16d5-4b95-b716-539d8aaab76a/scratchpad/tc"}, {"base_command": "shot phone-dark", "count": 1, "example": "shot phone-dark 390,1700 dark 2"}, {"base_command": "config.ghostty\"; [", "count": 1, "example": "F=\"$HOME/Library/Application Support/com.mitchellh.ghostty/config.ghostty\"; [ -s \"$F\" ] && { echo \"NOT EMPTY, aborting\"; cat \"$F\"; exit 1; }\ncat > \"$F\" <<'EOF'\n# Theme: follows macOS light/dark\ntheme = light:TokyoNight Day,dark:TokyoNight Night\n\n# Look\nfont-size = 14\nbackground-opacity = 0.9\nbackground-blur = 20\nmacos-titlebar-style = tabs\nwindow-padding-x = 8\nwindow-padding-y = 6\n\n# Drop-down terminal on Cmd+` from anywhere (needs Accessibility permission)\nquick-terminal-position = top\nkeybind = global:cmd+grave_accent=toggle_quick_terminal\n\n# Fix garbled display when SSHing into servers that don't know Ghostty\nshell-integration-features = ssh-terminfo\nEOF\n/Applications/Ghostty.app/Contents/MacOS/ghostty +validate-config && echo VALID"}, {"base_command": "uv", "count": 1, "example": "uv --version"}, {"base_command": "by0kx011d.output", "count": 1, "example": "F=/private/tmp/claude-501/-Users-jd9hall/c6194814-d4bb-4b20-a437-51c26bc6ca4e/tasks/by0kx011d.output"}, {"base_command": "com.jd9hall.punch-refresh.plist", "count": 1, "example": "P=~/Library/LaunchAgents/com.jd9hall.punch-refresh.plist"}, {"base_command": "$D device", "count": 1, "example": "$D device process launch --device $U --terminate-existing com.jd9hall.Widgets 2>&1"}, {"base_command": "fi\ngrep", "count": 1, "example": "fi\ngrep -l \"SUPABASE_KEY\" ~/.zshrc ~/.zshenv ~/.zprofile 2>/dev/null"}, {"base_command": "npm view", "count": 1, "example": "npm view @cloudflare/workers-oauth-provider version dependencies --json 2>&1"}, {"base_command": "git clone", "count": 1, "example": "git clone --depth 1 https://github.com/zsh-users/zsh-syntax-highlighting ~/.zsh/zsh-syntax-highlighting 2>&1"}, {"base_command": "d=$(ls", "count": 1, "example": "d=$(ls -d ~/Projects/*clean* 2>/dev/null)"}, {"base_command": "profile-quarantine\"", "count": 1, "example": "Q=\"$HOME/Library/Application Support/widgets-resign/profile-quarantine\""}, {"base_command": "com.jd9hall.status-collector.plist", "count": 1, "example": "P=~/Library/LaunchAgents/com.jd9hall.status-collector.plist"}, {"base_command": "dirty=$(git", "count": 1, "example": "dirty=$(git -C \"$d\" status --porcelain 2>/dev/null"}, {"base_command": "# Extract", "count": 1, "example": "# Extract conditions chunk from the SQL file\ngrep -A 850 \"INSERT INTO public.conditions\" /tmp/f_inserts.sql"}, {"base_command": "ifconfig", "count": 1, "example": "ifconfig 2>/dev/null"}, {"base_command": "-d)", "count": 1, "example": "T=$(mktemp -d)"}, {"base_command": "push_rtk_stats.sh", "count": 1, "example": "S=~/Projects/my-team/scripts/push_rtk_stats.sh"}, {"base_command": "}\nshot", "count": 1, "example": "}\nshot desk-dark 1440,1000 dark 1"}, {"base_command": "brew list", "count": 1, "example": "brew list 2>/dev/null"}, {"base_command": "+%Y%m%d-%H%M).plist", "count": 1, "example": "BK=~/Desktop/MenuBarAgent-backup-$(date +%Y%m%d-%H%M).plist"}, {"base_command": "# propagate", "count": 1, "example": "SKILL=~/.claude/skills/synced/62c82f39-68e1-4193-a371-3a79f80b4d6d_72d0c793-a627-4d4d-a78d-5c3c1b5f79a6/health-report\n# propagate the package.json fix back to source + other caches\ncp \"$SKILL/scripts/package.json\" ~/Projects/health-skill/health-report/scripts/package.json\nfor d in ~/.agents/skills/synced/62c82f39-68e1-4193-a371-3a79f80b4d6d_72d0c793-a627-4d4d-a78d-5c3c1b5f79a6/health-report \\\n \"$HOME/Library/Application Support/Claude/local-agent-mode-sessions/skills-plugin/62c82f39-68e1-4193-a371-3a79f80b4d6d/72d0c793-a627-4d4d-a78d-5c3c1b5f79a6/skills/health-report\"; do\n cp \"$SKILL/scripts/package.json\" \"$d/scripts/package.json\"\ndone\necho \"package.json propagated\"\n\ncp \"$SKILL/scripts/health-trends-report.pptx\" /tmp/health-trends-report.pptx\nrm -f /tmp/deck.pdf\nosascript <<'EOF' 2>&1 | tail -2\ntell application \"Microsoft PowerPoint\"\n activate\n open POSIX file \"/tmp/health-trends-report.pptx\"\n delay 4\n save active presentation in POSIX file \"/tmp/deck.pdf\" as save as PDF\n delay 8\n close active presentation saving no\n quit saving no\nend tell\nEOF\nls -lh /tmp/deck.pdf 2>/dev/null\n\n# refresh the upload bundle to include package.json\nrm -rf /tmp/health-report-updated /tmp/health-report-updated.zip\nmkdir -p /tmp/health-report-updated\ncd ~/Projects/health-skill/health-report\ncp -R SKILL.md scripts references /tmp/health-report-updated/\nfind /tmp/health-report-updated \\( -name \"*.pptx\" -o -name \"*.pdf\" -o -name node_modules -o -name \"package-lock.json\" -o -name \".DS_Store\" \\) -exec rm -rf {} + 2>/dev/null\ncd /tmp && zip -qr health-report-updated.zip health-report-updated\necho \"\"; echo \"refreshed bundle:\"; find /tmp/health-report-updated -type f | sed 's|/tmp/health-report-updated/||' | sort"}, {"base_command": "{ echo", "count": 1, "example": "{ echo missing"}, {"base_command": "rand", "count": 1, "example": "TOKEN=$(openssl rand -hex 24)"}, {"base_command": "ditto", "count": 1, "example": "ditto /tmp/punch-mac-dd/Build/Products/Release/Punch.app /Applications/Punch.app"}, {"base_command": "file", "count": 1, "example": "file t.png"}, {"base_command": "zsh", "count": 1, "example": "zsh -x ./build.sh 2>&1"}, {"base_command": "-E '^PUNCH_TOKEN='", "count": 1, "example": "T=$(grep -E '^PUNCH_TOKEN=' .env.local"}, {"base_command": "2026-10-05", "count": 1, "example": "Q=~/Projects/_cleanup_quarantine/2026-10-05"}], "parse_errors": 0, "rtk_disabled_count": 0, "rtk_disabled_examples": [], "agent_status": {"cursor_hook_installed": false, "hermes_plugin_installed": false, "copilot_hook_installed": false}}, "opportunityTokens": 398801};
var REDUCED = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
// ---- theme toggle (manual override beats system preference either direction) ----
var STORAGE_KEY = 'rtk_dashboard_theme';
function applyTheme(t) {
if (t) document.documentElement.dataset.theme = t;
else delete document.documentElement.dataset.theme;
}
function systemDark() { return window.matchMedia('(prefers-color-scheme: dark)').matches; }
var stored = localStorage.getItem(STORAGE_KEY);
applyTheme(stored === 'light' || stored === 'dark' ? stored : null);
function paintToggleIcon() {
var dark = document.documentElement.dataset.theme ? document.documentElement.dataset.theme === 'dark' : systemDark();
document.getElementById('themeToggle').innerHTML = dark
? ''
: '';
}
paintToggleIcon();
document.getElementById('themeToggle').addEventListener('click', function () {
var current = document.documentElement.dataset.theme || (systemDark() ? 'dark' : 'light');
var next = current === 'dark' ? 'light' : 'dark';
localStorage.setItem(STORAGE_KEY, next);
applyTheme(next);
paintToggleIcon();
});
var css = getComputedStyle(document.querySelector('.viz-root'));
function tok(name) { return css.getPropertyValue(name).trim(); }
var CATEGORY_SLOTS = {
'Git': 'cat-1', 'PackageManager': 'cat-2', 'Files': 'cat-3', 'Build': 'cat-4',
'Network': 'cat-5', 'Test': 'cat-6', 'Infrastructure': 'cat-7', 'GitHub': 'cat-8',
};
function categoryColor(cat) { return tok('--' + (CATEGORY_SLOTS[cat] || 'cat-other')); }
function compact(n) {
// Savings crossed a million once rtk grep started dominating; without an
// M step the headline read "2054.5K".
if (Math.abs(n) >= 1000000) return (n / 1000000).toFixed(1) + 'M';
if (Math.abs(n) >= 1000) return (n / 1000).toFixed(1) + 'K';
return String(Math.round(n));
}
// count-up on stat tiles — the immediate, no-hover-required "this is alive" signal
function animateValue(el, target, opts) {
opts = opts || {};
if (REDUCED) { el.textContent = opts.format ? opts.format(target) : compact(target); return; }
var start = performance.now(), dur = 700;
function frame(now) {
var t = Math.min(1, (now - start) / dur);
var eased = 1 - Math.pow(1 - t, 3);
var v = target * eased;
el.textContent = opts.format ? opts.format(v) : compact(v);
if (t < 1) requestAnimationFrame(frame);
else el.textContent = opts.format ? opts.format(target) : compact(target);
}
requestAnimationFrame(frame);
}
var tooltip = document.getElementById('tooltip');
function showTooltip(x, y, valueText, labelText) {
tooltip.innerHTML = '';
var strong = document.createElement('span');
strong.className = 'tt-value';
strong.textContent = valueText;
var sep = document.createTextNode(' — ');
var name = document.createElement('span');
name.textContent = labelText;
tooltip.appendChild(strong);
tooltip.appendChild(sep);
tooltip.appendChild(name);
tooltip.style.left = x + 'px';
tooltip.style.top = y + 'px';
tooltip.classList.add('show');
}
function hideTooltip() { tooltip.classList.remove('show'); }
// ---- stat tiles (values count up on load) ----
(function renderTiles() {
var s = DATA.summary;
var tiles = [
{ label: 'Total commands', target: s.total_commands, format: function (v) { return compact(v); } },
{ label: 'Tokens saved', target: s.total_saved, format: function (v) { return compact(v); } },
{ label: 'Avg savings', target: s.avg_savings_pct, format: function (v) { return v.toFixed(1) + '%'; } },
{ label: 'Avg exec time', target: s.avg_time_ms / 1000, format: function (v) { return v.toFixed(1) + 's'; } },
{ label: 'Tokens still on the table', target: DATA.opportunityTokens, format: function (v) { return compact(v); }, accent: true },
];
var root = document.getElementById('tiles');
tiles.forEach(function (t) {
var el = document.createElement('div');
el.className = 'tile' + (t.accent ? ' accent' : '');
var l = document.createElement('div'); l.className = 'label'; l.textContent = t.label;
var v = document.createElement('div'); v.className = 'value'; v.textContent = t.format(0);
el.appendChild(l); el.appendChild(v);
root.appendChild(el);
animateValue(v, t.target, { format: t.format });
});
}());
// ---- daily trend (line + area, animated draw-in, crosshair tooltip) ----
(function renderTrend() {
var daily = DATA.daily || [];
var note = document.getElementById('trendNote');
if (daily.length === 0) {
note.textContent = 'No daily data yet.';
return;
}
// Absolute savings track how heavily rtk was used that day, so a single
// heavy day flattens every other into the baseline — one 1.9M day against
// days under 60K makes the line a spike and nothing else. Efficiency is
// bounded and comparable day to day, so it leads; the absolute series is
// one click away.
var METRICS = {
savings_pct: { label: 'Efficiency', fmt: function (v) { return Math.round(v) + '%'; } },
saved_tokens: { label: 'Tokens saved', fmt: compact }
};
var metric = 'savings_pct';
var svg = document.getElementById('trendSvg');
var W = 600, H = 170, padL = 8, padR = 8, padT = 16, padB = 26;
var n = daily.length;
function draw() {
var spec = METRICS[metric];
while (svg.firstChild) svg.removeChild(svg.firstChild);
note.textContent = (daily.length < 7
? 'Only ' + daily.length + ' day' + (daily.length === 1 ? '' : 's') + ' recorded so far — this fills in as more days pass. '
: '') + spec.label + ' per day, last ' + daily.length + ' days.';
var maxSaved = Math.max.apply(null, daily.map(function (d) { return d[metric]; }).concat([1]));
var stepX = n > 1 ? (W - padL - padR) / (n - 1) : 0;
function xAt(i) { return n > 1 ? padL + i * stepX : W / 2; }
function yAt(v) { return H - padB - (v / maxSaved) * (H - padT - padB); }
var ns = 'http://www.w3.org/2000/svg';
function el(tag, attrs) {
var e = document.createElementNS(ns, tag);
for (var k in attrs) e.setAttribute(k, attrs[k]);
return e;
}
svg.appendChild(el('line', { x1: padL, y1: H - padB, x2: W - padR, y2: H - padB, stroke: tok('--baseline'), 'stroke-width': 1 }));
if (n > 1) {
var linePts = daily.map(function (d, i) { return xAt(i) + ',' + yAt(d[metric]); }).join(' ');
var areaPts = 'M' + xAt(0) + ',' + (H - padB) + ' L' + linePts.split(' ').join(' L') + ' L' + xAt(n - 1) + ',' + (H - padB) + ' Z';
var area = el('path', { d: areaPts, fill: tok('--seq-450'), opacity: 0 });
svg.appendChild(area);
var line = el('polyline', { points: linePts, fill: 'none', stroke: tok('--seq-450'), 'stroke-width': 2, 'stroke-linejoin': 'round', 'stroke-linecap': 'round' });
svg.appendChild(line);
if (!REDUCED) {
var len = line.getTotalLength ? line.getTotalLength() : 1000;
line.style.strokeDasharray = len;
line.style.strokeDashoffset = len;
line.style.transition = 'stroke-dashoffset 0.9s cubic-bezier(.16,1,.3,1)';
area.style.transition = 'opacity 0.6s ease 0.5s';
requestAnimationFrame(function () {
requestAnimationFrame(function () { line.style.strokeDashoffset = 0; area.style.opacity = 0.1; });
});
} else {
area.style.opacity = 0.1;
}
}
var hitGroup = el('g', {});
daily.forEach(function (d, i) {
var cx = xAt(i), cy = yAt(d[metric]);
var ring = el('circle', { cx: cx, cy: cy, r: 4, fill: tok('--seq-450'), stroke: tok('--surface-1'), 'stroke-width': 2 });
svg.appendChild(ring);
var hit = el('circle', { cx: cx, cy: cy, r: 14, fill: 'transparent', style: 'cursor:pointer' });
hit.tabIndex = 0;
var onEnter = function () {
var box = svg.getBoundingClientRect();
var px = box.left + (cx / W) * box.width;
var py = box.top + (cy / H) * box.height + window.scrollY;
showTooltip(px, py, spec.fmt(d[metric]), d.date + ' · ' + d.commands + ' commands · ' + compact(d.saved_tokens) + ' saved');
var ch = document.getElementById('crosshair');
ch.style.left = px + 'px';
ch.style.opacity = 1;
};
hit.addEventListener('pointerenter', onEnter);
hit.addEventListener('pointermove', onEnter);
hit.addEventListener('focus', onEnter);
hit.addEventListener('pointerleave', function () { hideTooltip(); document.getElementById('crosshair').style.opacity = 0; });
hit.addEventListener('blur', function () { hideTooltip(); document.getElementById('crosshair').style.opacity = 0; });
hitGroup.appendChild(hit);
if (i === n - 1) {
var lbl = el('text', { x: cx - 2, y: cy - 12, 'text-anchor': 'end', 'font-size': 11, 'font-weight': 600, fill: tok('--text-primary') });
lbl.textContent = spec.fmt(d[metric]);
svg.appendChild(lbl);
}
// Anchor the end ticks inward: centred on the plot edge, half the label
// falls outside the viewBox and gets clipped mid-digit.
var anchor = i === 0 ? 'start' : i === n - 1 ? 'end' : 'middle';
var tick = el('text', { x: cx, y: H - padB + 16, 'text-anchor': anchor, 'font-size': 10, fill: tok('--text-muted') });
tick.textContent = d.date.slice(5);
svg.appendChild(tick);
});
svg.appendChild(hitGroup);
}
draw();
var chips = document.getElementById('trendChips');
if (chips) {
chips.addEventListener('click', function (e) {
var btn = e.target.closest('button[data-metric]');
if (!btn || btn.dataset.metric === metric) return;
metric = btn.dataset.metric;
chips.querySelectorAll('button').forEach(function (b) {
b.classList.toggle('active', b.dataset.metric === metric);
});
draw();
});
}
}());
// ---- weekly / monthly breakdown ----
// Listed as rows rather than charted: two weeks and one month exist so far,
// and a one- or two-bar chart is a stat tile wearing the wrong clothes. Rows
// scale as the periods accumulate, so this won't need revisiting.
(function renderPeriods() {
var weekly = DATA.weekly || [];
var monthly = DATA.monthly || [];
var card = document.getElementById('periodsCard');
var root = document.getElementById('periodsChart');
var note = document.getElementById('periodsNote');
if (!weekly.length && !monthly.length) { if (card) card.style.display = 'none'; return; }
note.textContent = 'Savings grouped by period. Percent is the share of input tokens rtk removed, so it is comparable across periods; the totals are not.';
function shortDate(iso) {
if (!iso) return '';
var p = iso.split('-');
return new Date(+p[0], +p[1] - 1, +p[2]).toLocaleDateString(undefined, { month: 'short', day: 'numeric' });
}
function monthName(m) {
var p = m.split('-');
return new Date(+p[0], +p[1] - 1, 1).toLocaleDateString(undefined, { month: 'long', year: 'numeric' });
}
function section(title, rows, nameOf) {
if (!rows.length) return;
var h = document.createElement('div');
h.className = 'bar-label';
h.style.cssText = 'margin:10px 0 6px;font-weight:600;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.08em;font-size:10px';
h.textContent = title;
root.appendChild(h);
var maxVal = Math.max.apply(null, rows.map(function (r) { return r.saved_tokens; }).concat([1]));
rows.forEach(function (d) {
var row = document.createElement('div'); row.className = 'bar-row';
var label = document.createElement('div'); label.className = 'bar-label';
label.textContent = nameOf(d);
row.appendChild(label);
var track = document.createElement('div'); track.className = 'bar-track';
var fill = document.createElement('div'); fill.className = 'bar-fill';
fill.style.background = tok('--seq-450');
var w = Math.max((d.saved_tokens / maxVal) * 100, 2) + '%';
fill.dataset.targetWidth = w;
fill.style.width = REDUCED ? w : '0%';
fill.tabIndex = 0;
var show = function () {
var r = fill.getBoundingClientRect();
showTooltip(r.left + r.width / 2 + window.scrollX, r.top + window.scrollY - 8,
compact(d.saved_tokens) + ' tokens saved',
nameOf(d) + ' · ' + d.commands + ' commands · ' + Math.round(d.savings_pct) + '%');
};
fill.addEventListener('pointerenter', show);
fill.addEventListener('pointermove', show);
fill.addEventListener('focus', show);
fill.addEventListener('pointerleave', hideTooltip);
fill.addEventListener('blur', hideTooltip);
track.appendChild(fill);
row.appendChild(track);
var value = document.createElement('div'); value.className = 'bar-value';
value.textContent = compact(d.saved_tokens) + ' · ' + Math.round(d.savings_pct) + '%';
row.appendChild(value);
root.appendChild(row);
});
}
section('By week', weekly.slice().reverse(), function (d) {
return shortDate(d.week_start) + ' – ' + shortDate(d.week_end);
});
section('By month', monthly.slice().reverse(), function (d) { return monthName(d.month); });
animateBars(root);
}());
// ---- shared: animate a set of bar rows in with a slight stagger ----
function animateBars(container) {
if (REDUCED) return;
var fills = container.querySelectorAll('.bar-fill');
fills.forEach(function (f, i) {
var target = f.dataset.targetWidth;
f.style.width = '0%';
setTimeout(function () { f.style.width = target; }, 30 + i * 35);
});
}
// ---- command breakdown (sortable bar list) ----
(function renderCommands() {
var container = document.getElementById('commandChart');
var chips = document.querySelectorAll('#sortChips .sort-chip');
var sortKey = 'saved';
function draw() {
var rows = DATA.commands.slice().sort(function (a, b) { return b[sortKey] - a[sortKey]; });
var maxVal = Math.max.apply(null, rows.map(function (r) { return r[sortKey]; }).concat([1]));
container.innerHTML = '';
rows.forEach(function (d) {
var row = document.createElement('div'); row.className = 'bar-row';
var label = document.createElement('div'); label.className = 'bar-label'; label.textContent = d.command;
row.appendChild(label);
var track = document.createElement('div'); track.className = 'bar-track';
var fill = document.createElement('div'); fill.className = 'bar-fill';
fill.style.background = tok('--seq-450');
var w = Math.max((d[sortKey] / maxVal) * 100, 2) + '%';
fill.dataset.targetWidth = w;
fill.style.width = REDUCED ? w : '0%';
fill.tabIndex = 0;
track.appendChild(fill);
row.appendChild(track);
var value = document.createElement('div'); value.className = 'bar-value';
value.textContent = sortKey === 'saved' ? compact(d.saved) : sortKey === 'pct' ? d.pct + '%' : d.ms + 'ms';
row.appendChild(value);
var show = function (e) {
var r = fill.getBoundingClientRect();
showTooltip(r.left + r.width / 2 + window.scrollX, r.top + window.scrollY - 8,
compact(d.saved) + ' tokens saved', d.command + ' ×' + d.count + ' (' + d.pct + '%)');
};
fill.addEventListener('pointerenter', show);
fill.addEventListener('pointermove', show);
fill.addEventListener('focus', show);
fill.addEventListener('pointerleave', hideTooltip);
fill.addEventListener('blur', hideTooltip);
container.appendChild(row);
});
animateBars(container);
}
chips.forEach(function (chip) {
chip.addEventListener('click', function () {
sortKey = chip.dataset.sort;
chips.forEach(function (c) { c.classList.toggle('active', c === chip); });
draw();
});
});
chips[0].classList.add('active');
draw();
}());
// ---- missed opportunities (rtk discover) ----
(function renderOpportunities() {
var supported = (DATA.discover.supported || []).slice().sort(function (a, b) { return b.estimated_savings_tokens - a.estimated_savings_tokens; });
var note = document.getElementById('opportunityNote');
note.textContent = supported.length === 0
? 'Nothing found — everything scannable already goes through rtk.'
: 'Commands from your last ' + DATA.discover.since_days + ' days that have an rtk equivalent you\'re not using yet.';
var seenCats = [];
supported.forEach(function (d) { if (seenCats.indexOf(d.category) === -1) seenCats.push(d.category); });
var legend = document.getElementById('categoryLegend');
seenCats.forEach(function (cat) {
var item = document.createElement('div'); item.className = 'legend-item';
var sw = document.createElement('span'); sw.className = 'legend-swatch'; sw.style.background = categoryColor(cat);
var name = document.createElement('span'); name.textContent = cat;
item.appendChild(sw); item.appendChild(name);
legend.appendChild(item);
});
var container = document.getElementById('opportunityChart');
var maxVal = Math.max.apply(null, supported.map(function (d) { return d.estimated_savings_tokens; }).concat([1]));
supported.forEach(function (d) {
var row = document.createElement('div'); row.className = 'bar-row';
var label = document.createElement('div'); label.className = 'bar-label';
var dot = document.createElement('span'); dot.className = 'bar-cat-dot'; dot.style.background = categoryColor(d.category);
label.appendChild(dot);
label.appendChild(document.createTextNode(d.command + ' → rtk ' + d.rtk_equivalent.replace(/^rtk\s*/, '')));
row.appendChild(label);
var track = document.createElement('div'); track.className = 'bar-track';
var fill = document.createElement('div'); fill.className = 'bar-fill';
// a lighter tint carries magnitude; the dot + legend carry category
// identity — keeps the bar area calm instead of eight saturated hues
// competing for attention.
fill.style.background = 'color-mix(in srgb, ' + categoryColor(d.category) + ' 55%, transparent)';
var w = Math.max((d.estimated_savings_tokens / maxVal) * 100, 2) + '%';
fill.dataset.targetWidth = w;
fill.style.width = REDUCED ? w : '0%';
fill.tabIndex = 0;
track.appendChild(fill);
row.appendChild(track);
var value = document.createElement('div'); value.className = 'bar-value';
value.textContent = compact(d.estimated_savings_tokens);
row.appendChild(value);
var show = function () {
var r = fill.getBoundingClientRect();
showTooltip(r.left + r.width / 2 + window.scrollX, r.top + window.scrollY - 8,
'~' + compact(d.estimated_savings_tokens) + ' tokens', d.command + ' ×' + d.count + ' — ' + d.category);
};
fill.addEventListener('pointerenter', show);
fill.addEventListener('pointermove', show);
fill.addEventListener('focus', show);
fill.addEventListener('pointerleave', hideTooltip);
fill.addEventListener('blur', hideTooltip);
container.appendChild(row);
});
animateBars(container);
}());
// ---- failures ----
(function renderFailures() {
var f = DATA.failures;
var row = document.getElementById('failuresRow');
var recoveryColor = f.recovery_pct >= 95 ? tok('--good-text') : f.recovery_pct >= 80 ? tok('--warning') : tok('--critical');
row.innerHTML = '';
var s1 = document.createElement('span'); s1.className = 'failures-stat';
s1.appendChild(document.createTextNode('Total failures: '));
var b1 = document.createElement('b'); b1.textContent = f.total; s1.appendChild(b1);
var s2 = document.createElement('span'); s2.className = 'failures-stat';
s2.appendChild(document.createTextNode('Recovery rate: '));
var b2 = document.createElement('b'); b2.textContent = f.recovery_pct.toFixed(1) + '%'; b2.style.color = recoveryColor;
s2.appendChild(b2);
row.appendChild(s1); row.appendChild(s2);
var list = document.getElementById('failuresList');
(f.top || []).forEach(function (item) {
var chip = document.createElement('span'); chip.className = 'failure-chip';
chip.textContent = item.count + '× ' + item.command;
list.appendChild(chip);
});
}());
document.getElementById('footerNote').textContent =
'Command breakdown and failures are parsed from rtk’s text output (JSON mode doesn’t include them); ' +
'summary and daily trend come straight from rtk gain --format json; missed opportunities from rtk discover --format json.';
}());