Status-only pools

grok accounts, pooled for inventory with no supervisor and no switching

The grok pool shares the account commands, the state layout, and the status view with the Claude and Codex pools, and nothing else: no supervisor shim, no hooks, no statusline tee, no session presence, and no switching. It keeps an inventory of accounts and the credential each one holds, and status reads each account's subscription credit window.

tokenmaxxing init --grok          # pool the first grok login (status-only)
tokenmaxxing add --grok           # pool another one through an isolated login

init, add, auth, rm, and rename take --grok; every other command refuses the flag with exit code 2, and the pool flags are mutually exclusive. init verifies the vendor CLI and pins its path (grokBin in config.json; TOKENMAXXING_GROK_BIN overrides it), then prints that the pool is status-only. doctor, check, and the periodic timer ignore the pool, and uninstall keeps its stores.

grok

An account is a grok CLI login. init --grok imports the first entry of ~/.grok/auth.json (GROK_HOME is honored) and points at add --grok for the rest; with no live login it runs grok login in a throwaway GROK_HOME under the state directory. add --grok and auth --grok always use the isolated login. Identity is the entry's user id, the label defaults to the email in the entry, and the harvested entry is written verbatim to grok-stores/<uuid8>/auth.json at mode 0600.

Usage is the weekly subscription credit window from GET https://cli-chat-proxy.grok.com/v1/billing?format=credits (creditUsagePercent, classified by the period's duration). The endpoint leaves creditUsagePercent out while the period's use is 0, so a credits body without it reads as 0%. TOKENMAXXING_GROK_USAGE_URL overrides that URL for hermetic runs. The dollar billing body (GET /v1/billing without format=credits) is not quota: subscription accounts report monthlyLimit 0 there while credits remain, and a parser that treats that body as usage reports the account depleted. tokenmaxxing does not refresh grok tokens; a stored access token that has expired is retried against the live GROK_HOME login when that login is the same account. A failed read does not write the dollar body: an account with no stored window stays unmeasured, and one with a stored credits window keeps that figure as stale as it was.

What status shows

status renders the pool after Claude and Codex, headed grok (N accounts, status-only) and skipped when empty. A grok account renders the weekly credit bar from the credits billing read. The live sample is the credits GET (and a live-login retry when the stored access token is expired). status shows sampling grok usage... on a terminal while the check runs, erases it, then reports live sample failed when the read fails (run auth --grok when the store has no usable credential); status --cached skips the check and notes never sampled when nothing is stored. status --json always carries the pool under grok, with the same pool shape as the others. usage is the weekly credit window when a sample has landed. sessions is 0. exhausted follows the same bars as the other pools when the account has a stored window, and is false when the account is unmeasured.

State

PathWhat it holds
grok-accounts.jsonThe pool index, the same schema as accounts.json; it names no active account
grok-lockThe flock file that serializes the pool's commands
grok-stores/<uuid8>/auth.jsonOne 0600 store per account
grok-onboard/Throwaway login home, wiped before and after each isolated login

On this page