[{"data":1,"prerenderedAt":1849},["ShallowReactive",2],{"post-en-codexbar-5h-vs-weekly-quota-calculation":3,"surround-en-blog\u002Fen\u002Fblog\u002Fcodexbar-5h-vs-weekly-quota-calculation.md":1836},{"id":4,"title":5,"body":6,"canonical":151,"category":1818,"date":1819,"description":1820,"extension":1821,"image":1822,"meta":1823,"navigation":309,"path":1824,"seo":1825,"slug":1826,"status":1827,"stem":1828,"tags":1829,"translationSlug":1826,"__hash__":1835},"blog\u002Fen\u002Fblog\u002Fcodexbar-5h-vs-weekly-quota-calculation.md","How Much Weekly Quota Does a 5-Hour Window Consume? Calculating Claude, Codex, and Antigravity with CodexBar History",{"type":7,"value":8,"toc":1805},"minimark",[9,14,18,21,88,91,98,104,108,111,123,126,136,140,145,193,208,235,239,257,268,275,279,286,1426,1429,1447,1450,1458,1461,1487,1490,1493,1530,1533,1537,1540,1559,1609,1624,1628,1633,1640,1644,1780,1784,1787,1801],[10,11,13],"h2",{"id":12},"_1-background-and-bluf-bottom-line-up-front","1. Background and BLUF (Bottom Line Up Front)",[15,16,17],"p",{},"I subscribe to Claude Pro, ChatGPT Plus (using Codex), and Google AI Pro (using Antigravity). All three enforce a two-tier quota model: a rolling 5-hour session window and an overall weekly allotment. I wanted to understand two questions: How much of the weekly quota does a full 5-hour window consume? And what daily pacing ensures you don't waste unused quota before the weekly reset?",[15,19,20],{},"CodexBar logs percentage snapshots locally. I wrote a Python script to parse these logs and extract consumption deltas within matching windows:",[22,23,24,43],"table",{},[25,26,27],"thead",{},[28,29,30,34,37,40],"tr",{},[31,32,33],"th",{},"Account \u002F Pool",[31,35,36],{},"One 5h Window ≈ Weekly Quota",[31,38,39],{},"Windows per Week",[31,41,42],{},"Confidence",[44,45,46,61,74],"tbody",{},[28,47,48,52,55,58],{},[49,50,51],"td",{},"Claude Pro",[49,53,54],{},"12.5%–13%",[49,56,57],{},"7.5–8",[49,59,60],{},"High",[28,62,63,66,69,72],{},[49,64,65],{},"Codex (ChatGPT Plus)",[49,67,68],{},"~16%",[49,70,71],{},"~6.4",[49,73,60],{},[28,75,76,79,82,85],{},[49,77,78],{},"Antigravity Regular Gemini (Google AI Pro)",[49,80,81],{},"~28.6%",[49,83,84],{},"~3.5",[49,86,87],{},"Moderate",[15,89,90],{},"Running this analysis revealed that October 22 was my Claude weekly reset day. At 11:54 AM, I had only used 46% of my weekly quota. Even by maxing out every remaining 5-hour window until the 10:00 PM reset, the total would cap out at ~73%. Because usage was too light earlier in the week, no amount of late sprint could recover the lost quota.",[15,92,93,97],{},[94,95,96],"strong",{},"TL;DR",": Don't count individual session resets—monitor your daily weekly quota growth. For a 7-day work week, Claude requires burning slightly more than one full 5-hour window every day, Codex needs about 90% of a full window daily, and Antigravity only needs half a window per day.",[15,99,100],{},[101,102,103],"em",{},"Note: These benchmarks reflect real usage on my personal accounts in October 2026. Providers do not publish static conversion factors.",[10,105,107],{"id":106},"_2-core-mental-model-why-you-cannot-simply-divide-current-percentages","2. Core Mental Model: Why You Cannot Simply Divide Current Percentages",[15,109,110],{},"The intuitive approach is dividing the two current numbers shown in CodexBar: e.g., Claude 5h at 85% and weekly at 46%. This produces a meaningless ratio because 46% includes all cumulative sessions earlier in the week.",[15,112,113,114,117,118,122],{},"Valid ratios require computing matching ",[94,115,116],{},"deltas",". Within the same 5-hour window, any activity draws down both quotas simultaneously. Therefore: ",[119,120,121],"code",{},"(Weekly Quota Delta) ÷ (5-Hour Quota Delta) = Equivalent Weekly Quota for a Full 5-Hour Window",". Between 12:58 and 13:58 on October 19, my Claude 5h usage jumped from 48% to 80% (+32), while weekly usage moved from 8% to 12% (+4): 4 ÷ 32 = 12.5%. A subsequent window the next evening recorded +48 and +6, again exactly 12.5%.",[15,124,125],{},"Two critical constraints to keep in mind:",[127,128,129,133],"ul",{},[130,131,132],"li",{},"A \"5-hour window\" represents a quota bucket, not 5 hours of continuous typing. Under agentic loads, a bucket can be depleted rapidly.",[130,134,135],{},"Changing clients does not provide separate quota. Anthropic documentation clarifies that claude.ai, Claude Code, and Claude Desktop share a single quota pool; OpenAI notes ChatGPT Work and Codex share usage, and Codex Pro currently has no 5-hour limit. Quota draw rate also varies with model selection, reasoning effort, context length, and tool calls.",[10,137,139],{"id":138},"_3-reproduction-steps","3. Reproduction Steps",[141,142,144],"h3",{"id":143},"step-1-locate-codexbar-local-history-files","Step 1: Locate CodexBar Local History Files",[146,147,152],"pre",{"className":148,"code":149,"language":150,"meta":151,"style":151},"language-sh shiki shiki-themes github-dark","codexbar --help | head -1\nls ~\u002FLibrary\u002FApplication\\ Support\u002Fcom.steipete.codexbar\u002Fhistory\u002F\n","sh","",[119,153,154,177],{"__ignoreMap":151},[155,156,159,163,167,171,174],"span",{"class":157,"line":158},"line",1,[155,160,162],{"class":161},"svObZ","codexbar",[155,164,166],{"class":165},"sDLfK"," --help",[155,168,170],{"class":169},"snl16"," |",[155,172,173],{"class":161}," head",[155,175,176],{"class":165}," -1\n",[155,178,180,183,187,190],{"class":157,"line":179},2,[155,181,182],{"class":161},"ls",[155,184,186],{"class":185},"sU2Wk"," ~\u002FLibrary\u002FApplication",[155,188,189],{"class":165},"\\ ",[155,191,192],{"class":185},"Support\u002Fcom.steipete.codexbar\u002Fhistory\u002F\n",[15,194,195,196,199,200,203,204,207],{},"On CodexBar 0.79.0, the history directory contains ",[119,197,198],{},"antigravity.json",", ",[119,201,202],{},"claude.json",", and ",[119,205,206],{},"codex.json",". You can query live usage via the CLI:",[146,209,211],{"className":148,"code":210,"language":150,"meta":151,"style":151},"codexbar usage --provider claude --format json --pretty\n",[119,212,213],{"__ignoreMap":151},[155,214,215,217,220,223,226,229,232],{"class":157,"line":158},[155,216,162],{"class":161},[155,218,219],{"class":185}," usage",[155,221,222],{"class":165}," --provider",[155,224,225],{"class":185}," claude",[155,227,228],{"class":165}," --format",[155,230,231],{"class":185}," json",[155,233,234],{"class":165}," --pretty\n",[141,236,238],{"id":237},"step-2-understand-the-json-schema","Step 2: Understand the JSON Schema",[15,240,241,242,245,246,249,250,245,253,256],{},"Files are organized by account key. Each account contains two series: ",[119,243,244],{},"session"," (",[119,247,248],{},"windowMinutes: 300",") and ",[119,251,252],{},"weekly",[119,254,255],{},"windowMinutes: 10080","). Entries record three fields:",[146,258,262],{"className":259,"code":260,"language":261,"meta":151,"style":151},"language-json shiki shiki-themes github-dark","{\"capturedAt\": \"2026-10-19T04:58:37Z\", \"resetsAt\": \"2026-10-19T08:30:00Z\", \"usedPercent\": 48}\n","json",[119,263,264],{"__ignoreMap":151},[155,265,266],{"class":157,"line":158},[155,267,260],{},[15,269,270,271,274],{},"Timestamps are stored in UTC, sampled roughly once per hour. They represent percentage snapshots rather than individual transaction billings. A file may contain multiple accounts; ",[119,272,273],{},"preferredAccountKey"," marks the active one.",[141,276,278],{"id":277},"step-3-filter-paired-windows-and-calculate-ratios","Step 3: Filter Paired Windows and Calculate Ratios",[15,280,281,282,285],{},"Save the following script as ",[119,283,284],{},"quota_ratio.py",":",[146,287,291],{"className":288,"code":289,"language":290,"meta":151,"style":151},"language-python shiki shiki-themes github-dark","#!\u002Fusr\u002Fbin\u002Fenv python3\n\"\"\"用 CodexBar 本地历史估算：一整轮 5 小时额度约等于多少周额度。\n\n用法：python3 quota_ratio.py \u003Cclaude|codex|antigravity> [起始时间] [5 小时增量下限]\n\"\"\"\nimport json\nimport sys\nfrom datetime import datetime\nfrom pathlib import Path\n\nprovider = sys.argv[1]\nsince = sys.argv[2] if len(sys.argv) > 2 else \"1970-01-01\"   # 只用这个时间之后的采样（UTC）\nmin_delta = float(sys.argv[3]) if len(sys.argv) > 3 else 15  # 整数百分比的产品建议 15\n\npath = Path.home() \u002F \"Library\u002FApplication Support\u002Fcom.steipete.codexbar\u002Fhistory\" \u002F f\"{provider}.json\"\ndata = json.loads(path.read_text())\nseries = data[\"accounts\"][data[\"preferredAccountKey\"]]       # 只取当前账户\n\n\ndef entries(name, minutes):\n    return {e[\"capturedAt\"]: e for s in series\n            if s[\"name\"] == name and s[\"windowMinutes\"] == minutes for e in s[\"entries\"]}\n\n\ndef ts(t):\n    return datetime.fromisoformat(t.replace(\"Z\", \"+00:00\"))\n\n\ndef close(a, b):                                             # resetsAt 会有 ±1 分钟抖动\n    return abs((ts(a) - ts(b)).total_seconds()) \u003C= 60\n\n\nsession, weekly = entries(\"session\", 300), entries(\"weekly\", 10080)\nsamples = [(t, session[t], weekly[t]) for t in sorted(session.keys() & weekly.keys()) if t >= since]\n\n\ndef same_window(a, b):\n    (_, sa, wa), (tb, sb, wb) = a, b\n    if not all(e.get(\"resetsAt\") for e in (sa, sb, wa, wb)):  # 空闲条目可能没有 resetsAt\n        return False\n    return (close(sa[\"resetsAt\"], sb[\"resetsAt\"]) and close(wa[\"resetsAt\"], wb[\"resetsAt\"])\n            and ts(sb[\"resetsAt\"]) > ts(tb)                   # 后一条还没过 5 小时重置点\n            and sb[\"usedPercent\"] >= sa[\"usedPercent\"]\n            and wb[\"usedPercent\"] >= wa[\"usedPercent\"])\n\n\ngroups = []\nfor s in samples:\n    if groups and same_window(groups[-1][-1], s):\n        groups[-1].append(s)\n    else:\n        groups.append([s])\n\ntotal_s = total_w = 0\nfor g in groups:\n    (ta, sa, wa), (tb, sb, wb) = g[0], g[-1]\n    ds = sb[\"usedPercent\"] - sa[\"usedPercent\"]\n    dw = wb[\"usedPercent\"] - wa[\"usedPercent\"]\n    if ds \u003C min_delta or dw \u003C= 0:\n        continue\n    total_s += ds\n    total_w += dw\n    print(f\"{ta} → {tb}  5h +{ds:g}  周 +{dw:g}  比例 {dw \u002F ds:.1%}\")\n\nif total_s:\n    r = total_w \u002F total_s\n    print(f\"合计：5h +{total_s:g}，周 +{total_w:g} → 一整轮 5h ≈ 周额度的 {r:.1%}，一周约 {1 \u002F r:.1f} 轮\")\nelse:\n    print(\"没有符合条件的样本：放宽起始时间，或调低 5 小时增量下限\")\n","python",[119,292,293,299,304,311,317,323,333,341,355,368,373,391,431,470,475,513,524,550,555,560,572,599,649,654,659,670,689,694,699,713,736,741,746,779,819,824,829,840,851,884,893,925,946,968,989,994,999,1010,1022,1049,1062,1071,1077,1082,1098,1111,1134,1156,1178,1205,1211,1223,1234,1312,1317,1325,1340,1406,1414],{"__ignoreMap":151},[155,294,295],{"class":157,"line":158},[155,296,298],{"class":297},"sAwPA","#!\u002Fusr\u002Fbin\u002Fenv python3\n",[155,300,301],{"class":157,"line":179},[155,302,303],{"class":185},"\"\"\"用 CodexBar 本地历史估算：一整轮 5 小时额度约等于多少周额度。\n",[155,305,307],{"class":157,"line":306},3,[155,308,310],{"emptyLinePlaceholder":309},true,"\n",[155,312,314],{"class":157,"line":313},4,[155,315,316],{"class":185},"用法：python3 quota_ratio.py \u003Cclaude|codex|antigravity> [起始时间] [5 小时增量下限]\n",[155,318,320],{"class":157,"line":319},5,[155,321,322],{"class":185},"\"\"\"\n",[155,324,326,329],{"class":157,"line":325},6,[155,327,328],{"class":169},"import",[155,330,332],{"class":331},"s95oV"," json\n",[155,334,336,338],{"class":157,"line":335},7,[155,337,328],{"class":169},[155,339,340],{"class":331}," sys\n",[155,342,344,347,350,352],{"class":157,"line":343},8,[155,345,346],{"class":169},"from",[155,348,349],{"class":331}," datetime ",[155,351,328],{"class":169},[155,353,354],{"class":331}," datetime\n",[155,356,358,360,363,365],{"class":157,"line":357},9,[155,359,346],{"class":169},[155,361,362],{"class":331}," pathlib ",[155,364,328],{"class":169},[155,366,367],{"class":331}," Path\n",[155,369,371],{"class":157,"line":370},10,[155,372,310],{"emptyLinePlaceholder":309},[155,374,376,379,382,385,388],{"class":157,"line":375},11,[155,377,378],{"class":331},"provider ",[155,380,381],{"class":169},"=",[155,383,384],{"class":331}," sys.argv[",[155,386,387],{"class":165},"1",[155,389,390],{"class":331},"]\n",[155,392,394,397,399,401,404,407,410,413,416,419,422,425,428],{"class":157,"line":393},12,[155,395,396],{"class":331},"since ",[155,398,381],{"class":169},[155,400,384],{"class":331},[155,402,403],{"class":165},"2",[155,405,406],{"class":331},"] ",[155,408,409],{"class":169},"if",[155,411,412],{"class":165}," len",[155,414,415],{"class":331},"(sys.argv) ",[155,417,418],{"class":169},">",[155,420,421],{"class":165}," 2",[155,423,424],{"class":169}," else",[155,426,427],{"class":185}," \"1970-01-01\"",[155,429,430],{"class":297},"   # 只用这个时间之后的采样（UTC）\n",[155,432,434,437,439,442,445,448,451,453,455,457,459,462,464,467],{"class":157,"line":433},13,[155,435,436],{"class":331},"min_delta ",[155,438,381],{"class":169},[155,440,441],{"class":165}," float",[155,443,444],{"class":331},"(sys.argv[",[155,446,447],{"class":165},"3",[155,449,450],{"class":331},"]) ",[155,452,409],{"class":169},[155,454,412],{"class":165},[155,456,415],{"class":331},[155,458,418],{"class":169},[155,460,461],{"class":165}," 3",[155,463,424],{"class":169},[155,465,466],{"class":165}," 15",[155,468,469],{"class":297},"  # 整数百分比的产品建议 15\n",[155,471,473],{"class":157,"line":472},14,[155,474,310],{"emptyLinePlaceholder":309},[155,476,478,481,483,486,489,492,495,498,501,504,507,510],{"class":157,"line":477},15,[155,479,480],{"class":331},"path ",[155,482,381],{"class":169},[155,484,485],{"class":331}," Path.home() ",[155,487,488],{"class":169},"\u002F",[155,490,491],{"class":185}," \"Library\u002FApplication Support\u002Fcom.steipete.codexbar\u002Fhistory\"",[155,493,494],{"class":169}," \u002F",[155,496,497],{"class":169}," f",[155,499,500],{"class":185},"\"",[155,502,503],{"class":165},"{",[155,505,506],{"class":331},"provider",[155,508,509],{"class":165},"}",[155,511,512],{"class":185},".json\"\n",[155,514,516,519,521],{"class":157,"line":515},16,[155,517,518],{"class":331},"data ",[155,520,381],{"class":169},[155,522,523],{"class":331}," json.loads(path.read_text())\n",[155,525,527,530,532,535,538,541,544,547],{"class":157,"line":526},17,[155,528,529],{"class":331},"series ",[155,531,381],{"class":169},[155,533,534],{"class":331}," data[",[155,536,537],{"class":185},"\"accounts\"",[155,539,540],{"class":331},"][data[",[155,542,543],{"class":185},"\"preferredAccountKey\"",[155,545,546],{"class":331},"]]       ",[155,548,549],{"class":297},"# 只取当前账户\n",[155,551,553],{"class":157,"line":552},18,[155,554,310],{"emptyLinePlaceholder":309},[155,556,558],{"class":157,"line":557},19,[155,559,310],{"emptyLinePlaceholder":309},[155,561,563,566,569],{"class":157,"line":562},20,[155,564,565],{"class":169},"def",[155,567,568],{"class":161}," entries",[155,570,571],{"class":331},"(name, minutes):\n",[155,573,575,578,581,584,587,590,593,596],{"class":157,"line":574},21,[155,576,577],{"class":169},"    return",[155,579,580],{"class":331}," {e[",[155,582,583],{"class":185},"\"capturedAt\"",[155,585,586],{"class":331},"]: e ",[155,588,589],{"class":169},"for",[155,591,592],{"class":331}," s ",[155,594,595],{"class":169},"in",[155,597,598],{"class":331}," series\n",[155,600,602,605,608,611,613,616,619,622,624,627,629,631,634,636,639,641,643,646],{"class":157,"line":601},22,[155,603,604],{"class":169},"            if",[155,606,607],{"class":331}," s[",[155,609,610],{"class":185},"\"name\"",[155,612,406],{"class":331},[155,614,615],{"class":169},"==",[155,617,618],{"class":331}," name ",[155,620,621],{"class":169},"and",[155,623,607],{"class":331},[155,625,626],{"class":185},"\"windowMinutes\"",[155,628,406],{"class":331},[155,630,615],{"class":169},[155,632,633],{"class":331}," minutes ",[155,635,589],{"class":169},[155,637,638],{"class":331}," e ",[155,640,595],{"class":169},[155,642,607],{"class":331},[155,644,645],{"class":185},"\"entries\"",[155,647,648],{"class":331},"]}\n",[155,650,652],{"class":157,"line":651},23,[155,653,310],{"emptyLinePlaceholder":309},[155,655,657],{"class":157,"line":656},24,[155,658,310],{"emptyLinePlaceholder":309},[155,660,662,664,667],{"class":157,"line":661},25,[155,663,565],{"class":169},[155,665,666],{"class":161}," ts",[155,668,669],{"class":331},"(t):\n",[155,671,673,675,678,681,683,686],{"class":157,"line":672},26,[155,674,577],{"class":169},[155,676,677],{"class":331}," datetime.fromisoformat(t.replace(",[155,679,680],{"class":185},"\"Z\"",[155,682,199],{"class":331},[155,684,685],{"class":185},"\"+00:00\"",[155,687,688],{"class":331},"))\n",[155,690,692],{"class":157,"line":691},27,[155,693,310],{"emptyLinePlaceholder":309},[155,695,697],{"class":157,"line":696},28,[155,698,310],{"emptyLinePlaceholder":309},[155,700,702,704,707,710],{"class":157,"line":701},29,[155,703,565],{"class":169},[155,705,706],{"class":161}," close",[155,708,709],{"class":331},"(a, b):                                             ",[155,711,712],{"class":297},"# resetsAt 会有 ±1 分钟抖动\n",[155,714,716,718,721,724,727,730,733],{"class":157,"line":715},30,[155,717,577],{"class":169},[155,719,720],{"class":165}," abs",[155,722,723],{"class":331},"((ts(a) ",[155,725,726],{"class":169},"-",[155,728,729],{"class":331}," ts(b)).total_seconds()) ",[155,731,732],{"class":169},"\u003C=",[155,734,735],{"class":165}," 60\n",[155,737,739],{"class":157,"line":738},31,[155,740,310],{"emptyLinePlaceholder":309},[155,742,744],{"class":157,"line":743},32,[155,745,310],{"emptyLinePlaceholder":309},[155,747,749,752,754,757,760,762,765,768,771,773,776],{"class":157,"line":748},33,[155,750,751],{"class":331},"session, weekly ",[155,753,381],{"class":169},[155,755,756],{"class":331}," entries(",[155,758,759],{"class":185},"\"session\"",[155,761,199],{"class":331},[155,763,764],{"class":165},"300",[155,766,767],{"class":331},"), entries(",[155,769,770],{"class":185},"\"weekly\"",[155,772,199],{"class":331},[155,774,775],{"class":165},"10080",[155,777,778],{"class":331},")\n",[155,780,782,785,787,790,792,795,797,800,803,806,809,811,813,816],{"class":157,"line":781},34,[155,783,784],{"class":331},"samples ",[155,786,381],{"class":169},[155,788,789],{"class":331}," [(t, session[t], weekly[t]) ",[155,791,589],{"class":169},[155,793,794],{"class":331}," t ",[155,796,595],{"class":169},[155,798,799],{"class":165}," sorted",[155,801,802],{"class":331},"(session.keys() ",[155,804,805],{"class":169},"&",[155,807,808],{"class":331}," weekly.keys()) ",[155,810,409],{"class":169},[155,812,794],{"class":331},[155,814,815],{"class":169},">=",[155,817,818],{"class":331}," since]\n",[155,820,822],{"class":157,"line":821},35,[155,823,310],{"emptyLinePlaceholder":309},[155,825,827],{"class":157,"line":826},36,[155,828,310],{"emptyLinePlaceholder":309},[155,830,832,834,837],{"class":157,"line":831},37,[155,833,565],{"class":169},[155,835,836],{"class":161}," same_window",[155,838,839],{"class":331},"(a, b):\n",[155,841,843,846,848],{"class":157,"line":842},38,[155,844,845],{"class":331},"    (_, sa, wa), (tb, sb, wb) ",[155,847,381],{"class":169},[155,849,850],{"class":331}," a, b\n",[155,852,854,857,860,863,866,869,872,874,876,878,881],{"class":157,"line":853},39,[155,855,856],{"class":169},"    if",[155,858,859],{"class":169}," not",[155,861,862],{"class":165}," all",[155,864,865],{"class":331},"(e.get(",[155,867,868],{"class":185},"\"resetsAt\"",[155,870,871],{"class":331},") ",[155,873,589],{"class":169},[155,875,638],{"class":331},[155,877,595],{"class":169},[155,879,880],{"class":331}," (sa, sb, wa, wb)):  ",[155,882,883],{"class":297},"# 空闲条目可能没有 resetsAt\n",[155,885,887,890],{"class":157,"line":886},40,[155,888,889],{"class":169},"        return",[155,891,892],{"class":165}," False\n",[155,894,896,898,901,903,906,908,910,912,915,917,920,922],{"class":157,"line":895},41,[155,897,577],{"class":169},[155,899,900],{"class":331}," (close(sa[",[155,902,868],{"class":185},[155,904,905],{"class":331},"], sb[",[155,907,868],{"class":185},[155,909,450],{"class":331},[155,911,621],{"class":169},[155,913,914],{"class":331}," close(wa[",[155,916,868],{"class":185},[155,918,919],{"class":331},"], wb[",[155,921,868],{"class":185},[155,923,924],{"class":331},"])\n",[155,926,928,931,934,936,938,940,943],{"class":157,"line":927},42,[155,929,930],{"class":169},"            and",[155,932,933],{"class":331}," ts(sb[",[155,935,868],{"class":185},[155,937,450],{"class":331},[155,939,418],{"class":169},[155,941,942],{"class":331}," ts(tb)                   ",[155,944,945],{"class":297},"# 后一条还没过 5 小时重置点\n",[155,947,949,951,954,957,959,961,964,966],{"class":157,"line":948},43,[155,950,930],{"class":169},[155,952,953],{"class":331}," sb[",[155,955,956],{"class":185},"\"usedPercent\"",[155,958,406],{"class":331},[155,960,815],{"class":169},[155,962,963],{"class":331}," sa[",[155,965,956],{"class":185},[155,967,390],{"class":331},[155,969,971,973,976,978,980,982,985,987],{"class":157,"line":970},44,[155,972,930],{"class":169},[155,974,975],{"class":331}," wb[",[155,977,956],{"class":185},[155,979,406],{"class":331},[155,981,815],{"class":169},[155,983,984],{"class":331}," wa[",[155,986,956],{"class":185},[155,988,924],{"class":331},[155,990,992],{"class":157,"line":991},45,[155,993,310],{"emptyLinePlaceholder":309},[155,995,997],{"class":157,"line":996},46,[155,998,310],{"emptyLinePlaceholder":309},[155,1000,1002,1005,1007],{"class":157,"line":1001},47,[155,1003,1004],{"class":331},"groups ",[155,1006,381],{"class":169},[155,1008,1009],{"class":331}," []\n",[155,1011,1013,1015,1017,1019],{"class":157,"line":1012},48,[155,1014,589],{"class":169},[155,1016,592],{"class":331},[155,1018,595],{"class":169},[155,1020,1021],{"class":331}," samples:\n",[155,1023,1025,1027,1030,1032,1035,1037,1039,1042,1044,1046],{"class":157,"line":1024},49,[155,1026,856],{"class":169},[155,1028,1029],{"class":331}," groups ",[155,1031,621],{"class":169},[155,1033,1034],{"class":331}," same_window(groups[",[155,1036,726],{"class":169},[155,1038,387],{"class":165},[155,1040,1041],{"class":331},"][",[155,1043,726],{"class":169},[155,1045,387],{"class":165},[155,1047,1048],{"class":331},"], s):\n",[155,1050,1052,1055,1057,1059],{"class":157,"line":1051},50,[155,1053,1054],{"class":331},"        groups[",[155,1056,726],{"class":169},[155,1058,387],{"class":165},[155,1060,1061],{"class":331},"].append(s)\n",[155,1063,1065,1068],{"class":157,"line":1064},51,[155,1066,1067],{"class":169},"    else",[155,1069,1070],{"class":331},":\n",[155,1072,1074],{"class":157,"line":1073},52,[155,1075,1076],{"class":331},"        groups.append([s])\n",[155,1078,1080],{"class":157,"line":1079},53,[155,1081,310],{"emptyLinePlaceholder":309},[155,1083,1085,1088,1090,1093,1095],{"class":157,"line":1084},54,[155,1086,1087],{"class":331},"total_s ",[155,1089,381],{"class":169},[155,1091,1092],{"class":331}," total_w ",[155,1094,381],{"class":169},[155,1096,1097],{"class":165}," 0\n",[155,1099,1101,1103,1106,1108],{"class":157,"line":1100},55,[155,1102,589],{"class":169},[155,1104,1105],{"class":331}," g ",[155,1107,595],{"class":169},[155,1109,1110],{"class":331}," groups:\n",[155,1112,1114,1117,1119,1122,1125,1128,1130,1132],{"class":157,"line":1113},56,[155,1115,1116],{"class":331},"    (ta, sa, wa), (tb, sb, wb) ",[155,1118,381],{"class":169},[155,1120,1121],{"class":331}," g[",[155,1123,1124],{"class":165},"0",[155,1126,1127],{"class":331},"], g[",[155,1129,726],{"class":169},[155,1131,387],{"class":165},[155,1133,390],{"class":331},[155,1135,1137,1140,1142,1144,1146,1148,1150,1152,1154],{"class":157,"line":1136},57,[155,1138,1139],{"class":331},"    ds ",[155,1141,381],{"class":169},[155,1143,953],{"class":331},[155,1145,956],{"class":185},[155,1147,406],{"class":331},[155,1149,726],{"class":169},[155,1151,963],{"class":331},[155,1153,956],{"class":185},[155,1155,390],{"class":331},[155,1157,1159,1162,1164,1166,1168,1170,1172,1174,1176],{"class":157,"line":1158},58,[155,1160,1161],{"class":331},"    dw ",[155,1163,381],{"class":169},[155,1165,975],{"class":331},[155,1167,956],{"class":185},[155,1169,406],{"class":331},[155,1171,726],{"class":169},[155,1173,984],{"class":331},[155,1175,956],{"class":185},[155,1177,390],{"class":331},[155,1179,1181,1183,1186,1189,1192,1195,1198,1200,1203],{"class":157,"line":1180},59,[155,1182,856],{"class":169},[155,1184,1185],{"class":331}," ds ",[155,1187,1188],{"class":169},"\u003C",[155,1190,1191],{"class":331}," min_delta ",[155,1193,1194],{"class":169},"or",[155,1196,1197],{"class":331}," dw ",[155,1199,732],{"class":169},[155,1201,1202],{"class":165}," 0",[155,1204,1070],{"class":331},[155,1206,1208],{"class":157,"line":1207},60,[155,1209,1210],{"class":169},"        continue\n",[155,1212,1214,1217,1220],{"class":157,"line":1213},61,[155,1215,1216],{"class":331},"    total_s ",[155,1218,1219],{"class":169},"+=",[155,1221,1222],{"class":331}," ds\n",[155,1224,1226,1229,1231],{"class":157,"line":1225},62,[155,1227,1228],{"class":331},"    total_w ",[155,1230,1219],{"class":169},[155,1232,1233],{"class":331}," dw\n",[155,1235,1237,1240,1243,1246,1248,1250,1253,1255,1258,1260,1263,1265,1268,1270,1273,1276,1278,1281,1283,1286,1288,1290,1293,1295,1298,1300,1303,1306,1308,1310],{"class":157,"line":1236},63,[155,1238,1239],{"class":165},"    print",[155,1241,1242],{"class":331},"(",[155,1244,1245],{"class":169},"f",[155,1247,500],{"class":185},[155,1249,503],{"class":165},[155,1251,1252],{"class":331},"ta",[155,1254,509],{"class":165},[155,1256,1257],{"class":185}," → ",[155,1259,503],{"class":165},[155,1261,1262],{"class":331},"tb",[155,1264,509],{"class":165},[155,1266,1267],{"class":185},"  5h +",[155,1269,503],{"class":165},[155,1271,1272],{"class":331},"ds",[155,1274,1275],{"class":169},":g",[155,1277,509],{"class":165},[155,1279,1280],{"class":185},"  周 +",[155,1282,503],{"class":165},[155,1284,1285],{"class":331},"dw",[155,1287,1275],{"class":169},[155,1289,509],{"class":165},[155,1291,1292],{"class":185},"  比例 ",[155,1294,503],{"class":165},[155,1296,1297],{"class":331},"dw ",[155,1299,488],{"class":169},[155,1301,1302],{"class":331}," ds",[155,1304,1305],{"class":169},":.1%",[155,1307,509],{"class":165},[155,1309,500],{"class":185},[155,1311,778],{"class":331},[155,1313,1315],{"class":157,"line":1314},64,[155,1316,310],{"emptyLinePlaceholder":309},[155,1318,1320,1322],{"class":157,"line":1319},65,[155,1321,409],{"class":169},[155,1323,1324],{"class":331}," total_s:\n",[155,1326,1328,1331,1333,1335,1337],{"class":157,"line":1327},66,[155,1329,1330],{"class":331},"    r ",[155,1332,381],{"class":169},[155,1334,1092],{"class":331},[155,1336,488],{"class":169},[155,1338,1339],{"class":331}," total_s\n",[155,1341,1343,1345,1347,1349,1352,1354,1357,1359,1361,1364,1366,1369,1371,1373,1376,1378,1381,1383,1385,1388,1391,1393,1396,1399,1401,1404],{"class":157,"line":1342},67,[155,1344,1239],{"class":165},[155,1346,1242],{"class":331},[155,1348,1245],{"class":169},[155,1350,1351],{"class":185},"\"合计：5h +",[155,1353,503],{"class":165},[155,1355,1356],{"class":331},"total_s",[155,1358,1275],{"class":169},[155,1360,509],{"class":165},[155,1362,1363],{"class":185},"，周 +",[155,1365,503],{"class":165},[155,1367,1368],{"class":331},"total_w",[155,1370,1275],{"class":169},[155,1372,509],{"class":165},[155,1374,1375],{"class":185}," → 一整轮 5h ≈ 周额度的 ",[155,1377,503],{"class":165},[155,1379,1380],{"class":331},"r",[155,1382,1305],{"class":169},[155,1384,509],{"class":165},[155,1386,1387],{"class":185},"，一周约 ",[155,1389,1390],{"class":165},"{1",[155,1392,494],{"class":169},[155,1394,1395],{"class":331}," r",[155,1397,1398],{"class":169},":.1f",[155,1400,509],{"class":165},[155,1402,1403],{"class":185}," 轮\"",[155,1405,778],{"class":331},[155,1407,1409,1412],{"class":157,"line":1408},68,[155,1410,1411],{"class":169},"else",[155,1413,1070],{"class":331},[155,1415,1417,1419,1421,1424],{"class":157,"line":1416},69,[155,1418,1239],{"class":165},[155,1420,1242],{"class":331},[155,1422,1423],{"class":185},"\"没有符合条件的样本：放宽起始时间，或调低 5 小时增量下限\"",[155,1425,778],{"class":331},[15,1427,1428],{},"Execution:",[146,1430,1432],{"className":148,"code":1431,"language":150,"meta":151,"style":151},"python3 quota_ratio.py claude 2026-10-15\n",[119,1433,1434],{"__ignoreMap":151},[155,1435,1436,1439,1442,1444],{"class":157,"line":158},[155,1437,1438],{"class":161},"python3",[155,1440,1441],{"class":185}," quota_ratio.py",[155,1443,225],{"class":185},[155,1445,1446],{"class":185}," 2026-10-15\n",[15,1448,1449],{},"Observed output from October 22:",[146,1451,1456],{"className":1452,"code":1454,"language":1455,"meta":151},[1453],"language-text","2026-10-19T03:59:15Z → 2026-10-19T07:59:31Z  5h +56  周 +8  比例 14.3%\n2026-10-19T14:57:59Z → 2026-10-19T18:55:03Z  5h +19  周 +2  比例 10.5%\n2026-10-20T10:56:43Z → 2026-10-20T14:57:51Z  5h +91  周 +11  比例 12.1%\n2026-10-22T02:59:05Z → 2026-10-22T06:56:11Z  5h +64  周 +9  比例 14.1%\n2026-10-22T07:56:59Z → 2026-10-22T11:52:47Z  5h +44  周 +6  比例 13.6%\n合计：5h +274，周 +36 → 一整轮 5h ≈ 周额度的 13.1%，一周约 7.6 轮\n","text",[119,1457,1454],{"__ignoreMap":151},[15,1459,1460],{},"The script performs three tasks:",[1462,1463,1464,1477,1484],"ol",{},[130,1465,1466,1467,1470,1471,1473,1474,1476],{},"Filters timestamps matching ",[119,1468,1469],{},"since"," for the active account and aligns ",[119,1472,244],{}," and ",[119,1475,252],{}," entries.",[130,1478,1479,1480,1483],{},"Identifies continuous windows where ",[119,1481,1482],{},"resetsAt"," aligns within 60 seconds and neither metric decreases.",[130,1485,1486],{},"Calculates delta per window using first and last records, filters out trivial increments, and sums totals before dividing.",[15,1488,1489],{},"Individual window ratios fluctuate between 10.5% and 14.3% due to integer truncation. The aggregated 13.1% lines up closely with the manual 12.5% samples, making 12.5%–13% a reliable budgeting baseline.",[15,1491,1492],{},"For other providers:",[146,1494,1496],{"className":148,"code":1495,"language":150,"meta":151,"style":151},"python3 quota_ratio.py codex 2026-10-20T07:23:40Z   # 从本周周窗口开始的时间算起（UTC）\npython3 quota_ratio.py antigravity 2026-10-14 2     # 百分比是小数，但会回落，下限设成 2\n",[119,1497,1498,1513],{"__ignoreMap":151},[155,1499,1500,1502,1504,1507,1510],{"class":157,"line":158},[155,1501,1438],{"class":161},[155,1503,1441],{"class":185},[155,1505,1506],{"class":185}," codex",[155,1508,1509],{"class":185}," 2026-10-20T07:23:40Z",[155,1511,1512],{"class":297},"   # 从本周周窗口开始的时间算起（UTC）\n",[155,1514,1515,1517,1519,1522,1525,1527],{"class":157,"line":179},[155,1516,1438],{"class":161},[155,1518,1441],{"class":185},[155,1520,1521],{"class":185}," antigravity",[155,1523,1524],{"class":185}," 2026-10-14",[155,1526,421],{"class":165},[155,1528,1529],{"class":297},"     # 百分比是小数，但会回落，下限设成 2\n",[15,1531,1532],{},"Codex yields 15.6% (~15.7% in interactive runs). Antigravity yields 28.9% (~28.57% across 2\u002F7 integer fractions).",[141,1534,1536],{"id":1535},"step-4-translating-ratios-into-daily-pacing-targets","Step 4: Translating Ratios into Daily Pacing Targets",[15,1538,1539],{},"Formulas:",[127,1541,1542,1548],{},[130,1543,1544,1545],{},"Windows per week ≈ ",[119,1546,1547],{},"1 \u002F r",[130,1549,1550,1551,1554,1555,1558],{},"Target usage per day across ",[119,1552,1553],{},"D"," active days = ",[119,1556,1557],{},"1 \u002F (D × r)"," full windows",[22,1560,1561,1574],{},[25,1562,1563],{},[28,1564,1565,1568,1571],{},[31,1566,1567],{},"Account (r)",[31,1569,1570],{},"7 Active Days \u002F Week",[31,1572,1573],{},"5 Active Days \u002F Week",[44,1575,1576,1587,1598],{},[28,1577,1578,1581,1584],{},[49,1579,1580],{},"Claude (12.5%)",[49,1582,1583],{},"1 full window daily + 1 extra window on 1 day",[49,1585,1586],{},"2 windows daily at ~80% each",[28,1588,1589,1592,1595],{},[49,1590,1591],{},"Codex (16%)",[49,1593,1594],{},"~90% of a full window daily",[49,1596,1597],{},"~125% of a window daily (e.g., 80% morning, 45% evening)",[28,1599,1600,1603,1606],{},[49,1601,1602],{},"Antigravity (28.6%)",[49,1604,1605],{},"Half a window daily",[49,1607,1608],{},"~70% of a window daily",[15,1610,1611,1612,1615,1616,1619,1620,1623],{},"Mid-week rebalancing formula: ",[119,1613,1614],{},"Remaining Weekly Quota ÷ Remaining Days ÷ r"," determines needed daily window throughput. Alternatively, compare elapsed weekly window percentage against consumed quota. The ",[119,1617,1618],{},"expectedUsedPercent"," field in ",[119,1621,1622],{},"codexbar usage --format json"," directly tracks this pace.",[141,1625,1627],{"id":1626},"step-5-near-reset-feasibility-check","Step 5: Near-Reset Feasibility Check",[15,1629,1630],{},[119,1631,1632],{},"Maximum Achievable Quota = Current Weekly % + (Remaining in Current Window % + Max Usable Future Windows × 100%) × r",[15,1634,1635,1636,1639],{},"On October 22: at 11:54 AM, Claude weekly usage was 46% with 22:00 reset; the 5-hour window was at 85% with 15:20 reset. Burning the remaining 15%, completing a full window after 15:20, and running a final window before 22:00 yields: ",[119,1637,1638],{},"46% + (15 + 100 + 100) × 12.5% ≈ 73%",". Over a quarter of weekly allocation was mathematically unreachable.",[10,1641,1643],{"id":1642},"_4-troubleshooting-and-edge-cases","4. Troubleshooting and Edge Cases",[22,1645,1646,1659],{},[25,1647,1648],{},[28,1649,1650,1653,1656],{},[31,1651,1652],{},"Symptom",[31,1654,1655],{},"Root Cause",[31,1657,1658],{},"Fix",[44,1660,1661,1676,1690,1719,1730,1741,1752,1763],{},[28,1662,1663,1670,1673],{},[49,1664,1665,1666,1669],{},"Hardcoded timestamps throw ",[119,1667,1668],{},"KeyError"," on repeat runs",[49,1671,1672],{},"Snapshots within the same hour are overwritten by newer samples",[49,1674,1675],{},"Filter entries dynamically rather than hardcoding timestamps",[28,1677,1678,1684,1687],{},[49,1679,1680,1681,1683],{},"Window ",[119,1682,1482],{}," values misalign",[49,1685,1686],{},"Idle entries use synthetic timestamps; resets jitter by ±1 min",[49,1688,1689],{},"Allow 60-second tolerance; treat missing fields as window breaks",[28,1691,1692,1699,1709],{},[49,1693,1694,1695,1698],{},"Antigravity ",[119,1696,1697],{},"primary"," is not 5 hours",[49,1700,1701,1702,1704,1705,1708],{},"Field mapping differs: Antigravity ",[119,1703,1697],{}," tracks Gemini weekly, ",[119,1706,1707],{},"secondary"," tracks Claude\u002FGPT 5h",[49,1710,1711,1712,1715,1716],{},"Key off ",[119,1713,1714],{},"windowMinutes"," and bucket ",[119,1717,1718],{},"id",[28,1720,1721,1724,1727],{},[49,1722,1723],{},"Menu bar displays 80% while CLI shows 85%",[49,1725,1726],{},"Menu bar UI uses cached state",[49,1728,1729],{},"Trust CLI values for calculations",[28,1731,1732,1735,1738],{},[49,1733,1734],{},"Adjacent sample ratios swing wildly between 12.5% and 20%",[49,1736,1737],{},"Integer percentage quantization",[49,1739,1740],{},"Use larger window deltas and aggregate before division",[28,1742,1743,1746,1749],{},[49,1744,1745],{},"Antigravity usage drops backward",[49,1747,1748],{},"Unknown server-side reconciliation; quota pools are fragmented",[49,1750,1751],{},"Only evaluate strictly increasing windows with large deltas",[28,1753,1754,1757,1760],{},[49,1755,1756],{},"Estimating Claude vs Gemini cost multiplier in Antigravity",[49,1758,1759],{},"Claude and GPT share a combined quota pool",[49,1761,1762],{},"Insufficient discrete logging; requires controlled benchmark tasks",[28,1764,1765,1768,1777],{},[49,1766,1767],{},"CLI dumps contain email or organization names",[49,1769,1770,1473,1773,1776],{},[119,1771,1772],{},"accountEmail",[119,1774,1775],{},"accountOrganization"," fields",[49,1778,1779],{},"Sanitize JSON before sharing logs",[10,1781,1783],{"id":1782},"_5-summary-and-scope","5. Summary and Scope",[15,1785,1786],{},"If you use CodexBar and need predictable capacity planning across multiple AI subscriptions, this delta-based method provides an actionable schedule:",[127,1788,1789,1792,1795,1798],{},[130,1790,1791],{},"Conversion ratios reflect single-account, single-cycle observations. Upgrades (e.g. Claude Max) or shifts in reasoning effort require re-evaluating.",[130,1793,1794],{},"Codex weekly reset timestamps can adjust mid-cycle. Follow live CLI reset values.",[130,1796,1797],{},"Complimentary quota resets are treated separately (e.g. Codex Full resets or Claude limit resets).",[130,1799,1800],{},"Antigravity's ~28.6% ratio has wider variance due to pool telemetry fluctuations.",[1802,1803,1804],"style",{},"html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}",{"title":151,"searchDepth":179,"depth":179,"links":1806},[1807,1808,1809,1816,1817],{"id":12,"depth":179,"text":13},{"id":106,"depth":179,"text":107},{"id":138,"depth":179,"text":139,"children":1810},[1811,1812,1813,1814,1815],{"id":143,"depth":306,"text":144},{"id":237,"depth":306,"text":238},{"id":277,"depth":306,"text":278},{"id":1535,"depth":306,"text":1536},{"id":1626,"depth":306,"text":1627},{"id":1642,"depth":179,"text":1643},{"id":1782,"depth":179,"text":1783},"coder","2026-10-22","Calculating the exact ratio of a 5-hour quota window relative to weekly limits across Claude Pro, Codex, and Antigravity using local CodexBar usage history and Python.","md",null,{},"\u002Fen\u002Fblog\u002Fcodexbar-5h-vs-weekly-quota-calculation",{"title":5,"description":1820},"codexbar-5h-vs-weekly-quota-calculation","publish","en\u002Fblog\u002Fcodexbar-5h-vs-weekly-quota-calculation",[1830,1831,1832,1833,1834],"CodexBar","Claude","Codex","Antigravity","AI Quota","OJTq31LTq4z4w4heH7UBEYq2Oh67x7Bu4cAMtg9SbIE",[1837,1843],{"title":1838,"path":1839,"stem":1840,"slug":1841,"date":1842,"children":-1},"Goodbye \"Use Mac Preview for Now\": Antigravity 2.28.0 Brings Built-in PDF Viewer and Browser","\u002Fen\u002Fblog\u002Fantigravity-2-28-0-builtin-pdf-viewer-browser","en\u002Fblog\u002Fantigravity-2-28-0-builtin-pdf-viewer-browser","antigravity-2-28-0-builtin-pdf-viewer-browser","2026-10-28",{"title":1844,"path":1845,"stem":1846,"slug":1847,"date":1848,"children":-1},"Guiding ChatGPT in Chrome: Navigating to Moodle Question Banks and Editing Questions","\u002Fen\u002Fblog\u002Fchatgpt-browser-moodle-question-bank","en\u002Fblog\u002Fchatgpt-browser-moodle-question-bank","chatgpt-browser-moodle-question-bank","2026-10-21",1795196298607]