Earlier this week, my yearly Claude Pro subscription auto-renewed. This seems to have triggered a “service improvement”, making me subject to weekly limits. I had heard of these, but had until then only been subject to the 5h session limits.
With this came a new form of anxiety summarized as “OMG I think I might be ahead in my consumption of the weekly limit, compared to the passage of time.”
To fight this new existential dread and live with facts not fear, I overlay the week’s time elapsed against the token usage progress, directly on the Claude usage page.
I use a bookmarklet for this: tgif-claude. It auto-refreshes, but obviously requires to be clicked on when the page is loaded (a userscript manager or full-on browser add-on seemed overkill).
Copy it from here:
javascript:(function%20()%20%7B%20var%20WEEK_MS%20%3D%207%20*%2024%20*%2060%20*%2060%20*%201000%3B%20var%20SESSION_MS%20%3D%205%20*%2060%20*%2060%20*%201000%3B%20var%20DAY_MS%20%3D%2024%20*%2060%20*%2060%20*%201000%3B%20var%20HOUR_MS%20%3D%2060%20*%2060%20*%201000%3B%20var%20MIN_MS%20%3D%2060%20*%201000%3B%20var%20TOOLTIP_TOLERANCE_MS%20%3D%202%20*%20HOUR_MS%3B%20function%20teardown()%20%7B%20var%20prev%20%3D%20window.__tgif%3B%20if%20(prev)%20%7B%20(prev.intervals%20%7C%7C%20%5B%5D).forEach(clearInterval)%3B%20(prev.observers%20%7C%7C%20%5B%5D).forEach(function%20(o)%20%7B%20o.disconnect()%3B%20%7D)%3B%20%7D%20window.__tgif%20%3D%20%7B%20intervals%3A%20%5B%5D%2C%20observers%3A%20%5B%5D%20%7D%3B%20Array.from(document.querySelectorAll('%5Bdata-tgif%5D')).forEach(function%20(el)%20%7B%20el.remove()%3B%20%7D)%3B%20%7D%20function%20track(kind%2C%20value)%20%7B%20window.__tgif%5Bkind%5D.push(value)%3B%20return%20value%3B%20%7D%20function%20roundToHour(date)%20%7B%20if%20(date.getMinutes()%20%3E%3D%2030)%20date.setHours(date.getHours()%20%2B%201)%3B%20date.setMinutes(0%2C%200%2C%200)%3B%20return%20date%3B%20%7D%20function%20roundToTenMinutes(date)%20%7B%20date.setMinutes(Math.round(date.getMinutes()%20%2F%2010)%20*%2010%2C%200%2C%200)%3B%20return%20date%3B%20%7D%20function%20formatClockTime(lang%2C%20date)%20%7B%20var%20h%20%3D%20date.getHours()%3B%20var%20m%20%3D%20date.getMinutes()%3B%20var%20mm%20%3D%20(m%20%3C%2010%20%3F%20'0'%20%3A%20'')%20%2B%20m%3B%20if%20(lang.ampm)%20%7B%20return%20(h%20%25%2012%20%7C%7C%2012)%20%2B%20'%3A'%20%2B%20mm%20%2B%20(h%20%3E%3D%2012%20%3F%20'%20PM'%20%3A%20'%20AM')%3B%20%7D%20return%20h%20%2B%20'%3A'%20%2B%20mm%3B%20%7D%20function%20formatTooltipTime(lang%2C%20date)%20%7B%20return%20lang.dayNames%5Bdate.getDay()%5D%20%2B%20'%20'%20%2B%20formatClockTime(lang%2C%20date)%3B%20%7D%20function%20formatDuration(ms)%20%7B%20var%20days%20%3D%20Math.floor(ms%20%2F%20DAY_MS)%3B%20var%20hours%20%3D%20Math.floor((ms%20%25%20DAY_MS)%20%2F%20HOUR_MS)%3B%20var%20mins%20%3D%20Math.floor((ms%20%25%20HOUR_MS)%20%2F%20MIN_MS)%3B%20var%20parts%20%3D%20%5B%5D%3B%20if%20(days%20%3E%200)%20parts.push(days%20%2B%20'd')%3B%20if%20(hours%20%3E%200%20%7C%7C%20days%20%3E%200)%20parts.push(hours%20%2B%20'h')%3B%20parts.push(mins%20%2B%20'm')%3B%20return%20parts.join('%20')%3B%20%7D%20function%20parseRelative(text%2C%20relParse)%20%7B%20var%20m%20%3D%20text.match(relParse)%3B%20if%20(!m)%20return%20null%3B%20var%20d%20%3D%20parseInt(m%5B1%5D%2C%2010)%20%7C%7C%200%3B%20var%20h%20%3D%20parseInt(m%5B2%5D%2C%2010)%20%7C%7C%200%3B%20var%20mi%20%3D%20parseInt(m%5B3%5D%2C%2010)%20%7C%7C%200%3B%20return%20((d%20*%2024%20%2B%20h)%20*%2060%20%2B%20mi)%20*%20MIN_MS%3B%20%7D%20function%20dispatchHover(el%2C%20entering)%20%7B%20var%20types%20%3D%20entering%20%3F%20%5B'pointerover'%2C%20'pointerenter'%2C%20'mouseover'%2C%20'mouseenter'%5D%20%3A%20%5B'pointerout'%2C%20'pointerleave'%2C%20'mouseout'%2C%20'mouseleave'%5D%3B%20types.forEach(function%20(type)%20%7B%20var%20Ctor%20%3D%20(type.indexOf('pointer')%20%3D%3D%3D%200%20%26%26%20window.PointerEvent)%20%7C%7C%20MouseEvent%3B%20el.dispatchEvent(new%20Ctor(type%2C%20%7B%20bubbles%3A%20%2Fover%7Cout%2F.test(type)%2C%20cancelable%3A%20true%2C%20view%3A%20window%2C%20relatedTarget%3A%20document.body%2C%20pointerType%3A%20'mouse'%2C%20%7D))%3B%20%7D)%3B%20%7D%20function%20tooltipFor(trigger)%20%7B%20var%20id%20%3D%20trigger.getAttribute('popovertarget')%20%7C%7C%20trigger.getAttribute('aria-describedby')%3B%20return%20id%20%3F%20document.getElementById(id)%20%3A%20null%3B%20%7D%20function%20tooltipText(tip)%20%7B%20return%20tip.textContent.replace(%2F%5Cs%2B%2Fg%2C%20'%20').trim()%3B%20%7D%20function%20revealTooltip(trigger%2C%20tip)%20%7B%20return%20new%20Promise(function%20(resolve)%20%7B%20var%20focused%20%3D%20document.activeElement%3B%20var%20settled%20%3D%20false%3B%20var%20observer%20%3D%20new%20MutationObserver(function%20()%20%7B%20if%20(tooltipText(tip))%20finish()%3B%20%7D)%3B%20function%20finish()%20%7B%20if%20(settled)%20return%3B%20settled%20%3D%20true%3B%20observer.disconnect()%3B%20var%20text%20%3D%20tooltipText(tip)%3B%20dispatchHover(trigger%2C%20false)%3B%20try%20%7B%20tip.hidePopover()%3B%20%7D%20catch%20(e)%20%7B%7D%20trigger.blur()%3B%20if%20(focused%20%26%26%20focused%20!%3D%3D%20document.body%20%26%26%20focused.isConnected)%20%7B%20focused.focus(%7B%20preventScroll%3A%20true%20%7D)%3B%20%7D%20tip.style.visibility%20%3D%20''%3B%20resolve(text%20%7C%7C%20null)%3B%20%7D%20observer.observe(tip%2C%20%7B%20childList%3A%20true%2C%20subtree%3A%20true%2C%20characterData%3A%20true%20%7D)%3B%20tip.style.visibility%20%3D%20'hidden'%3B%20dispatchHover(trigger%2C%20true)%3B%20trigger.focus(%7B%20preventScroll%3A%20true%20%7D)%3B%20try%20%7B%20tip.showPopover()%3B%20%7D%20catch%20(e)%20%7B%7D%20setTimeout(finish%2C%201500)%3B%20%7D)%3B%20%7D%20function%20parseTooltipTime(text%2C%20expectedMs%2C%20lang)%20%7B%20var%20time%20%3D%20text.match(%2F(%5Cd%7B1%2C2%7D)%3A(%5Cd%7B2%7D)(%3F%3A%3A%5Cd%7B2%7D)%3F(%3F%3A%5Cs*(%5Bap%5D)%5C.%3Fm%5Cb%5C.%3F)%3F%2Fi)%3B%20if%20(!time)%20return%20null%3B%20var%20hour%20%3D%20parseInt(time%5B1%5D%2C%2010)%3B%20var%20minute%20%3D%20parseInt(time%5B2%5D%2C%2010)%3B%20var%20meridiem%20%3D%20(time%5B3%5D%20%7C%7C%20'').toLowerCase()%3B%20if%20(meridiem%20%3D%3D%3D%20'p'%20%26%26%20hour%20!%3D%3D%2012)%20hour%20%2B%3D%2012%3B%20if%20(meridiem%20%3D%3D%3D%20'a'%20%26%26%20hour%20%3D%3D%3D%2012)%20hour%20%3D%200%3B%20var%20rest%20%3D%20text.toLowerCase().replace(time%5B0%5D.toLowerCase()%2C%20'%20')%3B%20var%20md%20%3D%20rest.match(%2F%5Cb(jan%7Cfeb%7Cmar%7Capr%7Cmay%7Cjun%7Cjul%7Caug%7Csep%7Coct%7Cnov%7Cdec)%5Ba-z%5D*%5C.%3F%5Cs%2B(%5Cd%7B1%2C2%7D)%5Cb%2F)%3B%20var%20dm%20%3D%20rest.match(%2F%5Cb(%5Cd%7B1%2C2%7D)%5Cs%2B(jan%7Cfeb%7Cmar%7Capr%7Cmay%7Cjun%7Cjul%7Caug%7Csep%7Coct%7Cnov%7Cdec)%5Ba-z%5D*%2F)%3B%20var%20wd%20%3D%20rest.match(lang.weekday)%3B%20var%20expected%20%3D%20new%20Date(expectedMs)%3B%20var%20candidates%20%3D%20%5B%5D%3B%20if%20(md%20%7C%7C%20dm)%20%7B%20var%20month%20%3D%20lang.months%5Bmd%20%3F%20md%5B1%5D%20%3A%20dm%5B2%5D%5D%3B%20var%20day%20%3D%20parseInt(md%20%3F%20md%5B2%5D%20%3A%20dm%5B1%5D%2C%2010)%3B%20%5B-1%2C%200%2C%201%5D.forEach(function%20(dy)%20%7B%20candidates.push(new%20Date(expected.getFullYear()%20%2B%20dy%2C%20month%2C%20day%2C%20hour%2C%20minute))%3B%20%7D)%3B%20%7D%20else%20%7B%20var%20weekday%20%3D%20wd%20%3F%20lang.days%5Bwd%5B1%5D%5D%20%3A%20-1%3B%20for%20(var%20offset%20%3D%20-8%3B%20offset%20%3C%3D%208%3B%20offset%2B%2B)%20%7B%20var%20c%20%3D%20new%20Date(expected.getFullYear()%2C%20expected.getMonth()%2C%20expected.getDate()%20%2B%20offset%2C%20hour%2C%20minute)%3B%20if%20(weekday%20%3C%200%20%7C%7C%20c.getDay()%20%3D%3D%3D%20weekday)%20candidates.push(c)%3B%20%7D%20%7D%20var%20best%20%3D%20candidates.reduce(function%20(a%2C%20b)%20%7B%20return%20Math.abs(b%20-%20expectedMs)%20%3C%20Math.abs(a%20-%20expectedMs)%20%3F%20b%20%3A%20a%3B%20%7D)%3B%20return%20Math.abs(best%20-%20expectedMs)%20%3C%3D%20TOOLTIP_TOLERANCE_MS%20%3F%20best.getTime()%20%3A%20null%3B%20%7D%20function%20textNodes(root)%20%7B%20return%20Array.from(root.querySelectorAll('p%2C%20span%2C%20div'))%3B%20%7D%20function%20findByText(root%2C%20text)%20%7B%20return%20textNodes(root).find(function%20(el)%20%7B%20return%20el.textContent.trim()%20%3D%3D%3D%20text%3B%20%7D)%3B%20%7D%20function%20createMarker()%20%7B%20var%20marker%20%3D%20document.createElement('div')%3B%20marker.dataset.tgif%20%3D%20'marker'%3B%20marker.style.cssText%20%3D%20'position%3Aabsolute%3Btop%3A0%3Bheight%3A100%25%3Bwidth%3A3px%3B'%20%2B%20'background%3A%23f97316%3Bpointer-events%3Anone%3Bborder-radius%3A1px%3B'%3B%20return%20marker%3B%20%7D%20function%20createTooltip()%20%7B%20var%20tooltip%20%3D%20document.createElement('div')%3B%20tooltip.dataset.tgif%20%3D%20'tooltip'%3B%20tooltip.style.cssText%20%3D%20'position%3Afixed%3Bdisplay%3Anone%3Bpointer-events%3Anone%3B'%20%2B%20'background%3A%231e1e2e%3Bcolor%3A%23fff%3Bfont-size%3A11px%3Bpadding%3A3px%207px%3B'%20%2B%20'border-radius%3A4px%3Bwhite-space%3Anowrap%3Bz-index%3A9999%3B'%3B%20var%20text%20%3D%20document.createElement('span')%3B%20tooltip.appendChild(text)%3B%20var%20arrow%20%3D%20document.createElement('div')%3B%20arrow.style.cssText%20%3D%20'position%3Aabsolute%3Bleft%3A50%25%3Btransform%3AtranslateX(-50%25)%3Btop%3A100%25%3B'%20%2B%20'border%3A5px%20solid%20transparent%3Bborder-top-color%3A%23fff%3B'%3B%20tooltip.appendChild(arrow)%3B%20document.body.appendChild(tooltip)%3B%20return%20%7B%20el%3A%20tooltip%2C%20text%3A%20text%20%7D%3B%20%7D%20function%20attachHoverTooltip(bar%2C%20getState%2C%20lang)%20%7B%20var%20tooltip%20%3D%20createTooltip()%3B%20bar.addEventListener('mousemove'%2C%20function%20(e)%20%7B%20var%20state%20%3D%20getState()%3B%20if%20(!state)%20return%3B%20var%20rect%20%3D%20bar.getBoundingClientRect()%3B%20var%20pct%20%3D%20Math.max(0%2C%20Math.min(100%2C%20((e.clientX%20-%20rect.left)%20%2F%20rect.width)%20*%20100))%3B%20if%20(state.inverted)%20pct%20%3D%20100%20-%20pct%3B%20var%20time%20%3D%20new%20Date(state.windowStartMs%20%2B%20(pct%20%2F%20100)%20*%20state.windowMs)%3B%20tooltip.text.textContent%20%3D%20formatTooltipTime(lang%2C%20time)%3B%20tooltip.el.style.display%20%3D%20'block'%3B%20tooltip.el.style.left%20%3D%20(e.clientX%20-%20(tooltip.el.offsetWidth%20%2F%202))%20%2B%20'px'%3B%20tooltip.el.style.top%20%3D%20(rect.top%20-%20tooltip.el.offsetHeight%20-%208)%20%2B%20'px'%3B%20%7D)%3B%20bar.addEventListener('mouseleave'%2C%20function%20()%20%7B%20tooltip.el.style.display%20%3D%20'none'%3B%20%7D)%3B%20%7D%20function%20renderPace(lang%2C%20label%2C%20opts)%20%7B%20var%20usagePct%20%3D%20opts.usagePct%3B%20var%20elapsedPct%20%3D%20Math.max(0%2C%20Math.min(100%2C%20((opts.windowMs%20-%20opts.msLeft)%20%2F%20opts.windowMs)%20*%20100))%3B%20var%20windowStartMs%20%3D%20Date.now()%20%2B%20opts.msLeft%20-%20opts.windowMs%3B%20var%20delta%20%3D%20usagePct%20-%20elapsedPct%3B%20var%20overPace%20%3D%20delta%20%3E%200%3B%20var%20statusColor%20%3D%20overPace%20%3F%20'%23dc2626'%20%3A%20'%2316a34a'%3B%20var%20usageTime%20%3D%20formatTooltipTime(lang%2C%20new%20Date(windowStartMs%20%2B%20(usagePct%20%2F%20100)%20*%20opts.windowMs))%3B%20var%20deltaTimeStr%20%3D%20formatDuration(Math.abs(delta)%20%2F%20100%20*%20opts.windowMs)%20%2B%20'%20'%20%2B%20(overPace%20%3F%20lang.ahead%20%3A%20lang.behind)%3B%20if%20(opts.marker)%20%7B%20opts.marker.style.left%20%3D%20(opts.inverted%20%3F%20100%20-%20elapsedPct%20%3A%20elapsedPct).toFixed(2)%20%2B%20'%25'%3B%20%7D%20label.innerHTML%20%3D%20lang.timeElapsed%20%2B%20'%20%3Cb%3E'%20%2B%20elapsedPct.toFixed(1)%20%2B%20'%25%3C%2Fb%3E'%20%2B%20'%20%7C%20'%20%2B%20lang.resetsIn%20%2B%20'%20%3Cb%3E'%20%2B%20formatDuration(opts.msLeft)%20%2B%20'%3C%2Fb%3E'%20%2B%20'%3Cbr%3E'%20%2B%20'Delta%3A%20%3Cb%20style%3D%22color%3A'%20%2B%20statusColor%20%2B%20'%22%3E'%20%2B%20(delta%20%3E%3D%200%20%3F%20'%2B'%20%3A%20'')%20%2B%20delta.toFixed(1)%20%2B%20'%25%20%E2%80%94%20'%20%2B%20deltaTimeStr%20%2B%20'%3C%2Fb%3E'%20%2B%20'%20%3Cspan%20style%3D%22opacity%3A0.7%22%3E(%E2%89%88%20'%20%2B%20usageTime%20%2B%20')%3C%2Fspan%3E'%3B%20return%20%7B%20windowStartMs%3A%20windowStartMs%2C%20windowMs%3A%20opts.windowMs%2C%20inverted%3A%20opts.inverted%20%7D%3B%20%7D%20var%20CLAUDE_LANGS%20%3D%20%7B%20en%3A%20%7B%20detect%3A%20%2F%5EResets%20%5Cw%2B%20%5Cd%7B1%2C2%7D%3A%5Cd%7B2%7D%20%5BAP%5DM%24%2F%2C%20parse%3A%20%2FResets%20(%5Cw%2B)%20(%5Cd%2B)%3A(%5Cd%2B)%20(%5BAP%5DM)%2F%2C%20relative%3A%20%2F%5EResets%20in%20%2F%2C%20relParse%3A%20%2FResets%20in%20(%3F%3A(%5Cd%2B)%5Cs*d%5Cs*)%3F(%3F%3A(%5Cd%2B)%5Cs*hr%3F%5Cs*)%3F(%3F%3A(%5Cd%2B)%5Cs*min)%3F%2F%2C%20days%3A%20%7B%20Sun%3A%200%2C%20Mon%3A%201%2C%20Tue%3A%202%2C%20Wed%3A%203%2C%20Thu%3A%204%2C%20Fri%3A%205%2C%20Sat%3A%206%20%7D%2C%20dayNames%3A%20%5B'Sun'%2C%20'Mon'%2C%20'Tue'%2C%20'Wed'%2C%20'Thu'%2C%20'Fri'%2C%20'Sat'%5D%2C%20ampm%3A%20true%2C%20startsText%3A%20%2F%5EStarts%20(%3F%3Awhen%20a%20message%20is%20sent%7Cwith%20your%20first%20message)%24%2F%2C%20wouldEndAt%3A%20'would%20end%20at'%2C%20ifStartedNow%3A%20'if%20started%20now'%2C%20lastUpdated%3A%20'Last%20updated%3A'%2C%20sessionText%3A%20'Current%20session'%2C%20timeElapsed%3A%20'Elapsed%3A'%2C%20resetsIn%3A%20'Resets%20in'%2C%20overPace%3A%20'over%20pace'%2C%20underPace%3A%20'under%20pace'%2C%20ahead%3A%20'ahead'%2C%20behind%3A%20'behind'%2C%20parseError%3A%20'tgif-claude%3A%20could%20not%20parse%20reset%20time'%2C%20notFound%3A%20'tgif-claude%3A%20weekly%20reset%20text%20not%20found'%2C%20weeklyHeading%3A%20'Weekly%20limits'%2C%20weeklyText%3A%20'This%20week'%2C%20%7D%2C%20fr%3A%20%7B%20detect%3A%20%2F%5ER%C3%A9initialisation%20%5Cw%7B3%7D%5C.%20%5Cd%7B1%2C2%7D%3A%5Cd%7B2%7D%24%2F%2C%20parse%3A%20%2FR%C3%A9initialisation%20(%5Cw%2B)%5C.%20(%5Cd%2B)%3A(%5Cd%2B)%2F%2C%20relative%3A%20%2F%5ER%C3%A9initialisation%20dans%20%2F%2C%20relParse%3A%20%2FR%C3%A9initialisation%20dans%20(%3F%3A(%5Cd%2B)%5Cs*j%5Cs*)%3F(%3F%3A(%5Cd%2B)%5Cs*h%5Cs*)%3F(%3F%3A(%5Cd%2B)%5Cs*min)%3F%2F%2C%20days%3A%20%7B%20dim%3A%200%2C%20lun%3A%201%2C%20mar%3A%202%2C%20mer%3A%203%2C%20jeu%3A%204%2C%20ven%3A%205%2C%20sam%3A%206%20%7D%2C%20dayNames%3A%20%5B'dim'%2C%20'lun'%2C%20'mar'%2C%20'mer'%2C%20'jeu'%2C%20'ven'%2C%20'sam'%5D%2C%20ampm%3A%20false%2C%20startsText%3A%20%2F%5ECommence%20quand%20un%20message%20est%20envoy%C3%A9%24%2F%2C%20wouldEndAt%3A%20'se%20terminerait%20%C3%A0'%2C%20ifStartedNow%3A%20'si%20d%C3%A9marr%C3%A9e%20maintenant'%2C%20lastUpdated%3A%20'Derni%C3%A8re%20mise%20%C3%A0%20jour%20%3A'%2C%20sessionText%3A%20'Session%20actuelle'%2C%20timeElapsed%3A%20'%C3%89coul%C3%A9%20%3A'%2C%20resetsIn%3A%20'R%C3%A9init.%20dans'%2C%20overPace%3A%20'en%20avance'%2C%20underPace%3A%20'en%20retard'%2C%20ahead%3A%20'd%5C'avance'%2C%20behind%3A%20'de%20retard'%2C%20parseError%3A%20'tgif-claude%20%3A%20impossible%20de%20lire%20l%E2%80%99heure%20de%20r%C3%A9initialisation'%2C%20notFound%3A%20'tgif-claude%20%3A%20texte%20de%20r%C3%A9initialisation%20hebdomadaire%20introuvable'%2C%20weeklyHeading%3A%20'Limites%20hebdomadaires'%2C%20weeklyText%3A%20'Cette%20semaine'%2C%20%7D%2C%20%7D%3B%20function%20runClaude()%20%7B%20var%20htmlLang%20%3D%20(document.documentElement.getAttribute('lang')%20%7C%7C%20'en').toLowerCase().split('-')%5B0%5D%3B%20var%20lang%20%3D%20CLAUDE_LANGS%5BhtmlLang%5D%20%7C%7C%20CLAUDE_LANGS.en%3B%20var%20BAR_SELECTOR%20%3D%20'%5Brole%3D%22meter%22%5D%2C%20%5Brole%3D%22progressbar%22%5D'%3B%20function%20findRow(el)%20%7B%20var%20node%20%3D%20el.parentElement%3B%20while%20(node%20%26%26%20!node.querySelector(BAR_SELECTOR))%20node%20%3D%20node.parentElement%3B%20return%20node%3B%20%7D%20var%20weeklyLabel%20%3D%20findByText(document%2C%20lang.weeklyText)%3B%20var%20weeklySection%20%3D%20weeklyLabel%20%26%26%20findRow(weeklyLabel)%3B%20if%20(!weeklySection)%20%7B%20var%20weeklyHeading%20%3D%20Array.from(document.querySelectorAll('h2%2C%20h3')).find(function%20(h)%20%7B%20return%20h.textContent.trim()%20%3D%3D%3D%20lang.weeklyHeading%3B%20%7D)%3B%20weeklySection%20%3D%20weeklyHeading%20%26%26%20(weeklyHeading.closest('section')%20%7C%7C%20weeklyHeading.closest('.space-y-6'))%3B%20if%20(!weeklySection)%20weeklySection%20%3D%20weeklyHeading%20%26%26%20weeklyHeading.parentElement%20%26%26%20weeklyHeading.parentElement.parentElement%3B%20%7D%20if%20(!weeklySection)%20%7B%20alert(lang.notFound)%3B%20return%3B%20%7D%20var%20dialog%20%3D%20weeklySection.closest('%5Brole%3D%22dialog%22%5D')%3B%20if%20(dialog)%20%7B%20dialog.style.maxWidth%20%3D%20'none'%3B%20dialog.style.maxHeight%20%3D%20'none'%3B%20dialog.style.width%20%3D%20'100vw'%3B%20dialog.style.height%20%3D%20'100vh'%3B%20dialog.style.inset%20%3D%20'0'%3B%20dialog.style.margin%20%3D%20'0'%3B%20dialog.style.borderRadius%20%3D%20'0'%3B%20%7D%20var%20weeklyPs%20%3D%20Array.from(weeklySection.querySelectorAll('p%2C%20span'))%3B%20var%20resetEl%20%3D%20weeklyPs.find(function%20(p)%20%7B%20return%20lang.detect.test(p.textContent.trim())%3B%20%7D)%3B%20if%20(!resetEl)%20%7B%20resetEl%20%3D%20weeklyPs.find(function%20(p)%20%7B%20return%20lang.relative.test(p.textContent.trim())%3B%20%7D)%3B%20%7D%20if%20(!resetEl)%20%7B%20var%20startsEl%20%3D%20weeklyPs.find(function%20(p)%20%7B%20return%20lang.startsText.test(p.textContent.trim())%3B%20%7D)%3B%20if%20(startsEl)%20%7B%20var%20weeklyEndAt%20%3D%20roundToHour(new%20Date(Date.now()%20%2B%20WEEK_MS))%3B%20var%20startsSpan%20%3D%20document.createElement('span')%3B%20startsSpan.dataset.tgif%20%3D%20'weekly-starts'%3B%20startsSpan.textContent%20%3D%20'%20('%20%2B%20lang.wouldEndAt%20%2B%20'%20'%20%2B%20formatTooltipTime(lang%2C%20weeklyEndAt)%20%2B%20'%20'%20%2B%20lang.ifStartedNow%20%2B%20')'%3B%20startsEl.appendChild(startsSpan)%3B%20var%20waitObserver%20%3D%20track('observers'%2C%20new%20MutationObserver(function%20()%20%7B%20waitObserver.disconnect()%3B%20runClaude()%3B%20%7D))%3B%20waitObserver.observe(weeklySection%2C%20%7B%20childList%3A%20true%2C%20subtree%3A%20true%2C%20characterData%3A%20true%20%7D)%3B%20return%3B%20%7D%20alert(lang.notFound)%3B%20return%3B%20%7D%20var%20row%20%3D%20findRow(resetEl)%3B%20var%20barContainer%20%3D%20row%20%26%26%20row.querySelector(BAR_SELECTOR)%3B%20if%20(!barContainer)%20return%3B%20var%20lastUpdatedEl%20%3D%20Array.from(document.querySelectorAll('p%2C%20span')).find(function%20(p)%20%7B%20return%20p.textContent.trim().startsWith(lang.lastUpdated)%3B%20%7D)%3B%20function%20readUsagePct(bar)%20%7B%20var%20valueNow%20%3D%20bar.getAttribute('aria-valuenow')%3B%20if%20(valueNow%20!%3D%3D%20null%20%26%26%20valueNow%20!%3D%3D%20'')%20return%20parseFloat(valueNow)%20%7C%7C%200%3B%20var%20fill%20%3D%20bar.querySelector('%5Bstyle*%3D%22width%22%5D')%20%7C%7C%20bar.firstElementChild%3B%20return%20(fill%20%26%26%20parseFloat(fill.style.width))%20%7C%7C%200%3B%20%7D%20function%20updateSession()%20%7B%20var%20existing%20%3D%20document.querySelector('%5Bdata-tgif%3D%22session%22%5D')%3B%20if%20(existing)%20existing.remove()%3B%20var%20lel%20%3D%20Array.from(document.querySelectorAll('p%2C%20span')).find(function%20(p)%20%7B%20return%20p.textContent.trim()%20%3D%3D%3D%20lang.sessionText%3B%20%7D)%3B%20if%20(!lel)%20return%3B%20var%20sessionRow%20%3D%20findRow(lel)%3B%20if%20(!sessionRow)%20return%3B%20var%20els%20%3D%20Array.from(sessionRow.querySelectorAll('p%2C%20span'))%3B%20var%20span%20%3D%20document.createElement('span')%3B%20span.dataset.tgif%20%3D%20'session'%3B%20var%20sel%20%3D%20els.find(function%20(p)%20%7B%20return%20lang.relative.test(p.textContent.trim())%3B%20%7D)%3B%20if%20(sel)%20%7B%20var%20ms%20%3D%20parseRelative(sel.textContent.trim()%2C%20lang.relParse)%3B%20if%20(ms%20%3D%3D%3D%20null)%20return%3B%20var%20resetAt%20%3D%20roundToTenMinutes(new%20Date(Date.now()%20%2B%20ms))%3B%20span.textContent%20%3D%20'%20(at%20'%20%2B%20formatClockTime(lang%2C%20resetAt)%20%2B%20')'%3B%20sel.appendChild(span)%3B%20return%3B%20%7D%20var%20startsEl%20%3D%20els.find(function%20(p)%20%7B%20return%20lang.startsText.test(p.textContent.trim())%3B%20%7D)%3B%20if%20(!startsEl)%20return%3B%20var%20endAt%20%3D%20roundToTenMinutes(new%20Date(Date.now()%20%2B%20SESSION_MS))%3B%20span.textContent%20%3D%20'%20('%20%2B%20lang.wouldEndAt%20%2B%20'%20'%20%2B%20formatClockTime(lang%2C%20endAt)%20%2B%20'%20'%20%2B%20lang.ifStartedNow%20%2B%20')'%3B%20startsEl.appendChild(span)%3B%20%7D%20function%20updateWeeklyAt(msLeft)%20%7B%20var%20existing%20%3D%20document.querySelector('%5Bdata-tgif%3D%22weekly-at%22%5D')%3B%20if%20(existing)%20existing.remove()%3B%20if%20(!lang.relative.test(resetEl.textContent.trim()))%20return%3B%20var%20resetAt%20%3D%20roundToHour(new%20Date(Date.now()%20%2B%20msLeft))%3B%20var%20span%20%3D%20document.createElement('span')%3B%20span.dataset.tgif%20%3D%20'weekly-at'%3B%20span.textContent%20%3D%20'%20(at%20'%20%2B%20formatTooltipTime(lang%2C%20resetAt)%20%2B%20')'%3B%20resetEl.appendChild(span)%3B%20%7D%20function%20parseMsLeft()%20%7B%20var%20text%20%3D%20resetEl.textContent.trim()%3B%20var%20abs%20%3D%20text.match(lang.parse)%3B%20if%20(abs)%20%7B%20var%20targetDay%20%3D%20lang.days%5Babs%5B1%5D.slice(0%2C%203)%5D%3B%20if%20(targetDay%20%3D%3D%3D%20undefined)%20return%20null%3B%20var%20hour%20%3D%20parseInt(abs%5B2%5D%2C%2010)%3B%20var%20minute%20%3D%20parseInt(abs%5B3%5D%2C%2010)%3B%20if%20(lang.ampm)%20%7B%20if%20(abs%5B4%5D%20%3D%3D%3D%20'PM'%20%26%26%20hour%20!%3D%3D%2012)%20hour%20%2B%3D%2012%3B%20if%20(abs%5B4%5D%20%3D%3D%3D%20'AM'%20%26%26%20hour%20%3D%3D%3D%2012)%20hour%20%3D%200%3B%20%7D%20var%20now%20%3D%20new%20Date()%3B%20var%20reset%20%3D%20new%20Date(now)%3B%20reset.setHours(hour%2C%20minute%2C%200%2C%200)%3B%20var%20daysUntil%20%3D%20(targetDay%20-%20now.getDay()%20%2B%207)%20%25%207%3B%20if%20(daysUntil%20%3D%3D%3D%200%20%26%26%20reset%20%3C%3D%20now)%20daysUntil%20%3D%207%3B%20reset.setDate(reset.getDate()%20%2B%20daysUntil)%3B%20return%20reset%20-%20now%3B%20%7D%20return%20parseRelative(text%2C%20lang.relParse)%3B%20%7D%20barContainer.style.position%20%3D%20'relative'%3B%20var%20marker%20%3D%20createMarker()%3B%20barContainer.appendChild(marker)%3B%20var%20hoverState%20%3D%20null%3B%20attachHoverTooltip(barContainer%2C%20function%20()%20%7B%20return%20hoverState%3B%20%7D%2C%20lang)%3B%20var%20label%20%3D%20document.createElement('div')%3B%20label.dataset.tgif%20%3D%20'label'%3B%20label.className%20%3D%20resetEl.className%3B%20label.style.width%20%3D%20'100%25'%3B%20label.style.whiteSpace%20%3D%20'normal'%3B%20row.appendChild(label)%3B%20function%20update()%20%7B%20var%20usagePct%20%3D%20readUsagePct(barContainer)%3B%20var%20msLeft%20%3D%20parseMsLeft()%3B%20if%20(msLeft%20%3D%3D%3D%20null)%20%7B%20if%20(lang.startsText.test(resetEl.textContent.trim()))%20%7B%20teardown()%3B%20runClaude()%3B%20return%3B%20%7D%20label.textContent%20%3D%20lang.parseError%3B%20return%3B%20%7D%20updateSession()%3B%20updateWeeklyAt(msLeft)%3B%20hoverState%20%3D%20renderPace(lang%2C%20label%2C%20%7B%20usagePct%3A%20usagePct%2C%20windowMs%3A%20WEEK_MS%2C%20msLeft%3A%20msLeft%2C%20marker%3A%20marker%2C%20inverted%3A%20false%2C%20%7D)%3B%20%7D%20update()%3B%20if%20(lastUpdatedEl)%20%7B%20var%20observer%20%3D%20track('observers'%2C%20new%20MutationObserver(update))%3B%20observer.observe(lastUpdatedEl%2C%20%7B%20childList%3A%20true%2C%20subtree%3A%20true%2C%20characterData%3A%20true%20%7D)%3B%20%7D%20%7D%20var%20CHATGPT_LANG%20%3D%20%7B%20relative%3A%20%2F%5EResets%20in%5Cb%2F%2C%20relParse%3A%20%2FResets%20in%5Cs*(%3F%3A(%5Cd%2B)%5Cs*d%5Cs*)%3F(%3F%3A(%5Cd%2B)%5Cs*h%5Cs*)%3F(%3F%3A(%5Cd%2B)%5Cs*m)%3F%2F%2C%20pctLeft%3A%20%2F%5E(%5Cd%2B(%3F%3A%5C.%5Cd%2B)%3F)%25%5Cs%2Bleft%24%2F%2C%20creditsLeft%3A%20%2F%5E(%5Cd%2B(%3F%3A%2C%5Cd%7B3%7D)*(%3F%3A%5C.%5Cd%2B)%3F)%5Cs%2Bcredits%3F%5Cs%2B(%3F%3Aleft%7Cremaining)%24%2F%2C%20resetsPrefix%3A%20%2F%5Eresets%5Cs%2B(%3F%3Aon%7Cat)%3F%5Cs*%2Fi%2C%20weekday%3A%20%2F%5Cb(sun%7Cmon%7Ctue%7Cwed%7Cthu%7Cfri%7Csat)(%3F%3A%5Ba-z%5D*day%7Cs%7Crs)%3F%5Cb%2F%2C%20days%3A%20%7B%20sun%3A%200%2C%20mon%3A%201%2C%20tue%3A%202%2C%20wed%3A%203%2C%20thu%3A%204%2C%20fri%3A%205%2C%20sat%3A%206%20%7D%2C%20months%3A%20%7B%20jan%3A%200%2C%20feb%3A%201%2C%20mar%3A%202%2C%20apr%3A%203%2C%20may%3A%204%2C%20jun%3A%205%2C%20jul%3A%206%2C%20aug%3A%207%2C%20sep%3A%208%2C%20oct%3A%209%2C%20nov%3A%2010%2C%20dec%3A%2011%20%7D%2C%20dayNames%3A%20%5B'Sun'%2C%20'Mon'%2C%20'Tue'%2C%20'Wed'%2C%20'Thu'%2C%20'Fri'%2C%20'Sat'%5D%2C%20ampm%3A%20true%2C%20planLimits%3A%20'Plan%20limits'%2C%20sessionText%3A%20'5-hour%20limit'%2C%20weeklyText%3A%20'Weekly%20limit'%2C%20wouldEndAt%3A%20'would%20end%20at'%2C%20ifStartedNow%3A%20'if%20started%20now'%2C%20timeElapsed%3A%20'Elapsed%3A'%2C%20resetsIn%3A%20'Resets%20in'%2C%20ahead%3A%20'ahead'%2C%20behind%3A%20'behind'%2C%20notFound%3A%20'tgif-claude%3A%20usage%20panel%20not%20found%20%E2%80%94%20open%20Settings%2C%20then%20Usage'%2C%20%7D%3B%20function%20runChatgpt()%20%7B%20var%20lang%20%3D%20CHATGPT_LANG%3B%20var%20CREDITS_PER_USD%20%3D%202500%20%2F%20100%3B%20function%20findFill(root)%20%7B%20return%20Array.from(root.querySelectorAll('%5Bstyle*%3D%22width%22%5D')).find(function%20(el)%20%7B%20return%20%2F%25%24%2F.test((el.style.width%20%7C%7C%20'').trim())%3B%20%7D)%3B%20%7D%20function%20findBar(root)%20%7B%20var%20progress%20%3D%20root.querySelector('progress')%3B%20if%20(progress)%20return%20progress.parentElement%3B%20var%20fill%20%3D%20findFill(root)%3B%20return%20fill%20%3F%20fill.parentElement%20%3A%20null%3B%20%7D%20function%20findRow(el)%20%7B%20var%20node%20%3D%20el.parentElement%3B%20while%20(node%20%26%26%20!findBar(node))%20node%20%3D%20node.parentElement%3B%20return%20node%3B%20%7D%20function%20unclamp(from%2C%20upTo)%20%7B%20var%20node%20%3D%20from%3B%20while%20(node)%20%7B%20var%20computed%20%3D%20getComputedStyle(node)%3B%20if%20(computed.maxWidth%20!%3D%3D%20'none')%20node.style.maxWidth%20%3D%20'none'%3B%20if%20(computed.maxHeight%20!%3D%3D%20'none')%20node.style.maxHeight%20%3D%20'none'%3B%20if%20(node%20%3D%3D%3D%20upTo)%20break%3B%20node%20%3D%20node.parentElement%3B%20%7D%20%7D%20var%20panel%20%3D%20document.getElementById('usage-panel-usage')%20%7C%7C%20document.querySelector('%5Brole%3D%22tabpanel%22%5D%5Baria-labelledby%24%3D%22trigger-Usage%22%5D%3Anot(%5Bhidden%5D)')%3B%20var%20planLimitsEl%20%3D%20findByText(panel%20%7C%7C%20document%2C%20lang.planLimits)%3B%20var%20sessionLabel%20%3D%20findByText(panel%20%7C%7C%20document%2C%20lang.sessionText)%3B%20var%20weeklyLabel%20%3D%20findByText(panel%20%7C%7C%20document%2C%20lang.weeklyText)%3B%20if%20(!sessionLabel%20%26%26%20!weeklyLabel)%20%7B%20alert(lang.notFound)%3B%20return%3B%20%7D%20var%20card%20%3D%20findRow(sessionLabel%20%7C%7C%20weeklyLabel)%3B%20if%20(card)%20card%20%3D%20card.parentElement%3B%20var%20dialog%20%3D%20(planLimitsEl%20%7C%7C%20sessionLabel%20%7C%7C%20weeklyLabel).closest('%5Brole%3D%22dialog%22%5D')%3B%20if%20(dialog)%20%7B%20dialog.style.cssText%20%2B%3D%20'%3Bposition%3Afixed%3Binset%3A0%3Bmargin%3A0%3Bwidth%3A100vw%3Bheight%3A100vh%3B'%20%2B%20'max-width%3Anone%3Bmax-height%3Anone%3Bborder-radius%3A0%3Btransform%3Anone%3Btranslate%3Anone%3B'%3B%20unclamp(card%20%7C%7C%20panel%2C%20dialog)%3B%20%7D%20function%20readUsagePct(row%2C%20bar)%20%7B%20var%20pctEl%20%3D%20textNodes(row).find(function%20(el)%20%7B%20return%20lang.pctLeft.test(el.textContent.trim())%3B%20%7D)%3B%20if%20(pctEl)%20return%20100%20-%20parseFloat(pctEl.textContent.trim().match(lang.pctLeft)%5B1%5D)%3B%20var%20progress%20%3D%20bar%20%26%26%20bar.querySelector('progress')%3B%20if%20(progress)%20return%20100%20-%20(progress.value%20%2F%20(progress.max%20%7C%7C%20100))%20*%20100%3B%20var%20fill%20%3D%20bar%20%26%26%20findFill(bar)%3B%20return%20fill%20%3F%20100%20-%20parseFloat(fill.style.width)%20%3A%200%3B%20%7D%20function%20findResetEl(row)%20%7B%20var%20button%20%3D%20Array.from(row.querySelectorAll('button%5Baria-label%5D')).find(function%20(el)%20%7B%20return%20lang.relative.test(el.getAttribute('aria-label').trim())%3B%20%7D)%3B%20if%20(button)%20%7B%20return%20%7B%20el%3A%20button%2C%20text%3A%20button.getAttribute('aria-label').trim()%2C%20title%3A%20null%2C%20tip%3A%20tooltipFor(button)%20%7D%3B%20%7D%20var%20span%20%3D%20textNodes(row).find(function%20(el)%20%7B%20return%20!el.children.length%20%26%26%20lang.relative.test(el.textContent.trim())%3B%20%7D)%3B%20if%20(!span)%20return%20null%3B%20return%20%7B%20el%3A%20span%2C%20text%3A%20span.textContent.trim()%2C%20title%3A%20span.getAttribute('title')%2C%20tip%3A%20null%20%7D%3B%20%7D%20function%20readMsLeft(row)%20%7B%20var%20reset%20%3D%20findResetEl(row)%3B%20return%20reset%20%3F%20parseRelative(reset.text%2C%20lang.relParse)%20%3A%20null%3B%20%7D%20function%20setup(labelEl%2C%20windowMs%2C%20weekly)%20%7B%20var%20row%20%3D%20labelEl%20%26%26%20findRow(labelEl)%3B%20var%20bar%20%3D%20row%20%26%26%20findBar(row)%3B%20if%20(!bar)%20return%20null%3B%20bar.style.position%20%3D%20'relative'%3B%20bar.style.overflow%20%3D%20'visible'%3B%20var%20marker%20%3D%20createMarker()%3B%20marker.style.top%20%3D%20'-4px'%3B%20marker.style.height%20%3D%20'calc(100%25%20%2B%208px)'%3B%20bar.appendChild(marker)%3B%20var%20pctEl%20%3D%20textNodes(row).find(function%20(el)%20%7B%20return%20lang.pctLeft.test(el.textContent.trim())%3B%20%7D)%3B%20var%20label%20%3D%20document.createElement('div')%3B%20label.dataset.tgif%20%3D%20'label'%3B%20if%20(pctEl)%20label.className%20%3D%20pctEl.className%3B%20label.style.width%20%3D%20'100%25'%3B%20label.style.whiteSpace%20%3D%20'normal'%3B%20label.style.textAlign%20%3D%20'start'%3B%20row.appendChild(label)%3B%20var%20ctx%20%3D%20%7B%20row%3A%20row%2C%20bar%3A%20bar%2C%20marker%3A%20marker%2C%20label%3A%20label%2C%20windowMs%3A%20windowMs%2C%20weekly%3A%20weekly%2C%20hoverState%3A%20null%2C%20reset%3A%20null%2C%20lastRelMs%3A%20null%2C%20probing%3A%20false%2C%20probes%3A%200%2C%20%7D%3B%20attachHoverTooltip(bar%2C%20function%20()%20%7B%20return%20ctx.hoverState%3B%20%7D%2C%20lang)%3B%20return%20ctx%3B%20%7D%20function%20makeReset(text%2C%20relMs)%20%7B%20return%20%7B%20text%3A%20text.replace(lang.resetsPrefix%2C%20'')%2C%20at%3A%20parseTooltipTime(text%2C%20Date.now()%20%2B%20relMs%2C%20lang)%2C%20%7D%3B%20%7D%20var%20probeQueue%20%3D%20Promise.resolve()%3B%20function%20captureReset(ctx%2C%20relMs%2C%20allowProbe)%20%7B%20var%20reset%20%3D%20findResetEl(ctx.row)%3B%20if%20(!reset)%20return%3B%20if%20(reset.title)%20%7B%20ctx.reset%20%3D%20%7B%20text%3A%20null%2C%20at%3A%20parseTooltipTime(reset.title%2C%20Date.now()%20%2B%20relMs%2C%20lang)%20%7D%3B%20return%3B%20%7D%20var%20tip%20%3D%20reset.tip%3B%20if%20(!tip)%20return%3B%20var%20visible%20%3D%20tooltipText(tip)%3B%20if%20(visible)%20%7B%20ctx.reset%20%3D%20makeReset(visible%2C%20relMs)%3B%20return%3B%20%7D%20if%20(!allowProbe%20%7C%7C%20ctx.probing%20%7C%7C%20ctx.probes%20%3E%3D%203)%20return%3B%20ctx.probing%20%3D%20true%3B%20probeQueue%20%3D%20probeQueue.then(function%20()%20%7B%20return%20revealTooltip(reset.el%2C%20tip)%3B%20%7D).then(function%20(text)%20%7B%20ctx.probing%20%3D%20false%3B%20ctx.probes%2B%2B%3B%20var%20current%20%3D%20readMsLeft(ctx.row)%3B%20if%20(!text%20%7C%7C%20current%20%3D%3D%3D%20null)%20return%3B%20ctx.reset%20%3D%20makeReset(text%2C%20current)%3B%20update(false)%3B%20%7D)%3B%20%7D%20function%20formatResetAt(ctx%2C%20date)%20%7B%20return%20ctx.weekly%20%3F%20formatTooltipTime(lang%2C%20date)%20%3A%20formatClockTime(lang%2C%20date)%3B%20%7D%20function%20annotateResetAt(ctx%2C%20msLeft)%20%7B%20var%20reset%20%3D%20findResetEl(ctx.row)%3B%20var%20anchor%20%3D%20reset%20%3F%20reset.el.parentElement%20%3A%20null%3B%20if%20(!anchor)%20return%3B%20var%20span%20%3D%20document.createElement('span')%3B%20span.dataset.tgif%20%3D%20'reset-at'%3B%20var%20at%3B%20if%20(ctx.reset%20%26%26%20ctx.reset.text)%20%7B%20at%20%3D%20ctx.reset.text%3B%20%7D%20else%20if%20(ctx.reset%20%26%26%20ctx.reset.at%20!%3D%3D%20null)%20%7B%20at%20%3D%20'at%20'%20%2B%20formatResetAt(ctx%2C%20new%20Date(ctx.reset.at))%3B%20%7D%20else%20%7B%20var%20round%20%3D%20ctx.weekly%20%3F%20roundToHour%20%3A%20roundToTenMinutes%3B%20at%20%3D%20'at%20'%20%2B%20formatResetAt(ctx%2C%20round(new%20Date(Date.now()%20%2B%20msLeft)))%3B%20%7D%20span.textContent%20%3D%20'%20('%20%2B%20at%20%2B%20')'%3B%20anchor.appendChild(span)%3B%20%7D%20function%20updateCtx(ctx%2C%20allowProbe)%20%7B%20Array.from(ctx.row.querySelectorAll('%5Bdata-tgif%3D%22reset-at%22%5D')).forEach(function%20(el)%20%7B%20el.remove()%3B%20%7D)%3B%20var%20relMs%20%3D%20readMsLeft(ctx.row)%3B%20if%20(relMs%20%3D%3D%3D%20null)%20%7B%20ctx.reset%20%3D%20null%3B%20ctx.lastRelMs%20%3D%20null%3B%20ctx.probes%20%3D%200%3B%20ctx.marker.style.display%20%3D%20'none'%3B%20ctx.hoverState%20%3D%20null%3B%20var%20endAt%20%3D%20ctx.weekly%20%3F%20formatTooltipTime(lang%2C%20roundToHour(new%20Date(Date.now()%20%2B%20ctx.windowMs)))%20%3A%20formatClockTime(lang%2C%20roundToTenMinutes(new%20Date(Date.now()%20%2B%20ctx.windowMs)))%3B%20ctx.label.textContent%20%3D%20lang.wouldEndAt%20%2B%20'%20'%20%2B%20endAt%20%2B%20'%20'%20%2B%20lang.ifStartedNow%3B%20return%3B%20%7D%20if%20(ctx.lastRelMs%20!%3D%3D%20null%20%26%26%20relMs%20%3E%20ctx.lastRelMs)%20%7B%20ctx.reset%20%3D%20null%3B%20ctx.probes%20%3D%200%3B%20%7D%20ctx.lastRelMs%20%3D%20relMs%3B%20if%20(!ctx.reset)%20captureReset(ctx%2C%20relMs%2C%20allowProbe)%3B%20var%20msLeft%20%3D%20ctx.reset%20%26%26%20ctx.reset.at%20!%3D%3D%20null%20%3F%20Math.max(0%2C%20ctx.reset.at%20-%20Date.now())%20%3A%20relMs%3B%20ctx.marker.style.display%20%3D%20''%3B%20annotateResetAt(ctx%2C%20msLeft)%3B%20ctx.hoverState%20%3D%20renderPace(lang%2C%20ctx.label%2C%20%7B%20usagePct%3A%20readUsagePct(ctx.row%2C%20ctx.bar)%2C%20windowMs%3A%20ctx.windowMs%2C%20msLeft%3A%20msLeft%2C%20marker%3A%20ctx.marker%2C%20inverted%3A%20true%2C%20%7D)%3B%20%7D%20var%20contexts%20%3D%20%5B%20setup(sessionLabel%2C%20SESSION_MS%2C%20false)%2C%20setup(weeklyLabel%2C%20WEEK_MS%2C%20true)%2C%20%5D.filter(Boolean)%3B%20if%20(!contexts.length)%20%7B%20alert(lang.notFound)%3B%20return%3B%20%7D%20var%20observer%20%3D%20null%3B%20var%20observedRoot%20%3D%20panel%20%7C%7C%20card%3B%20function%20annotateCredits()%20%7B%20var%20root%20%3D%20panel%20%7C%7C%20document%3B%20Array.from(root.querySelectorAll('%5Bdata-tgif%3D%22credit-value%22%5D')).forEach(function%20(el)%20%7B%20el.remove()%3B%20%7D)%3B%20textNodes(root).forEach(function%20(el)%20%7B%20if%20(el.children.length)%20return%3B%20var%20match%20%3D%20el.textContent.trim().match(lang.creditsLeft)%3B%20if%20(!match)%20return%3B%20var%20credits%20%3D%20parseFloat(match%5B1%5D.replace(%2F%2C%2Fg%2C%20''))%3B%20var%20span%20%3D%20document.createElement('span')%3B%20span.dataset.tgif%20%3D%20'credit-value'%3B%20span.textContent%20%3D%20'%20(%24'%20%2B%20(credits%20%2F%20CREDITS_PER_USD).toFixed(2)%20%2B%20')'%3B%20el.appendChild(span)%3B%20%7D)%3B%20%7D%20function%20update(allowProbe)%20%7B%20if%20(observer)%20observer.disconnect()%3B%20annotateCredits()%3B%20contexts.forEach(function%20(ctx)%20%7B%20updateCtx(ctx%2C%20allowProbe)%3B%20%7D)%3B%20if%20(observer%20%26%26%20observedRoot)%20%7B%20observer.observe(observedRoot%2C%20%7B%20childList%3A%20true%2C%20subtree%3A%20true%2C%20characterData%3A%20true%20%7D)%3B%20%7D%20%7D%20update(true)%3B%20track('intervals'%2C%20setInterval(function%20()%20%7B%20update(true)%3B%20%7D%2C%2030000))%3B%20if%20(observedRoot)%20%7B%20observer%20%3D%20track('observers'%2C%20new%20MutationObserver(function%20()%20%7B%20update(false)%3B%20%7D))%3B%20observer.observe(observedRoot%2C%20%7B%20childList%3A%20true%2C%20subtree%3A%20true%2C%20characterData%3A%20true%20%7D)%3B%20%7D%20%7D%20teardown()%3B%20var%20host%20%3D%20location.hostname%3B%20if%20(%2F(%5E%7C%5C.)claude%5C.ai%24%2F.test(host))%20%7B%20runClaude()%3B%20%7D%20else%20if%20(%2F(%5E%7C%5C.)(chatgpt%5C.com%7Copenai%5C.com)%24%2F.test(host))%20%7B%20runChatgpt()%3B%20%7D%20else%20if%20(document.getElementById('usage-panel-usage')%20%7C%7C%20document.getElementById('modal-settings'))%20%7B%20runChatgpt()%3B%20%7D%20else%20%7B%20runClaude()%3B%20%7D%20%7D)()%3B
Or check the readable code on github.