rtk · usage report

Token Savings

Live from rtk gain + rtk discover · global scope

Daily trend

By week and month

Tokens saved by command

Top 10 — a hard cap in the tool itself, not a display choice.

Missed opportunities

Parse failures

\"\"\" % json.dumps(data)\nout = src.replace('', '\\n'+stub, 1)\npathlib.Path('/Users/jd9hall/Downloads/range-log/app/__preview.html').write_text(out)\nprint(\"ok\", len(out))\nPY\npython3 /private/tmp/claude-501/-Users-jd9hall/103d1675-2ea8-4014-b0bc-bf23b25a045b/scratchpad/mkpreview.py"}, {"base_command": "\\\n grep", "count": 10, "example": "\\\n grep -q '\\.footer-links a:hover{color:var(--link-hover)}' public/styles.css"}, {"base_command": "command", "count": 10, "example": "command -v docker"}, {"base_command": "Google Chrome\"", "count": 9, "example": "CH=\"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\""}, {"base_command": "deploy.sh", "count": 9, "example": "./deploy.sh"}, {"base_command": "npm view", "count": 8, "example": "npm view @types/spotify-web-playback-sdk versions --json 2>&1"}, {"base_command": "git Hall\"", "count": 8, "example": "git -c user.name=\"Justin Hall\" -c user.email=\"Jd9hall@gmail.com\" commit -q -m \"$(cat <<'EOF'\nNewsfeed digest: fetch, summarize, group, render\n\nPipeline: adapters -> dedupe -> article extraction -> summarize -> curate\n-> render. Adding a source of an existing kind is a sources.toml edit; a new\nkind is one function plus a registry entry.\n\nVerified against live sources: RT (100 items) and ESPN (32) via RSS, The\nRundown AI via sitemap since its beehiiv feed is disabled. Dedupe holds\nacross a live refetch.\n\nTwo findings worth keeping:\n- Feed blurbs run ~120-170 chars, so article bodies must be fetched and\n parsed; naive

scraping returns nav chrome, not prose.\n- A spoofed browser UA makes ESPN return 202 with a zero-byte body on both\n feed and article pages; an honest descriptive UA gets a clean 200.\n\nCo-Authored-By: Claude Opus 5 \nClaude-Session: https://claude.ai/code/session_01F5PRfaUnR6zKSap8t2E6K1\nEOF\n)\""}, {"base_command": "exit 1", "count": 8, "example": "exit 1"}, {"base_command": "(npm start", "count": 8, "example": "(npm start >/tmp/ph1-server.log 2>&1 & echo $! > /tmp/ph1-server.pid)"}, {"base_command": "open", "count": 7, "example": "open /Users/jd9hall/Projects/rtk-dashboard/dashboard.html"}, {"base_command": "launchctl list", "count": 7, "example": "launchctl list"}, {"base_command": "done\necho", "count": 7, "example": "done\necho \"=== icon ===\""}, {"base_command": "plutil", "count": 7, "example": "plutil -lint /Users/jd9hall/Library/LaunchAgents/com.jd9hall.rtk-dashboard.plist\nid -u"}, {"base_command": "git check-ignore", "count": 7, "example": "git check-ignore -v .env.local"}, {"base_command": "gh auth", "count": 7, "example": "gh auth status 2>&1"}, {"base_command": "\"$CHROME\"", "count": 7, "example": "\"$CHROME\" --headless=new --disable-gpu --hide-scrollbars --virtual-time-budget=3000 --window-size=1512,950 --screenshot=dash-desktop.png http://localhost:8777/__preview.html 2>&1"}, {"base_command": "}", "count": 6, "example": "}"}, {"base_command": "perl", "count": 6, "example": "perl -pi -e 's/git diff --name-only/git diff HEAD --name-only/g; s/git diff --unified=0/git diff HEAD --unified=0/g' \"$P\""}, {"base_command": "git config", "count": 6, "example": "git config user.name 2>&1"}, {"base_command": "\\\ncurl", "count": 6, "example": "\\\ncurl -sS -o /dev/null -w \"root=%{http_code}\\n\" http://localhost:8788/"}, {"base_command": "file", "count": 5, "example": "file ~/Claude/feed-digest.skill\necho \"---\"\nls -la ~/Claude/\necho \"---first bytes---\"\nxxd ~/Claude/feed-digest.skill"}, {"base_command": "git init", "count": 5, "example": "git init"}, {"base_command": "command find", "count": 5, "example": "command find /Users/jd9hall/Projects/spotify-player/src -iname \"main.tsx\""}, {"base_command": "crontab", "count": 5, "example": "crontab -l 2>&1"}, {"base_command": "}\n[", "count": 5, "example": "}\n[ \"$(grep -c 'style=\"' public/resume.html)\" -eq 0 ] || { echo \"FAIL: inline style attr\"; FAIL=1; }\n[ \"$(grep -Eic 'onclick="}, {"base_command": "(npm run", "count": 5, "example": "(npm run dev > /tmp/my-team-dev.log 2>&1 &)"}, {"base_command": "nowplaying.sh", "count": 5, "example": "./nowplaying.sh"}, {"base_command": "(DEMO=1 node", "count": 5, "example": "(DEMO=1 node server.js > \"$CLAUDE_JOB_DIR/tmp/srv.log\" 2>&1 &)"}, {"base_command": "date +%s", "count": 5, "example": "date +%s"}, {"base_command": "\"$CH\"", "count": 4, "example": "\"$CH\" --headless --disable-gpu --no-sandbox --hide-scrollbars --window-size=1500,1000 --virtual-time-budget=9000 --screenshot=\"$CLAUDE_JOB_DIR/tmp/f-ammo.png\" \"http://127.0.0.1:4310/#ammo\" >/dev/null 2>&1"}, {"base_command": "-so", "count": 4, "example": "S1=$(curl -so /dev/null -w '%{http_code}' http://localhost:3000/)"}, {"base_command": "defaults read", "count": 4, "example": "defaults read tracesOf.Uebersicht 2>/dev/null"}, {"base_command": "nohup", "count": 4, "example": "nohup \"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\" --headless=new --remote-debugging-port=9222 --user-data-dir=/tmp/iz8-chrome-profile --no-first-run --hide-scrollbars --window-size=1400,1000 about:blank > /tmp/iz8-chrome.log 2>&1 &\necho \"pid $!\""}, {"base_command": "-r", "count": 4, "example": "TOK=$(jq -r '.access_token' \"$HOME/Library/Caches/spotify-widget/token.json\" 2>/dev/null)"}, {"base_command": "mdfind", "count": 4, "example": "mdfind -name \"002_attachments.sql\" 2>/dev/null"}, {"base_command": "md5", "count": 4, "example": "md5 -q o882.jpeg ocenter.jpeg"}, {"base_command": "rm", "count": 4, "example": "OUT=/private/tmp/claude-501/-Users-jd9hall/25777818-1834-4ff8-b924-a696fdf435aa/scratchpad\nrm -f \"$OUT/word-render.pdf\"\nnohup osascript -e '\ntell application \"Microsoft Word\"\n open POSIX file \"/Users/jd9hall/Projects/personal-website/public/resume.docx\"\n delay 2\n set theDoc to active document\n save as theDoc file name \"'\"$OUT\"'/word-render.pdf\" file format format PDF\n close theDoc saving no\nend tell' >\"$OUT/osa2.log\" 2>&1 &\nOPID=$!\nPREV=-1\nfor i in $(seq 1 75)"}, {"base_command": "stat", "count": 4, "example": "stat -f \"%Sm %N\" /Users/jd9hall/Projects/rtk-dashboard/dashboard.html\necho \"--- clearing log for a clean baseline, then kickstart once more to confirm ---\"\n> /Users/jd9hall/Library/Logs/rtk-dashboard.log\nlaunchctl kickstart -k gui/501/com.jd9hall.rtk-dashboard 2>&1\nsleep 2\ncat /Users/jd9hall/Library/Logs/rtk-dashboard.log\necho \"exit status:\"\nlaunchctl print gui/501/com.jd9hall.rtk-dashboard 2>&1"}, {"base_command": "nohup npm", "count": 4, "example": "nohup npm run dev > /tmp/spotify-player-dev.log 2>&1 &\nsleep 2\ncat /tmp/spotify-player-dev.log"}, {"base_command": "claude", "count": 4, "example": "claude --help 2>&1"}, {"base_command": "shortcuts run", "count": 4, "example": "shortcuts run \"Reminders Pull\" 2>&1"}, {"base_command": "docker rm", "count": 4, "example": "docker rm -f dash-pgtest >/dev/null 2>&1"}, {"base_command": "(python3", "count": 4, "example": "(python3 -m http.server 8934 > /tmp/httpserver.log 2>&1 &)"}, {"base_command": "cd", "count": 3, "example": "OUT=/private/tmp/claude-501/-Users-jd9hall/25777818-1834-4ff8-b924-a696fdf435aa/scratchpad\ncd /Users/jd9hall/Projects/personal-website\necho \"--- renderers present? ---\"\nls -d /Applications/Microsoft\\ Word.app 2>/dev/null"}, {"base_command": "(nohup", "count": 3, "example": "(nohup ../.venv/bin/python -m http.server 8137 >/tmp/newsfeed-serve.log 2>&1 &)"}, {"base_command": "(npx vite", "count": 3, "example": "(npx vite --port 5183 > /tmp/my-team-vite.log 2>&1 &)"}, {"base_command": "git rm", "count": 3, "example": "git rm --cached index.html -q 2>&1"}, {"base_command": "nohup npx", "count": 3, "example": "nohup npx wrangler pages dev public --port 8788 > /tmp/iz8-wrangler.log 2>&1 &\necho \"started pid $!\""}, {"base_command": "\\\nlaunchctl", "count": 3, "example": "\\\nlaunchctl unload ~/Library/LaunchAgents/com.jd9hall.rtk-dashboard.plist 2>&1"}, {"base_command": "shasum", "count": 3, "example": "shasum -a 256 migrations/001_init.sql"}, {"base_command": "newclaudemd", "count": 3, "example": "newclaudemd"}, {"base_command": "git checkout", "count": 3, "example": "git checkout -b spotify-widget-volume 2>&1"}, {"base_command": "lsregister", "count": 3, "example": "/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -dump 2>/dev/null"}, {"base_command": "dataviz", "count": 3, "example": "D=/private/tmp/claude-501/bundled-skills/2.1.231/f2d5afb6614835dd0e87f8021d8c9831/dataviz"}, {"base_command": "-c \"import", "count": 3, "example": "S=$(python3 -c \"import secrets;print(secrets.token_urlsafe(32))\")\numask 077"}, {"base_command": "if [", "count": 3, "example": "TARGET=\"$HOME/Library/Application Support/\u00dcbersicht/widgets/spotify.widget\"\nLINK=\"$HOME/Projects/spotify-widget\"\nif [ -e \"$LINK\" ]"}, {"base_command": "(node", "count": 3, "example": "(node server.js >/dev/null 2>&1 & echo $! > /tmp/pw.pid)"}, {"base_command": "spotify-api.sh player", "count": 3, "example": "./spotify-api.sh player"}, {"base_command": "strings", "count": 3, "example": "strings public/assets/justin.jpg"}, {"base_command": "gsd-sdk", "count": 3, "example": "gsd-sdk --version 2>/dev/null"}, {"base_command": "push_rtk_stats.sh", "count": 3, "example": "./scripts/push_rtk_stats.sh"}, {"base_command": "sdef", "count": 2, "example": "sdef /Applications/Spotify.app > /private/tmp/claude-501/-Users-jd9hall/dbf2616b-da48-4bc5-8ef5-efed87431429/scratchpad/spotify.sdef 2>/private/tmp/claude-501/-Users-jd9hall/dbf2616b-da48-4bc5-8ef5-efed87431429/scratchpad/sdef.err"}, {"base_command": "timeout 25", "count": 2, "example": "timeout 25 ./nowplaying.sh 2>&1"}, {"base_command": "done\nPORT=$(grep", "count": 2, "example": "done\nPORT=$(grep -o \"Ready on http://localhost:[0-9]*\" /tmp/wrangler-dev-03.log"}, {"base_command": "time", "count": 2, "example": "time ./spotify-api.sh onpinned \"spotify:track:2Eh6L0CwnGJp8cXWAN0bzG\""}, {"base_command": "launchctl load", "count": 2, "example": "launchctl load ~/Library/LaunchAgents/com.jd9hall.shortcuts-runner.plist 2>&1"}, {"base_command": "-ti:8788", "count": 2, "example": "PIDS=$(lsof -ti:8788 2>/dev/null)\necho \"pids on 8788: ${PIDS:-none}\"\n[ -n \"$PIDS\" ]"}, {"base_command": "design_handoff_personal_site\"", "count": 2, "example": "D=\"/private/tmp/claude-501/-Users-jd9hall/6d082847-736b-42bb-97cf-bb86104d7c8a/scratchpad/brand-jhall/design_handoff_personal_site\""}, {"base_command": "screencapture", "count": 2, "example": "screencapture -x -D 2 shot.png"}, {"base_command": "echo \"---", "count": 2, "example": "OUT=/private/tmp/claude-501/-Users-jd9hall/25777818-1834-4ff8-b924-a696fdf435aa/scratchpad\necho \"--- osa3 log ---\""}, {"base_command": "timeout 60", "count": 2, "example": "timeout 60 shortcuts run \"Reminders Pull\" 2>&1"}, {"base_command": "done\nfor", "count": 2, "example": "done\nfor h in 5bfd6fc 7bd36c6 7d70ba7"}, {"base_command": "(nohup npx", "count": 2, "example": "(nohup npx wrangler pages dev public --port 8788 >/tmp/wr-a11y.log 2>&1 &)"}, {"base_command": "}\nSIZE=$(stat", "count": 2, "example": "}\nSIZE=$(stat -f%z public/resume.pdf)\n[ \"$SIZE\" -gt 20000 ]"}, {"base_command": "fi\ndone", "count": 2, "example": "fi\ndone\necho \"--- local playwright/puppeteer ---\"\nls node_modules 2>/dev/null"}, {"base_command": "\\\n echo", "count": 2, "example": "\\\n echo \"TASK1_GATES_PASS\""}, {"base_command": "mkdir", "count": 2, "example": "CHROME=\"/Applications/Chromium.app/Contents/MacOS/Chromium\"\nmkdir -p /tmp/shots\n\"$CHROME\" --headless=new --disable-gpu --hide-scrollbars \\\n --virtual-time-budget=4000 --window-size=1440,900 \\\n --screenshot=/tmp/shots/ladder.png \\\n \"file://$PWD/dist/wash-ladder.html\" 2>/dev/null\nls -la /tmp/shots/ladder.png 2>/dev/null"}, {"base_command": "nslookup", "count": 2, "example": "nslookup db.ywblwmbaiplnphiqzalm.supabase.co 2>&1"}, {"base_command": "(git remote", "count": 2, "example": "(git remote -v"}, {"base_command": "reminders_secret.txt)\necho", "count": 2, "example": "SECRET=$(cat /private/tmp/claude-501/-Users-jd9hall/5603f676-7097-4de5-8511-8e0f236ccb58/scratchpad/reminders_secret.txt)\necho \"--- GET before ---\"\ncurl -s \"https://sports-proxy.jd9hall.workers.dev/?reminders=1\"\necho\necho \"--- POST test payload ---\"\ncurl -s -X POST \"https://sports-proxy.jd9hall.workers.dev/?reminders=1\" \\\n -H \"Content-Type: application/json\" \\\n -H \"X-Reminders-Secret: $SECRET\" \\\n -d '{\"titles\":[\"Pick up dry cleaning\",\"Renew car registration\"],\"dueDates\":[\"2026-07-28T17:00:00Z\",\"2026-08-01T00:00:00Z\"],\"listNames\":[\"Errands\",\"Home\"]}'\necho\necho \"--- GET after ---\"\ncurl -s \"https://sports-proxy.jd9hall.workers.dev/?reminders=1\"\necho\necho \"--- wrong secret (should 401) ---\"\ncurl -s -o /dev/null -w \"%{http_code}\\n\" -X POST \"https://sports-proxy.jd9hall.workers.dev/?reminders=1\" \\\n -H \"Content-Type: application/json\" -H \"X-Reminders-Secret: wrong\" -d '{\"titles\":[]}'"}, {"base_command": "unzip", "count": 2, "example": "unzip -o \"/Users/jd9hall/Downloads/Brand JHall.zip\" -d /private/tmp/claude-501/-Users-jd9hall/6d082847-736b-42bb-97cf-bb86104d7c8a/scratchpad/brand-jhall"}, {"base_command": "shortcuts list", "count": 2, "example": "shortcuts list 2>&1"}, {"base_command": "npm init", "count": 2, "example": "npm init -y 2>&1"}, {"base_command": "}\ngrep", "count": 2, "example": "}\ngrep -q 'href=\"resume.docx\" download=' public/resume.html"}, {"base_command": "control.sh next", "count": 2, "example": "./control.sh next"}, {"base_command": "-ti:8790", "count": 2, "example": "PIDS=$(lsof -ti:8790 2>/dev/null)"}, {"base_command": "spotify-api.sh volume", "count": 2, "example": "./spotify-api.sh volume step -5"}, {"base_command": "codesign", "count": 2, "example": "codesign -dv --verbose=2 Uebersicht.app 2>&1"}, {"base_command": "\\\ngit", "count": 2, "example": "\\\ngit show HEAD~1:public/index.html > /tmp/v56-baseline/index.html"}, {"base_command": "done\nsleep", "count": 2, "example": "done\nsleep 2\necho -n \"port 8788: \""}, {"base_command": "\\\necho", "count": 2, "example": "\\\necho \"=== side-rail markup diff vs HEAD~1 ===\""}, {"base_command": "spotify-api.sh onpinned", "count": 2, "example": "./spotify-api.sh onpinned \"spotify:track:4cOdK2wGLETKBW3PvgPWqT\""}, {"base_command": "fi\n sleep", "count": 2, "example": "fi\n sleep 1\ndone\ncurl -s -o /dev/null -w 'final=%{http_code}\\n' http://localhost:8788/resume.html"}, {"base_command": "control.sh bogus", "count": 2, "example": "./control.sh bogus"}, {"base_command": "}\nPAGES=$(mdls", "count": 2, "example": "}\nPAGES=$(mdls -raw -name kMDItemNumberOfPages public/resume.pdf 2>/dev/null)\necho \"pages=$PAGES size=${SIZE}B\"\ncase \"$PAGES\" in 1"}, {"base_command": "knowledgeC.db\necho", "count": 2, "example": "DB=~/Library/Application\\ Support/Knowledge/knowledgeC.db\necho \"=== date range of /app/usage ===\"\nsqlite3 \"$DB\" \"select datetime(min(ZSTARTDATE)+978307200,'unixepoch','localtime'), datetime(max(ZSTARTDATE)+978307200,'unixepoch','localtime') from ZOBJECT where ZSTREAMNAME='/app/usage';\" 2>&1\necho \"=== top apps, last 7 days (hours) ===\"\nsqlite3 -separator ' ' \"$DB\" \"\nselect ZVALUESTRING,\n round(sum(ZENDDATE-ZSTARTDATE)/3600.0, 1) as hrs,\n count(*) as sessions\nfrom ZOBJECT\nwhere ZSTREAMNAME='/app/usage'\n and ZSTARTDATE > (strftime('%s','now','-7 days') - 978307200)\ngroup by ZVALUESTRING order by hrs desc limit 12;\" 2>&1"}, {"base_command": "i=$(grep", "count": 1, "example": "i=$(grep -c \"TrackInfoButton\" \"$f\")"}, {"base_command": "scratchpad", "count": 1, "example": "S=/private/tmp/claude-501/-Users-jd9hall-Projects-gmail-warehouse/18b428cf-473f-41c5-abe8-e1a89ace5169/scratchpad"}, {"base_command": "PlistBuddy", "count": 1, "example": "/usr/libexec/PlistBuddy -c \"Print :OSAScriptingDefinition\" /Applications/Spotify.app/Contents/Info.plist 2>&1"}, {"base_command": "260803-wl7-PLAN.md\"", "count": 1, "example": "P=\".planning/quick/260803-wl7-accessibility-pass-add-explicit-focus-vi/260803-wl7-PLAN.md\""}, {"base_command": "git ls-tree", "count": 1, "example": "git ls-tree -r --name-only spotify-widget-volume \"Library/Application Support/\u00dcbersicht/widgets/\""}, {"base_command": "spotify-api.sh $c", "count": 1, "example": "./spotify-api.sh $c"}, {"base_command": "npm pack", "count": 1, "example": "npm pack web-features --silent >/dev/null 2>&1"}, {"base_command": "textutil", "count": 1, "example": "textutil -convert txt -stdout \"/Users/jd9hall/.claude/uploads/342ac53f-8c36-4fd8-a89b-ce5e56b3ec9e/9782f1d1-ProfessionalResumeHall.docx\" 2>&1"}, {"base_command": "shortcuts view", "count": 1, "example": "shortcuts view \"Health Data Pull\" 2>&1"}, {"base_command": "default.toml\"", "count": 1, "example": "CFG=\"$HOME/Library/Preferences/.wrangler/config/default.toml\""}, {"base_command": "ditto", "count": 1, "example": "ditto -xk Uebersicht-1.6.82.app.zip ."}, {"base_command": "scratchpad\"", "count": 1, "example": "SCRATCH=\"/private/tmp/claude-501/-Users-jd9hall/342ac53f-8c36-4fd8-a89b-ce5e56b3ec9e/scratchpad\""}, {"base_command": "jobs", "count": 1, "example": "jobs -l"}, {"base_command": "pmset", "count": 1, "example": "pmset -g batt 2>/dev/null"}, {"base_command": "ctlt", "count": 1, "example": "T=/tmp/ctlt"}, {"base_command": "-i HOME=\"$HOME\"", "count": 1, "example": "env -i HOME=\"$HOME\" PATH=/usr/bin:/bin:/usr/sbin:/sbin /bin/bash ./deploy.sh"}, {"base_command": "osacompile", "count": 1, "example": "osacompile -o /tmp/np.scpt nowplaying.applescript"}, {"base_command": "for i", "count": 1, "example": "C=UCG1_A0jPBGZUpRW7XkaaBkg\nfor i in 1 2 3"}, {"base_command": "spotify-api.sh verify", "count": 1, "example": "./spotify-api.sh verify"}, {"base_command": "(rtk npm", "count": 1, "example": "(rtk npm run dev > /tmp/my-team-dev.log 2>&1 &)"}, {"base_command": "[ !", "count": 1, "example": "[ ! -f \"$summary\" ]"}, {"base_command": "date +%F", "count": 1, "example": "date +%F"}, {"base_command": "&& rm", "count": 1, "example": "T=/tmp/ctlt2 && rm -rf $T && mkdir -p $T/fakebin\ncp ~/Library/Application\\ Support/\u00dcbersicht/widgets/spotify.widget/control.sh $T/\nprintf '#!/bin/bash\\necho \"REMOTE: $*\" >> %s/calls.log\\necho %s\\n' \"$T\" \"'{\\\"ok\\\":true}'\" > $T/spotify-api.sh && chmod +x $T/spotify-api.sh\ncat > $T/fakebin/osascript <<'EOS'\n#!/bin/bash\n# Exact match on the liveness probe; anything else is a real Apple Event.\nif [ \"$2\" = 'application \"Spotify\" is running' ]; then echo \"$SPOTIFY_FAKE_RUNNING\"; else echo \"APPLE_EVENT: $2\" >> \"$LOGFILE\"; fi\nEOS\nchmod +x $T/fakebin/osascript\nexport LOGFILE=$T/calls.log\n\necho \"=== Spotify CLOSED ===\"\nSPOTIFY_FAKE_RUNNING=false; export SPOTIFY_FAKE_RUNNING\nfor c in playpause next prev; do PATH=$T/fakebin:$PATH $T/control.sh \"$c\"; done\nPATH=$T/fakebin:$PATH $T/control.sh seek 42\nPATH=$T/fakebin:$PATH $T/control.sh skip 2\ncat $T/calls.log 2>/dev/null\necho \" apple events: $(grep -c APPLE_EVENT $T/calls.log 2>/dev/null || echo 0) (must be 0)\"\n\necho; echo \"=== Spotify RUNNING ===\"\nrm -f $T/calls.log; SPOTIFY_FAKE_RUNNING=true\nfor c in playpause next prev; do PATH=$T/fakebin:$PATH $T/control.sh \"$c\"; done\nPATH=$T/fakebin:$PATH $T/control.sh seek 42\ncat $T/calls.log 2>/dev/null\necho \" remote calls: $(grep -c REMOTE $T/calls.log 2>/dev/null || echo 0) (must be 0)\"\nrm -rf $T"}, {"base_command": "health_secret.txt)\necho", "count": 1, "example": "SECRET=$(cat /private/tmp/claude-501/-Users-jd9hall/5603f676-7097-4de5-8511-8e0f236ccb58/scratchpad/health_secret.txt)\necho \"--- GET before ---\"\ncurl -s \"https://sports-proxy.jd9hall.workers.dev/?health=1\"\necho\necho \"--- POST test payload ---\"\ncurl -s -X POST \"https://sports-proxy.jd9hall.workers.dev/?health=1\" \\\n -H \"Content-Type: application/json\" \\\n -H \"X-Health-Secret: $SECRET\" \\\n -d '{\"date\":\"2026-07-26\",\"steps\":1234,\"activeEnergyKcal\":88,\"restingHeartRate\":57,\"sleep\":{\"date\":\"2026-07-25\",\"startTime\":\"2026-07-25T04:30:00Z\",\"endTime\":\"2026-07-25T11:45:00Z\",\"asleepMinutes\":410,\"inBedMinutes\":435,\"source\":\"test-curl\"}}'\necho\necho \"--- GET after ---\"\ncurl -s \"https://sports-proxy.jd9hall.workers.dev/?health=1\"\necho"}, {"base_command": "basic=$(printf '%s:%s'", "count": 1, "example": "basic=$(printf '%s:%s' \"$(kc client_id)\" \"$(kc client_secret)\""}, {"base_command": "run(){ \"$CH\"", "count": 1, "example": "CH=\"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\"\nrun(){ \"$CH\" --headless=new --disable-gpu --hide-scrollbars --no-first-run --no-default-browser-check --virtual-time-budget=2500 --screenshot=\"$1\" --window-size=\"$2\" --user-data-dir=\"$3\" \"$4\" >/dev/null 2>&1"}, {"base_command": "npm", "count": 1, "example": "npm --version"}, {"base_command": "npm cache", "count": 1, "example": "npm cache clean --force 2>&1"}, {"base_command": "nohup python3", "count": 1, "example": "nohup python3 -m http.server 8899 --bind 127.0.0.1 > /tmp/v56-baseline.log 2>&1 & echo started"}, {"base_command": "authorize?client_id=$(enc \"$CID\")&response_type=code&redirect_uri=$(enc", "count": 1, "example": "}\nURL=\"https://accounts.spotify.com/authorize?client_id=$(enc \"$CID\")&response_type=code&redirect_uri=$(enc \"http://127.0.0.1:8888/callback\")&scope=$(enc \"$SCOPES\")&show_dialog=true&state=$STATE\"\nopen \"$URL\""}, {"base_command": "done\ncat", "count": 1, "example": "done\ncat /tmp/ctlt/calls.log\necho \"--- remote calls fired while running: $(grep -c 'REMOTE CALLED' /tmp/ctlt/calls.log 2>/dev/null || echo 0) (must be 0) ---\"\nrm -rf $T"}, {"base_command": "public", "count": 1, "example": "P=/Users/jd9hall/Projects/personal-website/public"}, {"base_command": "until docker", "count": 1, "example": "until docker info >/dev/null 2>&1"}, {"base_command": "docker info", "count": 1, "example": "docker info >/dev/null 2>&1"}, {"base_command": "resume.html\"", "count": 1, "example": "D=\"/private/tmp/claude-501/-Users-jd9hall/6d082847-736b-42bb-97cf-bb86104d7c8a/scratchpad/brand-jhall/design_handoff_personal_site/public/resume.html\""}, {"base_command": "}\nif", "count": 1, "example": "}\nif [ \"$GOT_STATE\" != \"$WANT_STATE\" ]"}, {"base_command": "hourly.sh\necho", "count": 1, "example": "~/Projects/gmail-warehouse/scripts/hourly.sh\necho \"exit code: $?\"\necho \"--- tail of today's log ---\"\ntail -25 ~/Projects/gmail-warehouse/data/logs/sync-$(date +%Y%m%d).log"}, {"base_command": "npm uninstall", "count": 1, "example": "npm uninstall -g get-shit-done-cc"}, {"base_command": "knowledgeC.db\nsqlite3", "count": 1, "example": "DB=~/Library/Application\\ Support/Knowledge/knowledgeC.db\nsqlite3 \"$DB\" \"select name from sqlite_master where type='table' limit 12;\" 2>&1"}, {"base_command": "esbuild", "count": 1, "example": "esbuild --loader=jsx --outfile=/dev/null index.jsx"}, {"base_command": "date +\"EPOCH=%s\"", "count": 1, "example": "date +\"EPOCH=%s\""}, {"base_command": "health_sync_check.sh\"", "count": 1, "example": "\"/Users/jd9hall/Projects/my-team/scripts/health_sync_check.sh\""}, {"base_command": "npt", "count": 1, "example": "T=/tmp/npt"}, {"base_command": "\\\n git", "count": 1, "example": "\\\n git diff --numstat public/index.html public/styles.css"}, {"base_command": "SERVICE=\"spotify-widget\"", "count": 1, "example": "SERVICE=\"spotify-widget\""}, {"base_command": "kc(){ security", "count": 1, "example": "kc(){ security find-generic-password -s \"$SERVICE\" -a \"$1\" -w 2>/dev/null"}, {"base_command": "for host", "count": 1, "example": "UA=\"newsfeed-digest/0.1 (personal news digest; contact via repo)\"\nfor host in rawamerica rawamerican raw-america theRawAmerica rawamericanews"}, {"base_command": "npm start", "count": 1, "example": "npm start 2>&1 &\nsleep 6\ncurl -s -o /dev/null -w \"%{http_code}\\n\" http://localhost:4310/ 2>&1\necho \"--- meta ---\"\ncurl -s http://localhost:4310/api/meta 2>&1"}, {"base_command": "-h \"requirements_addressed\\|requirements:\"", "count": 1, "example": "PLAN_REQS=$(grep -h \"requirements_addressed\\|requirements:\" .planning/phases/01-real-content-in-justin-s-voice/*-PLAN.md 2>/dev/null"}, {"base_command": "deploy.sh 2>&1", "count": 1, "example": "./deploy.sh 2>&1"}, {"base_command": "$(date +%s)", "count": 1, "example": "BEFORE=\"2026-07-29T18:25:58.639+00:00\"\nDEADLINE=$(( $(date +%s) + 660 ))\nuntil [ \"$(date +%s)\" -ge \"$DEADLINE\" ]; do\n NOW=$(curl -s \"https://sports-proxy.jd9hall.workers.dev/?health=1\" | jq -r .syncedAt)\n if [ \"$NOW\" != \"$BEFORE\" ]; then\n echo \"FIRED \u2014 new sync at $NOW (local $(date '+%H:%M:%S'))\"\n curl -s \"https://sports-proxy.jd9hall.workers.dev/?health=1\" | jq -c '{date, steps, syncedAt}'\n exit 0\n fi\n sleep 20\ndone\necho \"NO SYNC by $(date '+%H:%M:%S %Z') \u2014 still $BEFORE\""}, {"base_command": "ifconfig", "count": 1, "example": "ifconfig 2>/dev/null"}, {"base_command": "ph1-server.pid)", "count": 1, "example": "SRV=$(cat /tmp/ph1-server.pid)"}, {"base_command": "launchctl kickstart", "count": 1, "example": "launchctl kickstart -k gui/501/com.jd9hall.rtk-dashboard 2>&1\nsleep 2\ncat /Users/jd9hall/Library/Logs/rtk-dashboard.log"}, {"base_command": "rmdir", "count": 1, "example": "rmdir \"/Users/jd9hall/Projects/my-team/scripts\" 2>/dev/null"}, {"base_command": "\\\n python3", "count": 1, "example": "\\\n python3 -c \"import xml.dom.minidom;xml.dom.minidom.parse('public/sitemap.xml');print('SITEMAP_OK')\""}, {"base_command": "{\n echo", "count": 1, "example": "{\n echo \"=== candidate assets ===\"\n find public src -maxdepth 3 -type f \\( -iname \"*.svg\" -o -iname \"*logo*\" -o -iname \"*mark*\" -o -iname \"*favicon*\" -o -iname \"*.png\" \\) 2>/dev/null"}, {"base_command": "\\\n(npx", "count": 1, "example": "\\\n(npx wrangler pages dev public --port 8788 >/tmp/wr.log 2>&1 &)"}, {"base_command": "fi\nCODE=$(cut", "count": 1, "example": "fi\nCODE=$(cut -f1 \"$SCRATCH/callback.txt\")\nGOT_STATE=$(cut -f2 \"$SCRATCH/callback.txt\")\nWANT_STATE=$(cat \"$SCRATCH/oauth_state\")\n\n[ \"$CODE\" = \"ERROR\" ]"}, {"base_command": "spotify-api.sh", "count": 1, "example": "./spotify-api.sh"}, {"base_command": "uname", "count": 1, "example": "uname -m\nsw_vers 2>&1"}, {"base_command": "echo\nls", "count": 1, "example": "echo\nls /Users/jd9hall/Library/Caches/ms-playwright 2>/dev/null"}, {"base_command": "launchctl bootstrap", "count": 1, "example": "launchctl bootstrap gui/501 /Users/jd9hall/Library/LaunchAgents/com.jd9hall.rtk-dashboard.plist 2>&1\necho \"exit: $?\"\necho \"---status---\"\nlaunchctl print gui/501/com.jd9hall.rtk-dashboard 2>&1"}, {"base_command": "wrangler whoami", "count": 1, "example": "wrangler whoami 2>&1"}, {"base_command": "date\necho", "count": 1, "example": "date\necho"}, {"base_command": "rtk gain", "count": 1, "example": "COLUMNS=300 rtk gain --history 2>&1"}, {"base_command": "rtk hook-audit", "count": 1, "example": "RTK_HOOK_AUDIT=1 rtk hook-audit 2>&1"}, {"base_command": "# MKBHD,", "count": 1, "example": "CH=UCBJycsmduvYEL83R_U4JriQ # MKBHD, as a test channel\ncurl -s \"https://www.youtube.com/feeds/videos.xml?channel_id=$CH\" -o /tmp/yt.xml\necho \"bytes: $(wc -c < /tmp/yt.xml)\"\npython3 - <<'EOF'\nimport re\nx=open(\"/tmp/yt.xml\").read()\nentries=re.findall(r'(.*?)', x, re.S)\nprint(\"entries:\", len(entries))\nfor e in entries[:3]:\n g=lambda p: (re.search(p,e,re.S).group(1) if re.search(p,e,re.S) else \"\")\n print(\" \u2022\", g(r'(.*?)')[:60])\n print(\" \", g(r'(.*?)'), \"|\", g(r'(.*?)'))\n print(\" thumb:\", g(r'&1", "count": 1, "example": "./nowplaying.sh 2>&1"}, {"base_command": "*.js", "count": 1, "example": "B=$(ls dist/assets/*.js"}, {"base_command": "echo \"audio-analysis:\"", "count": 1, "example": "ID=b5d6a104-026a-4a6c-9a3e-0365396f8b22\necho \"audio-analysis:\""}, {"base_command": "date +%Z", "count": 1, "example": "date +%Z"}, {"base_command": "for path", "count": 1, "example": "ID=b5d6a104-026a-4a6c-9a3e-0365396f8b22\nfor path in \"audio-analysis\" \"analysis\" \"beats\" \"sections\""}, {"base_command": "[ \"$(git", "count": 1, "example": "[ \"$(git rev-parse HEAD)\" = \"$(git rev-parse origin/main)\" ]"}, {"base_command": "VITE_SPOTIFY_CLIENT_ID", "count": 1, "example": "SPOTIFY_CLIENT_ID=$(grep VITE_SPOTIFY_CLIENT_ID .env.local"}, {"base_command": "code=$(curl", "count": 1, "example": "code=$(curl -s -o /tmp/f.xml -w \"%{http_code}\" \"https://www.youtube.com/feeds/videos.xml?channel_id=UCK3CHl-6e3hq4gQaz_TOyoQ\")\necho \"canonical id -> HTTP $code, entries: $(grep -c '' /tmp/f.xml)\"\ngrep -o '[^<]*' /tmp/f.xml"}, {"base_command": "for W", "count": 1, "example": "CH=\"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\"\nfor W in 375 768 1440 1550"}, {"base_command": "continue", "count": 1, "example": "continue"}, {"base_command": "\\\n for", "count": 1, "example": "\\\n for f in ibm-plex-sans-400 ibm-plex-sans-700 ibm-plex-mono-var"}, {"base_command": "control.sh ${=a}", "count": 1, "example": "./control.sh ${=a} 2>&1"}, {"base_command": "player", "count": 1, "example": "URI=$(./spotify-api.sh player"}, {"base_command": "fakebin:$PATH", "count": 1, "example": "done\nPATH=$T/fakebin:$PATH $T/control.sh skip 3\ncat /tmp/ctlt/calls.log\necho \"--- Apple Events fired while closed: $(grep -c 'APPLE EVENT' /tmp/ctlt/calls.log 2>/dev/null || echo 0) (must be 0) ---\"\n\necho"}, {"base_command": "-a 256", "count": 1, "example": "LOCAL=$(shasum -a 256 app/index.html"}, {"base_command": "}\nrun", "count": 1, "example": "}\nrun /tmp/unv-shots/w768.png 768,1400 /tmp/uc768 http://localhost:8788/ &\nrun /tmp/unv-shots/w1440.png 1440,1500 /tmp/uc1440 http://localhost:8788/ &\nrun /tmp/unv-shots/w1550.png 1550,1500 /tmp/uc1550 http://localhost:8788/ &\nrun /tmp/unv-shots/n404.png 1440,1000 /tmp/uc404 http://localhost:8788/nonexistent-page &\nwait\nls -la /tmp/unv-shots/"}, {"base_command": "for c", "count": 1, "example": "UA=\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0 Safari/537.36\"\nfor c in UCqFMzb-4AUf6WAIbl132QKA UC0RBTQIYLEQbcahZWkmzeTQ UCjwmbv6NE4mOh8Z8VhPUx1Q"}, {"base_command": "( \"$CH\"", "count": 1, "example": "CH=\"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\"\n( \"$CH\" --headless=old --disable-gpu --hide-scrollbars --no-first-run --virtual-time-budget=2500 \\\n --screenshot=/tmp/unv-shots/w375b.png --window-size=375,1200 --user-data-dir=/tmp/uc375b \\\n http://localhost:8788/ >/dev/null 2>&1 & \n P=$!"}, {"base_command": "npm config", "count": 1, "example": "npm config get prefix"}, {"base_command": "timeout 90", "count": 1, "example": "timeout 90 npx --yes wrangler whoami 2>&1"}, {"base_command": "{ cd", "count": 1, "example": "{ cd /Users/jd9hall/Projects/supabase-dashboard"}, {"base_command": "}\nRESP=$(curl", "count": 1, "example": "}\nRESP=$(curl -sS -m 12 -w $'\\n%{http_code}' \"https://api.spotify.com/v1/me/player\" -H \"Authorization: Bearer $TOK\")\necho \"status: ${RESP##*$'\\n'}\"\nBODY=\"${RESP%$'\\n'*}\"\necho \"--- top-level keys ---\""}, {"base_command": "(curl", "count": 1, "example": "(curl -s -o /dev/null -w \"8788:%{http_code}\\n\" http://localhost:8788/ 2>/dev/null"}, {"base_command": "(env", "count": 1, "example": "(env"}, {"base_command": "context-mode", "count": 1, "example": "context-mode --version 2>&1"}, {"base_command": "readlink \"$LINK\"", "count": 1, "example": "readlink \"$LINK\"\necho \"--- contents visible through the link ---\""}, {"base_command": "[ \"$d\"", "count": 1, "example": "[ \"$d\" = / ]"}, {"base_command": "done\ngrep", "count": 1, "example": "done\ngrep -qi 'EADDRINUSE\\|address in use' /tmp/wrangler-dev-03b.log"}, {"base_command": "spotify-api.sh playlists", "count": 1, "example": "./spotify-api.sh playlists"}, {"base_command": "\\\nls", "count": 1, "example": "\\\nls -la *.woff2"}, {"base_command": "260803-unv-PLAN.md", "count": 1, "example": "P=.planning/quick/260803-unv-adjust-the-width-of-the-main-content-are/260803-unv-PLAN.md"}, {"base_command": "-sI", "count": 1, "example": "CT=$(curl -sI http://localhost:3000/assets/justin.jpg"}, {"base_command": "\\\nSERVED=$(curl", "count": 1, "example": "\\\nSERVED=$(curl -sS http://localhost:8788/styles.css"}, {"base_command": "for f", "count": 1, "example": "D=.planning/quick/260805-v56-fix-unreachable-side-rail-links-on-scree\nfor f in public/index.html public/styles.css \"$D/260805-v56-SUMMARY.md\" \"$D/deferred-items.md\" \"$D/verify-render.mjs\" \"$D/shot-1280.png\" \"$D/shot-1600.png\""}, {"base_command": "tar", "count": 1, "example": "tar -xzf web-features-*.tgz package/data.json 2>/dev/null"}, {"base_command": "spotify-player", "count": 1, "example": "d=/Users/jd9hall/Projects/spotify-player"}, {"base_command": "(command", "count": 1, "example": "(command -v esbuild >/dev/null"}, {"base_command": "[ \"$C\"", "count": 1, "example": "[ \"$C\" = \"200\" ]"}, {"base_command": "nohup env", "count": 1, "example": "nohup env PORT=4311 DEMO=1 node server.js > /private/tmp/claude-501/-Users-jd9hall/6d05a7b4-9508-4c99-adc4-929e7a295c7a/scratchpad/demo.log 2>&1 &\nsleep 3"}, {"base_command": "done\ntest", "count": 1, "example": "done\ntest ! -e server.js"}, {"base_command": "\\\ngrep", "count": 1, "example": "\\\ngrep -c 'footer-links' /tmp/v56-baseline/index.html /tmp/v56-baseline/styles.css"}, {"base_command": "workerd", "count": 1, "example": "node_modules/workerd/bin/workerd --version 2>&1"}, {"base_command": "does NOT", "count": 1, "example": "does NOT deploy)\n.venv/bin/python build_digest.py 2>&1"}, {"base_command": "( sleep", "count": 1, "example": "( sleep 45"}, {"base_command": "fi\necho", "count": 1, "example": "fi\necho \"callback OK, state verified, code length ${#CODE}\""}, {"base_command": "until tail", "count": 1, "example": "until tail -3 ~/Library/Logs/rtk-dashboard.log"}, {"base_command": "launchctl print", "count": 1, "example": "launchctl print gui/$(id -u)/com.jd9hall.newsfeed-digest 2>&1"}, {"base_command": "break\n d=$(dirname", "count": 1, "example": "break\n d=$(dirname \"$d\")\ndone"}, {"base_command": "shortcuts", "count": 1, "example": "shortcuts --help 2>&1"}, {"base_command": "-o ppid=", "count": 1, "example": "PARENT=$(ps -o ppid= -p $(lsof -ti:8788 2>/dev/null"}, {"base_command": "sed", "count": 1, "example": "/usr/bin/sed -i '' '276,277d' \".planning/quick/260804-g3y-fix-missing-hover-feedback-on-side-rail-/260804-g3y-PLAN.md\""}, {"base_command": "readlink", "count": 1, "example": "readlink ~/projects/gmail-warehouse"}, {"base_command": "# make", "count": 1, "example": "# make sure a dev server is running\nif ! curl -s -o /dev/null http://127.0.0.1:5173/ 2>/dev/null"}, {"base_command": "npm i", "count": 1, "example": "npm i --silent esbuild react react-dom >/dev/null 2>&1"}, {"base_command": "spotify-api.sh devices", "count": 1, "example": "./spotify-api.sh devices"}, {"base_command": "pinned.json", "count": 1, "example": "C=~/Library/Caches/spotify-widget/pinned.json"}, {"base_command": "oauth_state\")\nCID=$(security", "count": 1, "example": "SCRATCH=\"/private/tmp/claude-501/-Users-jd9hall/02c194bc-158c-48df-a1bd-36d5484973a6/scratchpad\"\nSTATE=$(cat \"$SCRATCH/oauth_state\")\nCID=$(security find-generic-password -s spotify-widget -a client_id -w 2>/dev/null)\nSCOPES=\"user-read-playback-state user-library-read user-library-modify user-modify-playback-state playlist-read-private playlist-modify-private playlist-modify-public\"\nenc(){ jq -rn --arg v \"$1\" '$v|@uri'"}, {"base_command": "done\ncurl", "count": 1, "example": "done\ncurl -s http://127.0.0.1:9222/json/version\necho \"--- running harness ---\"\nnode /tmp/g3y-cdp.mjs"}, {"base_command": "echo \"batting", "count": 1, "example": "S=/private/tmp/claude-501/-Users-jd9hall/c37c8f62-95d5-4f9e-b0ef-efc56b48f196/scratchpad/live.json\necho \"batting keys: $(jq -r '.boxscore.players[0].statistics[0].keys | join(\" \")' $S)\"\necho \"pitching keys: $(jq -r '.boxscore.players[0].statistics[1].keys | join(\" \")' $S)\""}, {"base_command": "spotify-api.sh transport", "count": 1, "example": "./spotify-api.sh transport bogus"}, {"base_command": "python3.14", "count": 1, "example": "/Library/Frameworks/Python.framework/Versions/3.14/bin/python3.14 -m venv --clear .venv"}, {"base_command": "p=$(grep", "count": 1, "example": "p=$(grep -c \"AddToPlaylistButton\" \"$f\")"}, {"base_command": "npm ls", "count": 1, "example": "npm ls -g context-mode --depth=0 2>&1"}], "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": 292496}; 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.'; }());