Repository navigation
Configuration
Three files, all TOML, all safe to hand-edit while clauth runs (it reloads on external change):
-
~/.clauth/profiles.tomlfor everything program-wide: profile order, the active marker, the fallback chain, appearance, the scheduler. -
~/.clauth/profiles/<name>/config.tomlfor one account: endpoint, key, env, model routing, its chain settings. -
~/.clauth/codex-profiles.tomlfor the codex roster: its own active marker, chain and weekly line (Codex).
Most keys below have a TUI equivalent on the Setup, Fallback, Config or Services tab (Interface and keys). A few are written only by a command or by clauth itself; those cells say which. The codex file's chain keys have no TUI equivalent; Setup creates and deletes its profiles.
Claude Pro / Max / Ultra / Team / Enterprise. Leave base_url blank. clauth captures the OAuth token from your session or mints one through clauth login, then detects the plan tier from Anthropic's profile endpoint. The login also stamps the account's rateLimitTier into the credential, which Claude Code reads at startup for plan-gated flags; a profile minted earlier picks the stamp up on its next usage poll (the hourly /profile fetch), or immediately with one clauth login <name>.
API endpoint. Set base_url, and api_key if the endpoint wants one. Works against the Anthropic API or any compatible proxy. The key is handed to Claude Code through apiKeyHelper rather than written into settings.json.
Proxy account. clauth login <name> --proxy <service> creates an account on a clauth proxy (Quickstart). Its base_url is the proxy's loopback address and its api_key the inference key the proxy minted, which reaches Claude Code through apiKeyHelper too, and its usage figures come from the proxy. The upstream credential stays in the proxy's state dir; clauth never holds it.
Long-lived setup token. clauth login <name> --setup-token stores a claude setup-token mint as session-token.json. Sessions run on that static login, which never races clauth's token refresher. The Setup tab then shows a token row counting down to the re-mint. The mint reads as untiered to Claude Code (its scope set cannot read /profile, so no tier can be stamped), and plan-gated flags evaluate against their untiered default.
The token outranks the profile's OAuth pair at every switch for as long as it exists, so a later clauth login <name> updates only what clauth polls usage with — unless rolling_token is set, when every rotation re-stamps the token from that login instead, so the sessions move onto it at the next rotation, another account's if that is what you logged in as. The note the login prints says which of the two applies. clauth static-token <name> --clear drops it and puts the OAuth login back in front of sessions — the full exit: the preserved mint backup and the rolling_token flag go with it, so nothing re-creates a sidecar afterwards.
Usage probe. A setup token alone gives /usage nothing to read, since its two scopes lack user:profile. With usage_probe = true on such an account (the Setup tab's usage probe row), clauth sends the auto-start kick's 1-token Haiku request on the setup token every usage_probe_interval_ms and reads the account's 5h and 7d windows off the rate-limit headers the response carries. The reading lands as a /usage reading does: on the Usage tab and the Overview, in usage_history.jsonl, which the burn rate and the auto-start queue read, and in the fallback walk. Every probe is inference on that account and may start its 5-hour window — a plan with no 5h limit has none to start. The interval defaults to 90s and stays between 60s and 450s; a value outside is clamped into it. The floor bounds what the probes cost. The cap keeps the gap between two probes, the interval plus a spread of up to a quarter of it, under the 10 minutes past which the burn rate cuts its history, so a probe at the cap still gets a burn rate. An organization that refuses the account (on hold, disabled, a key whose creator left it, an endpoint closed to its region or an address outside its allowed range) reads org refused, apart from a canceled subscription, and no automatic switch lands there; the next good reading lifts it. A 401 or 403 is a refused token only when its body is the server's own refusal of the credential: a page a proxy or a firewall in front of the API answers with is a failed probe. A token the server refuses is a dead login, as a rejected api key is: no automatic switch, clauth start --auto, day claim or recovery lands on the account, and a delegate onto it is refused before it spends. The Usage tab, the Fallback card, clauth list and the plugin's profiles read token rejected, the card with re-mint with clauth login <name> --setup-token, and the selector and the Overview mark the account (×, and ⊘ before its name). The verdict is kept against that token in third_party_auth.json, so a restart, the daemon's included, or a switched-off probe keeps it; any other probe outcome lifts it, as for a rejected key, and a new token retires it. An OAuth pair stored beside the token keeps it: a switch installs the token ahead of the pair, so sessions there would still run on it. The token is not probed again until clauth login <name> --setup-token captures a new one claude setup-token minted, clauth restarts, another clauth process takes over fetching usage, or the probe is switched off and on, since the rest lives in memory only. A manual refresh retries it once too, but only in the clauth process that fetches usage; beside a stored OAuth pair that retry settles the token's verdict alone, and the pair's /usage reading stays. While an OAuth pair is stored the switch does nothing, since /usage reads that account, and so it does where no setup token is stored, since the probe would have nothing to send: the Setup tab shows the row only where one is. A proxy account is never probed, whatever usage_probe says, and shows no row.
A mint is a narrower credential than a /login session: it carries user:inference and user:sessions:claude_code and no refresh token, against the five scopes a browser login stores. Claude Code turns off anything gated on the wider set, Claude in Chrome by name. Clear the token if you want those features back — or arm clauth rolling-token <name> (or the Setup tab's switch to a rolling token row), which has the daemon re-stamp the sidecar from the profile's own usage chain: still no refresh token in front of sessions, but the chain's full scope set, plan stamp and rateLimitTier, so plan-gated models and flags work. A second live session holding one rotating login earns a warning naming clauth rolling-token <name> before a refresh signs the others out, and a session started before the arming converges onto the sidecar on its own next poll. The superseded mint waits at session-token.static.json and the bare clauth static-token <name> puts it back.
Five providers get typed usage panels:
| Provider | Base URL | Shows |
|---|---|---|
| DeepSeek | https://api.deepseek.com |
balance rows per currency: api balance, granted, topped up |
| Z.ai | https://api.z.ai |
percentage bars per limit window (5h / 7d) plus an mcp tools bar (the MCP web tools' monthly quota), per-tool rows, plan level, 7-day per-model token totals |
| OpenRouter | https://openrouter.ai |
wallet rows from the credits endpoint: api balance (remaining credits, red when overdrawn), used, purchased; then today / this week / this month usage, per-key cap rows when set, free-tier flag |
| Alibaba Model Studio | the Qwen preset endpoint below and the four Model Studio hosts (token-plan.ap-southeast-1.maas.aliyuncs.com, token-plan.cn-beijing.maas.aliyuncs.com, coding-intl.dashscope.aliyuncs.com, coding.dashscope.aliyuncs.com) |
a 30d bar carrying your tier's monthly allowance, gated at the weekly line, a 5h bar when the API reports one, plan tier, subscription status and days left |
| MiniMax | https://api.minimax.io |
Token Plan bars for the 5h interval and the 7d window, plus a remaining row per plan bucket. The bars follow general, the bucket Claude Code bills against — or the lone bucket when the account has exactly one; with more than one bucket and no general, no bars are drawn. video and any other bucket ride as rows only. The mainland-China endpoint is not covered — it is a separate account on a different host, so it falls to the best-effort scan below |
Any other endpoint is scanned best-effort: clauth probes a short list of usage paths on the origin your key already authorizes, and renders whatever percentage, fraction-left window, or balance shapes come back. Those panels carry a "looks wrong? report it" line, since the shape is guessed. An endpoint that returns nothing usable is rescanned at most once every five minutes (or once per refresh interval, whichever is longer), and r forces a rescan immediately, but only in the clauth instance holding the usage-fetch lease: an open TUI reading a running daemon's results instead of polling itself rescans nothing and only toasts that the daemon refreshes the account on its own schedule. A dead api key stops polling the same way, on any endpoint: the provider rejected it — a 401 on most endpoints, an in-band code inside an HTTP 200 on MiniMax — so the Usage tab reads api key rejected, re-enter it on the setup tab (a [ key rejected ] chip beside cached numbers instead) and clauth list marks the account (key rejected).
For those five, open provider console in the TUI action menu (Interface and keys) opens the page the account's key is minted on. The pages, if you would rather go directly:
| Endpoint | Page |
|---|---|
| DeepSeek | https://platform.deepseek.com/api_keys |
| Z.ai | https://z.ai/manage-apikey/apikey-list |
| OpenRouter | https://openrouter.ai/settings/keys |
| MiniMax | https://platform.minimax.io/user-center/payment/token-plan |
| Alibaba Token Plan, international | https://modelstudio.console.alibabacloud.com/ap-southeast-1?tab=plan#/efm/subscription/overview |
| Alibaba Token Plan, mainland China | https://bailian.console.aliyun.com/cn-beijing?tab=plan#/efm/subscription/overview |
| Alibaba Coding Plan, international | https://modelstudio.console.alibabacloud.com/ap-southeast-1/?tab=globalset#/efm/coding_plan |
| Alibaba Coding Plan, mainland China | https://bailian.console.aliyun.com/cn-beijing/?tab=plan#/efm/subscription/coding-plan |
| Qwen Cloud Token Plan | https://home.qwencloud.com/api-keys |
Alibaba gets five rows because Token Plan and Coding Plan are separate products with separate quotas, sold on two consoles that do not share accounts, and Qwen Cloud's Token Plan lives on Qwen Cloud's own console. Take the key from the page matching the endpoint you configured, or your calls bill against a plan you did not mean. The key is the sk-sp-… one for your plan: on a Model Studio console that is your plan's own page, not a workspace key from the general api-key page, which is billed pay-as-you-go instead of drawing your plan's quota; on Qwen Cloud's API Keys page, take it from the Token Plan section (Individual or Team tab), not a pay-as-you-go key.
An AccessKey pair from the RAM console is a different thing again and clauth has no use for one. It cannot read a Solo plan's quota (measured, on the signed OpenAPI), so nothing here asks for one.
Alibaba is the one provider whose api key cannot read its own quota: every quota endpoint ignores the key outright. Those panels run on a separate console session instead. clauth login <account> on a Model Studio account opens the Alibaba console in your browser and stores the session it hands back as a [console] table in that account's config.toml. Nothing else on the account changes. The console returns an api key and an endpoint alongside the session, both scoped to a workspace rather than to your plan and billed separately from it, so clauth discards them.
The 48-hour clock runs from your aliyun console sign-in, so it is already ticking by the time clauth login captures the session. Running the login again inherits whatever is left of that window, which can be minutes; sign in to the Alibaba console afresh first if you want a full one. Once it lapses, clauth stops polling that account: the Usage tab reads console login expired, run clauth login and clauth list marks it (login expired). Polling resumes the moment a new session lands on disk, with no restart.
An account with no api key at all still gets its usage panel, since the quota rides the console session. It just cannot run Claude Code until you add a key (or an auth token in its [env]).
The Setup tab's re-login row runs this same console flow on a Model Studio account, so the shell is no longer the only route to it. Starting one from nothing is still two steps, because the console a session comes from is read off the endpoint: give the account an Alibaba endpoint first (the Qwen preset on the Setup tab, or --base-url here), then log in.
Per account, on the Setup tab or in config.toml:
[models]
default = "opusplan" # preset alias or a full model id
opus = "claude-opus-4-5-20251101" # ANTHROPIC_DEFAULT_OPUS_MODEL
sonnet = "claude-sonnet-4-5-20250929" # ANTHROPIC_DEFAULT_SONNET_MODEL
haiku = "claude-haiku-4-5-20251001" # ANTHROPIC_DEFAULT_HAIKU_MODEL
fable = "claude-fable-5" # ANTHROPIC_DEFAULT_FABLE_MODEL
subagent = "claude-sonnet-4-5-20250929" # CLAUDE_CODE_SUBAGENT_MODEL
advisor = "opus" # advisorModel, the server-side advisor's modeldefault and advisor land as the top-level model and advisorModel keys in settings.json; the rest ride in its env block. A switch or a clauth start applies whichever account you land on.
A row writes its key over whatever the file holds, and in ~/.claude/settings.json saves a value of yours it replaces. An unset row puts that value back there, or removes its key when there was none (a clauth start copy only removes it), only while the file still holds the value clauth itself last wrote there, so the last account's routing (a provider preset's model ids, say) never follows you onto an account without that row, and a value you set yourself stays: a model you picked with Claude Code's /model, an advisor picked with /advisor, or any of these keys edited by hand survives a switch in ~/.claude/settings.json, and a clauth start copies it from there into the session's copy (an --isolated start builds from an empty file and keeps nothing). The record of what clauth wrote is a SHA-256 digest per key in ~/.clauth/base-env.json, beside the value of yours a row or [env] value replaced (Storage layout). For a value clauth wrote before it kept that record, the first change after the update that judges it (a switch, a switch-off, deleting the active account, a first account's create, a login that makes an account active or re-applies the active one, an edit of the active account's [models], [env], endpoint or effort, or the divergence resolver adopting or capturing the live login): a value equal to the own row or [env] value of the account the file was last written for (every account's, while none was active) counts as clauth's, and any other value as yours. When the marker in base-env.json does not match the one on disk (for example, an older clauth still running, or a hand edit of profiles.toml), the next change that judges these keys counts a value equal to any account's own row or [env] value, or one the record names as clauth's, as clauth's, and keeps any other value as yours; a key the file no longer holds gets back the value of yours a row or [env] value replaced, since an older clauth removes these keys on its way out. A base-env.json that does not parse refuses any change of the active account but a switch-off, and a clauth start, that must judge one of these keys, and leaves both files as they were; a switch-off still switches off, leaves both files as they were and logs that your values were not put back. A switch-off puts back each value of yours a row or [env] value replaced while the file still holds clauth's value there, and keeps clauth's other values in place; the next change that applies an account removes the ones that count as clauth's. An account with no advisor row therefore removes only an advisorModel clauth wrote; set advisor on each account that should always have one. advisor takes an alias (opus) or a full model id, and it is a model like any other for what an account has to serve: clauth start --auto and the MCP delegate count it (Auto-Switch). No built-in preset binds it.
effort is a top-level key of its own, outside [models]:
effort = "high" # CLAUDE_CODE_EFFORT_LEVEL, the session's reasoning effortIt takes low, medium, high, xhigh or max, or any custom value, passed through verbatim. Claude Code reads CLAUDE_CODE_EFFORT_LEVEL in any letter case: it takes those five levels, med and a token budget (a value that opens with an integer after any leading whitespace); auto and unset run the model default, held under any maxEffortLevel cap, and it ignores any other value. While default is unset, default or opusplan, every value rides env.CLAUDE_CODE_EFFORT_LEVEL in settings.json, the one effort carrier a running Claude Code re-reads live, so a set effort Claude Code takes covers every model that takes an effort and outranks /effort in the session. An unset effort writes the env key empty, so /effort, the per-model levels and Claude Code's default apply, and a live session moved to another account takes that account's CLAUDE_CODE_EFFORT_LEVEL value within seconds and its per-model levels at its next start. A CLAUDE_CODE_EFFORT_LEVEL exported in your shell is dropped at clauth start and delegate spawns, so it reaches neither. Every switch and launch rewrites CLAUDE_CODE_EFFORT_LEVEL in the settings file it writes, so a value you set there by hand is replaced by the account's effort, or by the empty value when it has none — set the account's effort, or its [env] key, instead. A CLAUDE_CODE_EFFORT_LEVEL in an account's own [env] outranks its effort.
Claude Code keeps a level per model in settings.json under modelSettings.<model>.effortLevel, which its /effort command writes, so each model keeps its own level across /model and claude --model. An account sets its own per-model levels in [model_effort], keyed by a tier (fable, opus, sonnet, haiku) or a model id:
[model_effort]
sonnet = "xhigh"
"claude-opus-4-5-20251101" = "medium"While default names one model (anything but unset, default and opusplan), effort is that model's level instead of an account-wide one, unless [model_effort] already holds one for it. The Setup tab's effort row then shows the effort clauth sets for that model: the CLAUDE_CODE_EFFORT_LEVEL value while Claude Code takes it (an effort that is no per-model level, such as max, med or a token budget, or the [env] key's value), auto for auto or unset, else that model's [model_effort] entry (Keys below says which; one Claude Code would drop shows in red), else its effort level, and blank when none of these applies. Claude Code may still run the model at another level than the row shows: a maxEffortLevel or organization cap lowers it, a maxEffortLevel below max turns a token budget into high, a model Claude Code lists without max or xhigh runs high instead, and a model Claude Code treats as taking no effort runs without one. An edit writes that model's entry (the model row's own spelling when it has none) and clears effort. A clear removes the entry and effort, but while the row shows a CLAUDE_CODE_EFFORT_LEVEL value, auto included, it removes only effort: the entry an account-wide effort overrode applies again, while a value from [env] stays until you remove it there, so the row keeps showing it and an entry you edit applies only once it goes. With default = "opus" and [model_effort] sonnet = "xhigh", claude runs opus at effort and claude --model sonnet runs sonnet at xhigh.
-
Values. Claude Code keeps only
low,medium,highandxhighper model and drops any other value without a warning, so clauth skips an entry outside those four and logs it once. Amaxor customefforthas no per-model form: it stays onCLAUDE_CODE_EFFORT_LEVEL, whateverdefaultis, where Precedence decides what it covers. -
Keys. A tier with a
[models]row uses that row's model id. Other tiers use the alias, and explicit model ids are written as entered. Claude Code resolves aliases and canonicalizes ids when it loads settings. When multiple valid table keys resolve to the same configured key, the spelling in themodelrow wins, followed by alphabetical order. Of two keys naming one model, Claude Code takes the exact canonical name (claude-opus-4-5) first, else the first inmodelSettings; clauth adds its keys in alphabetical order and leaves a key yoursettings.jsonalready holds where it is. A bare tier alias also covers existingclaude-<tier>-*keys so Claude Code's exact keys pick up the configured level. A level keyed by a model id also covers a key yoursettings.jsonalready holds for that model under another spelling. A selected tier with no[models]row runs whatever model the alias names in that session, so the Setup row and a moved session never take an entry keyed by an id of that tier for it. Use explicit model ids to give two versions different levels. -
Precedence. A
CLAUDE_CODE_EFFORT_LEVELvalue Claude Code takes (an account-wideeffort, or the[env]key) overrides every per-model level,autoandunsetrun the model default over them, and a value Claude Code ignores leaves them in force. clauth logs once when a non-empty value sits beside per-model levels. Above the user settings layer clauth writes, project, local and flag settings can still set an effort, and Claude Code'smaxEffortLevelcaps, top-level and per model, clamp the result. -
Switch. A switch writes the levels into
~/.claude/settings.json. Before covering a level you set yourself, clauth saves it in~/.clauth/base-env.json. A switch to an account that does not pin that model, or a switch-off, puts it back, or removes the key when you had none, unless you changed or deleted it meanwhile. A record that does not parse refuses the switch rather than guess, and pauses the settings sync. -
Sessions. A shared
clauth startsession builds its settings from~/.claude/settings.json. It restores levels covered by the active account before applying its own. Settings sync keeps pinnedeffortLevelvalues per account and shares other keys, includingautoCompactWindowandmaxEffortLevel. -
Swaps. Claude Code loads its per-model table at startup, including the levels it uses after
/model. A swap writes the incoming table for the next start and hands the running session, throughCLAUDE_CODE_EFFORT_LEVEL, the effort the incoming account's Setup row shows for its selected model (for an entry shown in red, the level that applies in its place; an empty value when nothing applies), or its account-wide effort whendefaultnames no one model. The live override persists across/modeluntil restart or another swap. An active-account edit updates the live carrier in~/.claude/settings.jsonand that account’s managed sessions. A plainclaudeuses the home settings file and shares its carrier with other sessions using that file. The swap restores levels the outgoing account alone pinned, preserving any level you changed in the session.
An account can carry a [model_picker] table that becomes Claude Code's modelPicker setting, the list the /model picker offers. With replace_built_in = true the picker shows only the Default row and these entries; false or unset adds them after the built-in lineup. Each [[model_picker.options]] row is one entry, with a model id, a label, a description and a behaves_as (the built-in model the entry acts like). This example is the one silkcompute.com documents for Claude Code (https://silkcompute.com/docs/claude-code):
[model_picker]
replace_built_in = true
[[model_picker.options]]
model = "kimi-k3.1-pro-uncensored"
label = "Kimi K3.1 Pro"
[[model_picker.options]]
model = "deepseek-v4.1-flash-1017-uncensored"
label = "DeepSeek V4.1 Flash 1017"
[[model_picker.options]]
model = "deepseek-v4.1-flash-1017-fast-uncensored"
label = "DeepSeek V4.1 Flash 1017 Fast"
[[model_picker.options]]
model = "glm-5.3-uncensored"
label = "GLM-5.3"
[[model_picker.options]]
model = "glm-5.3-flash-uncensored"
label = "GLM-5.3 Flash"
[[model_picker.options]]
model = "hy4-uncensored"
label = "Hy4"The fields map to Claude Code's modelPicker like this:
config.toml |
Claude Code modelPicker
|
|---|---|
replace_built_in |
replaceBuiltInOptions |
model |
options[].model |
label |
options[].label |
description |
options[].description |
behaves_as |
options[].behavesAs |
The camelCase spellings (replaceBuiltInOptions, behavesAs) are accepted as aliases. Write each field in one spelling only: a table holding both replace_built_in and replaceBuiltInOptions, or a row holding both behaves_as and behavesAs, does not load, and clauth refuses to write that config.toml, naming the field written twice. Blank rows are dropped, and a table with no live row counts as unset, so a [model_picker] needs at least one row with a model to be written. A malformed [model_picker] (a wrong type, or options that is not an array of tables) stops that account's config.toml from loading, as any broken key does.
A switch onto an account with no picker removes only the modelPicker clauth wrote into ~/.claude/settings.json: one you set by hand, or edited after clauth wrote it, stays. An account with a picker writes its own over whatever the file held. It keeps a picker you set by hand that it replaces, and a later switch onto an account with no picker, or a switch-off, puts that one back unless you changed or deleted the picker meanwhile. The first switch after updating from a clauth that kept no record of its pickers, and the first one after an older clauth switched accounts, treat a picker equal to some account's own [model_picker] as clauth's: it is removed, never put back. A clauth start session's copy of settings.json is clauth's own, so an account with no picker starts with none in it. Claude Code honors modelPicker only from managed settings, --settings or the SDK, and user settings, and the highest-precedence of those that defines it wins outright, with no merging.
A save never edits the table; creating an account over a leftover config.toml replaces the leftover's table with the new account's, or removes it when the new account has none. Only a newly created config.toml carries the commented example. A clauth start session moved by auto-switch keeps the picker its runtime copy was started with, since the swap rewrites only the effort key. Whether a running Claude Code picks up a changed modelPicker is not confirmed, so restart the session to be sure. A switch-off leaves the last account's modelPicker in place, as it does model and advisorModel, unless it replaced one you set by hand, which comes back.
A preset is a named base_url + [models] pair you can stamp onto any account from the Setup tab's a menu. Five ship built in:
| Preset | Endpoint |
|---|---|
DeepSeek |
https://api.deepseek.com/anthropic |
Z.ai |
https://api.z.ai/api/anthropic |
OpenRouter |
https://openrouter.ai/api |
MiniMax |
https://api.minimax.io/anthropic |
Qwen |
https://token-plan.maas.qwencloudapi.com/apps/anthropic |
DeepSeek, Z.ai, MiniMax and Qwen bind the provider's strongest current model to opus and fable and its fast one to sonnet and haiku, and set default to opus, so the main model follows the opus row:
| Preset |
opus, fable
|
sonnet, haiku
|
|---|---|---|
DeepSeek |
deepseek-v4-pro[1m] |
deepseek-flash[1m] |
Z.ai |
glm-5.3[1m] |
glm-5.3-flash[1m] |
MiniMax |
MiniMax-M3[1m] |
MiniMax-M3.1-Flash-Preview[1m] |
Qwen |
qwen3.8-max[1m] |
qwen3.8-flash[1m] |
MiniMax sells its fast model on the M Plan only, so on a pay-as-you-go key re-point sonnet and haiku. OpenRouter serves the real Claude models, so each row takes its own family's moving alias: ~anthropic/claude-opus-latest[1m], ~anthropic/claude-sonnet-latest[1m], ~anthropic/claude-haiku-latest and ~anthropic/claude-fable-latest[1m], with default on opus too. The [1m] suffix tells Claude Code the model takes a 1M-token context. The Qwen preset binds every tier because that endpoint rejects a Claude model id outright rather than serving something for it; its subagent row stays unset, and an unset subagent row inherits the main model. All five leave the api key alone. Once a preset is stamped on, open provider console in the same menu opens that endpoint's own key page (above).
save as preset stores the focused account's own endpoint and models under a name you type, in ~/.clauth/presets/<name>.json:
{ "base_url": "https://api.example/anthropic", "models": { "default": "my-model" } }apply preset opens the picker, built-ins first. Applying writes every field the preset sets and keeps every field it leaves unset. Before replacing a value, the picker names the fields it would change. When the account holds a value the preset leaves unset, the same confirm lists those fields and offers keep them (the default) or clear them. The + new form works the same way, with what you typed standing in for the account's values. The account's own api key is never touched, and a preset never carries one. d in the picker deletes a saved preset; the built-ins have no file and stay.
A saved preset whose name matches a built-in (qwen saved before the Qwen built-in shipped, say) still lists among the saved presets, without the built-in mark, and applies and deletes as your own.
clauth offers to move your accounts onto each built-in's current models. An account whose endpoint matches a built-in's is offered that built-in's value on every model row that is empty or still holds an id the built-in shipped in an earlier release; any other id stays. A row the built-in leaves unset (subagent and advisor, on every built-in) stays empty, and is cleared if it holds an earlier release's id. The first TUI launch with something to offer opens one confirm, the first launch after installing or updating included: accounts with the same changes share a block, each with its own checkbox, all checked. space checks or unchecks one and apply writes the checked accounts. not now (or esc), and an apply that writes every checked account, keep it closed until a release changes the built-in presets; a failed write brings it back on the next launch. From the shell, clauth presets rebind prints the same moves at any time, not now or not, and clauth presets rebind --yes applies them; naming accounts limits either to them. An account that fails is named on stderr while the rest still move; rows it saved before failing count as moved, and the command exits 1.
The 5h window opens on a real inference call. clauth's own token refresh does not trip it, so an account can read 0% while the clock has yet to start.
auto_start = true # per profile; older spelling kick_timer still readsclauth then sends a 1-token Haiku ping on launch and on each refresh tick while no window is running. On a cold start it fetches usage before the first ping, so it never fires over a window that might already be live. That costs a fraction of a cent and it is a real billed /v1/messages call under your own token. Default off, OAuth accounts only. An account whose plan has no 5h limit is never pinged by auto-start: its own /usage body says there is no window to open, so auto-start does nothing for it.
If the messages limiter is blocking Claude Code, a live 5h window will not clear it. clauth re-tests with the same ping on the poll cadence and can rotate the chain around an account whose ping keeps getting rejected. The weekly (7d) window gets the same treatment at its own boundary: when an account's week was fully spent and its 7d window resets with the 5h window still live, clauth pings once to prove the account serves again, so the chain can return to it without waiting for a failed request.
With several accounts on auto_start, every window reopens the instant it lapses — so they stay in whatever phase they started in and all reset together, leaving you with everything at once and then nothing for five hours. auto_start_queue (off by default, Config tab auto-start queue) spaces them instead: a member may open a window only when no other member opened one in the last 5h / N, so a freshly reset account comes within reach every 5h / N — 2h30m with two accounts, 1h40m with three.
The spacing is self-organising. Accounts that all lapse together are spread across the first cycle and stay spread, because every window is exactly five hours. Nothing needs configuring beyond turning auto_start on per account; N counts the accounts that can actually open a window, so a quarantined, kick-rejected or credential-less one does not hold a slot open.
What it promises is spacing of at least 5h / N, converging on that figure — not a reset on a fixed clock. After a lapse a member can wait up to (N-1) x 5h / N for its turn, and an account you actually use opens its window on demand regardless. With one account on auto_start nothing changes at all: the gap is the whole window, so that account still opens one the moment its last lapses.
clauth keeps no file for the queue: it derives the last open from usage_history.jsonl, where a window it opened is recorded the moment the kick lands and one opened out of band shows up as a reset boundary the samples agree on. A single usage-cache snapshot cannot stand in. /usage reports an idle window's reset five hours out, identical to a window that just opened, and anchoring on that would wedge the queue shut. A restart can read a stretch of idle samples as a boundary; the queue then opens one window late and re-spaces itself on the next cycle.
| Key | Type | Default | Controls |
|---|---|---|---|
active_profile |
string | none | the account currently linked into ~/.claude
|
profiles |
list | [] |
display order |
fallback_chain |
list | [] |
ordered chain members (Auto-switch) |
refresh_interval_ms |
int | 90000 |
usage poll cadence, 10 s to 1 h |
context_nudge_threshold_tokens |
int | none | context-window nudge threshold in tokens, 50k to 2M |
refresh_spent_accounts |
bool | true |
keep polling accounts at 100% |
auto_start_queue |
bool | false |
interleave the auto_start ping so windows open 5h / N apart (a plan with no 5h limit takes no turn) |
preemptive_rotation |
bool | true |
rotate OAuth ahead of expiry; false waits for a rejection |
preserve_non_login_keys |
bool | true |
keep what Claude Code stores beside each account's login (a /design-login) with that account across switches and relinks, and carry MCP-server logins into a setup token's sidecar too (Security); false is the behavior before the key existed. An unreadable profiles.toml counts as true
|
sync_mcp_logins |
bool | true |
keep MCP-server logins the same on every account that keeps a Claude login or MCP logins in its credential store: the daemon reads every account's credential store, every running session's .credentials.json and ~/.claude/.credentials.json and, on macOS, every live clauth start session's per-session Keychain item, and, per server, brings each such store's copy of a login up to that login's latest copy, fills a store holding none with the copy that expires latest, keeps an account's own separately made login, and removes a login you signed out of from every store, in every such store no running session reads through its link (a Claude Code background job's included; on a host without symlinks, no store a running session's copy mirrors; no store whose session's own file waits for the watchdog to copy it back), at most every 15 seconds; an api-key or third-party account with no such store gets none, and while Claude Code's job list or clauth's live-session list cannot be read no store is written. A running session gets a new login at its next switch, since a .credentials.json Claude Code has replaced with its own file and a Keychain item are read but never written; an account whose store a running session still reads through clauth's link gets it when that session ends or switches off it. On macOS a swap's hand-off also copies the session's MCP logins into every such account's store, in the background; with no daemon running they reach the other stores at the next hand-off or daemon pass. A signed-out copy is never copied over a working one (Security). It also shares your own codex's MCP-server OAuth logins with every shared clauth start codex session: while the home your own codex reads holds a .credentials.json when a session starts, the session's home holds a hard link to it (a host without symlinks gets none), decided at the session's start, so flipping the toggle reaches a running session only at its next start. The hard links need ~/.clauth and that home on one filesystem; otherwise the session runs without those logins, a first login made in it is not carried back at exit, and clauth logs one line. A first login made inside a session reaches your codex home when the session exits, if that home holds no .credentials.json by then; one that gained a different file meanwhile keeps it, and on Linux and macOS clauth logs clauth: kept <path>, this session's copy differs. A session that crashes loses a first login made in it: the stale-session cleanup removes its home without carrying it. Removing a server's login inside a session stays in that session when it is the last login there, and the login comes back in the next one; with two or more logins the removal reaches your codex home and every session. false leaves each account with its own copies, and codex sessions without your codex's MCP-server logins. The Config tab's sync MCP logins row flips it; an unreadable profiles.toml counts as true
|
weekly_switch_threshold |
float | 98.0 |
chain-wide 7d exhaustion line (a monthly-only account's 30d quota gates on it instead), 50-100; the codex chain has its own copy of this key in codex-profiles.toml (below) |
burn_aware_switching |
bool | false |
also switch early when recent burn projects usage to 100% within the look-ahead (burn_horizon_cap_ms, never past the next usage reading) |
burn_switch_floor_pct |
float | 98.0 |
lowest usage the burn projection may switch at, 90-100; no effect at or above an account's threshold |
burn_horizon_cap_ms |
int | 60000 |
how far ahead burn-aware projects, never past the next usage reading |
walk_order |
string | chain |
order each accept pass by chain position, the soonest-resetting 7d window or the least-used 7d window (a monthly-only account: its 30d quota): chain, soonest-weekly-reset or most-weekly-headroom; soonest-weekly-reset counts a plan_ends day of today or later as a reset at the start of that day (Auto-switch) |
bell_command |
string | none | the program the daemon runs once each time an account's 5h usage reaches its bell_threshold (below), with %s standing for the alert's text (alert: work at 95%). Split by shell quoting rules and run without a shell: notify-send 'clauth' %s, or sh -c 'logger "$1"' sh %s when you want a shell (the text stays one argument). A Windows path goes in single quotes ('C:\tools\notify.exe' %s). An unbalanced quote, a trailing backslash or an empty value is logged and runs nothing. Hand-edited only; unset means no headless alert |
wrap_off |
bool | false |
switch off all accounts once the chain is out of quota |
spend_budget_switching |
bool | false |
master switch for pay-as-you-go fallback |
switch_off_when_budget_spent |
bool | true |
switch off once the spend ceiling is used up |
default_divergence |
string | none | auto-resolve a credential mismatch: Overwrite, NewProfile, Discard. On an account running on a long-lived token, Overwrite is skipped: the launch shows the resolver banner instead of acting, the resolver does not list Overwrite, and a headless Overwrite switch (the plugin, the API) refuses. Overwrite never saves into a proxy account: the launch shows the resolver banner instead, picking overwrite in the resolver is refused, and a headless switch away goes ahead and drops the live login |
[theme] name |
string | auto | the TUI color depth: "full" (24-bit) or "compatible" (nearest xterm-256, with every surface fill left unpainted so the terminal's own background shows). a theme pick writes the [theme] table; an older scalar theme = "full" still reads |
reset_display |
string | relative |
relative, clock, both
|
clock_format |
string | 24h |
24h or 12h
|
home_tab |
string | overview |
the tab every launch opens on: overview, usage, tokens, setup, fallback, config, status, or services; a saved plugin loads as services. edited from the Config tab's home tab row. the first herdr launch lands on services with the herdr row open instead |
reduce_motion |
bool | false |
keep the header mascot and the Overview's provider shimmer still; spinners and saving marks keep moving. edited from the Config tab's reduce motion row |
show_estimates |
bool | true |
burn estimates on the Usage tab |
show_pace |
bool | false |
ideal-pace marker on usage bars |
count_cache |
bool | false |
count cache tokens in the Tokens totals |
auth_broken |
list | [] |
accounts quarantined after a permanent OAuth rejection; clauth writes this |
[herdr] |
table | {} |
the herdr-plugin knobs the Services tab edits, plus the first-launch marker (herdr plugin) |
[herdr] popup_width |
string | fit |
fit (focused-pane width, 540-column cap), half (herdr's default), split-right, or split-top (a real pane right of or above the focused one); a saved full loads as fit
|
[herdr] pane_tag |
bool | true |
publish the clauth=$profile pane-metadata tag; off clears it on every pane |
[herdr] tag_watch_secs |
int | 5 |
seconds between the per-pane tag watcher's re-publishes |
[herdr] border_label |
bool | false |
publish --display-agent "$profile" so split-pane borders name the account; off clears the stale label |
[herdr] delegate_dot |
bool | true |
report clauth_delegate=working|idle pane metadata during delegate runs |
[herdr] delegate_row_text |
bool | false |
append $clauth_delegate to the sidebar row install writes |
[herdr] restore_notice |
bool | true |
after a herdr restore of a bare pane that lost launch options, refuse its first prompt once with a notice naming them (Claude Code plugin); off stops new notices arming |
[herdr] first_landing_done |
bool | false |
set to true once the first herdr launch lands; later launches open home_tab
|
[plugin] |
table | {} |
the Claude Code plugin knob the Services tab's plugin card edits (Claude Code plugin) |
[plugin] idle_wake |
bool | true |
the one wake a session idle 55 min gets while a delegate of its own still runs on a 1 h prompt cache, so the cache stays warm; off stops it, and the delegate's result and lost-job wakes still arrive; clauth writes the table only while this is off, and removes it when you turn it back on |
[serve] |
table | {} |
the daemon-wide session-creation switch, the browser origin list and the two halves of the pairing link (REST API) |
[serve] session_creation |
bool | false |
whether POST /api/v1/sessions is served at all, herdr panes and background sessions alike; each calling device also needs its own sessions grant (clauth devices allow-sessions <name>) |
[serve] app_origins |
list | [] |
the origins whose pages may read the REST API (REST API); set by hand, read fresh per request; empty sends no CORS header and checks no Origin, a terminal ticket aside (its mint needs an Origin, and its upgrade must carry the same one). An entry is exact, the form a browser sends: scheme://host[:port], https, or http on localhost, 127.0.0.1 or [::1] alone, with a lowercase host and no port that is the scheme's default. Anything else is skipped with one daemon.log line, never widened or rewritten: a wildcard, a path or trailing slash, a query, a fragment, userinfo, whitespace, plain http on any other host, or a value that is not a string in a list; the rest of profiles.toml still loads. While profiles.toml does not read or is missing, the daemon keeps in memory the last list a request read; with none read since it started, the list is empty. An entry grants every token paired under it: a script on that origin holds that token's whole tier, so list only origins you run. While the list is non-empty, a paired request carrying an Origin it lacks is refused, so a same-origin deployment lists its own origin too. A loopback entry such as http://localhost:5173 is dev-only, since any process on that port of the browser's machine is that origin. Before giving up a domain, delete its entry and revoke its devices (clauth devices revoke <name>): deleting the entry alone revokes nothing, and browser storage follows the origin, so the domain's next owner can use every token stored there |
[serve] app_url |
string | none | the app page that the pairing link clauth devices pair prints opens (REST API), as app_url = "https://app.example.net"; set by hand, read by each pair. An absolute https URL, a path allowed, no fragment (the link's own fragment carries the address and the code), its scheme://host[:port] part in the app_origins entry form. List that origin in app_origins too: the app calls the API from it, an origin missing from the list gets no answer its page can read, and pair prints the link either way. Unset, the one app_origins entry that counts is the page when it is https; with several entries that count, none, or a lone plain-http one, pair prints no link and, on a terminal or under --json, a line naming this key. A value of the wrong form prints no link either, with that line saying why; with no daemon running there is no link and no such line |
[serve] public_address |
string | none | the host:port the pairing link names for the daemon, as public_address = "clauth.example.net:443", for a reverse proxy or a name other than the one the daemon publishes; set by hand, read by each pair. No scheme, a lowercase host (a bracketed IPv6 address too), a port from 1 to 65535. Unset, the link carries the listen address a --listen daemon publishes in status.json (Daemon). A value of the wrong form prints no link, and once the app's page resolves, a line on a terminal or under --json says why; with no daemon running there is no link whatever this holds |
[update] |
table | {} |
the auto-updater toggle (Config tab) |
[update] auto_update |
bool | true |
the hourly background update check of the running daemon and every TUI (each reads this before every check; one that found it off when its first check was due checks nothing until it restarts) and the daemon's and each clauth mcp startup's remote herdr-plugin reinstall; clauth writes the table only while this is off, and when you turn it back on removes the auto_update line, and the table once it holds nothing else; CLAUTH_NO_UPDATE=1 disables both even when this is on |
clauth edits profiles.toml, codex-profiles.toml and proxies.toml in place, as it does config.toml: a save changes only the keys whose setting moved, so comments, blank lines, key order, list layout and any key clauth does not model stay as written — including a key nested inside a table it does model, and a key a newer clauth wrote. proxies.toml is the exception for unknown keys: a row holding one reads misconfigured, and every write to the file refuses, naming the row and the key. Nothing is moved under a marker: a # keys preserved from the previous file line in an existing file is an ordinary comment. A save that changes nothing leaves the file untouched, and a file that is not TOML, or that holds a key clauth cannot read ([serve] app_origins aside: it skips what it cannot use, above), is refused rather than overwritten: it fails to load, naming the line and column when there is one, and a save over it writes nothing.
The codex roster, kept apart from profiles.toml so a codex switch never rewrites the Claude Code file and a clauth older than codex support never opens this one; clauth 0.16.0 to 0.18.0 opens it but drops [ids] on its next save, and a codex browser re-login in flight across that save is refused. clauth edits it in place, so its comments, key order and any key clauth does not model survive its saves. clauth login <name> --codex or Setup's + new creates it; the threshold and wrap_off keys are hand-edited only (Setup lists the roster and creates and deletes its profiles; it has no editor for the chain keys), while active_profile moves with clauth <name> and the codex auto-switch, and profiles and fallback_chain with each codex login and delete (Codex).
| Key | Type | Default | Controls |
|---|---|---|---|
active_profile |
string | none | the codex profile the codex chain anchors on and the Overview marks; clauth <name> on a codex name moves it |
profiles |
list | [] |
the codex profiles, in display order |
fallback_chain |
list | [] |
the codex chain, in walk order (Auto-switch) |
wrap_off |
bool | false |
clear the active slot once every codex member is spent, instead of staying on the last one |
weekly_switch_threshold |
float | 98.0 |
the codex chain's 7d exhaustion line, 50-100; a value outside the band reads as the default and is written back as 98.0 on the next save that changes the file, and a key the file never carried is not invented into it |
[ids] |
table | {} |
written by clauth, one per profile; leave it as written |
A codex profile's own config.toml carries harness = "codex" and one optional key of its own, hooks_json (below); the Claude Code keys in the next table do not apply to it.
clauth edits config.toml in place: a save changes only the keys whose setting moved and a load only the values it normalizes, so comments, blank lines, key order and any key clauth does not model stay as written. A save leaves the file as it is and fails when the file is not TOML (naming the line and column), when it holds a key clauth cannot read, or when the key it would change is written in a shape clauth does not edit (an inline, dotted or implicit table, a multi-line string or array); fix or remove that line, then try again. clauth writes a fresh commented file only where none exists. A load normalizes tuning keys only: check_weekly = true (the default spelled out) drops, fallback_threshold = 120 is written 100.0, and weekly_threshold = 0.98 is commented out in place; base_url, api_key and [console] are left as typed.
| Key | Type | Default | Controls |
|---|---|---|---|
id |
string | none | written by clauth; a login started for this account lands only while this name still holds the same id, so a rename away, a delete, or a recreate under a fresh id during the login refuses it (profile '<name>' no longer exists). leave it as written, and drop it from a copied profile directory |
base_url |
string | none | API endpoint; unset means an OAuth account, and one set on an account holding an OAuth login with no api_key and no ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY in [env] is kept but unused: setting either makes it live, and so does logging out |
api_key |
string | none | key for that endpoint |
[proxy] |
table | none | written by clauth login --proxy: service and account name the account this profile holds on a proxy. A table clauth cannot read still counts as one: logins and deletes refuse, naming the fix |
auto_start |
bool | false |
the 1-token window-opening ping (alias kick_timer); a plan with no 5h limit gets none |
usage_probe |
bool | false |
read a setup-token account with no OAuth pair through a 1-token Haiku request; may start its 5h window (a plan with no 5h limit has none to start) |
usage_probe_interval_ms |
integer | 90000 |
how often the usage probe runs, 60000 to 450000, a value outside clamped into it; the Setup tab's probe every row steps it by 30s |
disabled |
bool | false |
hide from auto-switch, polling, the status feed, the Overview's account table (Setup and the Usage tab still list it) and the plugin's startup roster, where the active account stays listed in both (with disabled: true in the status feed) and a shared clauth start session's own account stays on its roster (the roster marks either one disabled); the TUI's divergence resolver will not save the live login into it |
fallback_threshold |
float | 95.0 |
5h utilization % that switches away from this account |
weekly_threshold |
float | chain value | per-account override of the 7d line (a monthly-only account's 30d quota gates on it instead), 50-100 |
check_weekly |
bool | true |
count the aggregate weekly window against this account |
check_scoped |
bool | true |
count per-model weekly windows against this account |
check_credit_cap |
bool | true |
keep auto-switch off this account while its usage-credit cap is spent, and sort it after the others on its line in the plugin's profiles roster; never a refusal (a delegate or start --auto launch whose model clauth cannot tell is refused whatever this says); an account that serves its own endpoint with its own key never spends those credits, so no gate applies to it |
last_resort |
bool | false |
the chain's parking spot |
preferred |
bool | false |
the home account clauth returns to once it is clear |
preferred_days |
string array | [] |
weekdays this account is home, in local time; claims those days against every account, while preferred keeps the days no list claims |
plan_ends |
date | none | the day this account's canceled plan ends, YYYY-MM-DD in local time, quoted ("2026-11-20") or bare (2026-11-20), copied from claude.ai's billing page (Your subscription will be canceled on …). No endpoint clauth reads names it. Wins over plan_renews until it passes; after that, a later plan_renews wins. The Usage tab's plan row, clauth list, status.json and the plugin's roster show it, and under walk_order = "soonest-weekly-reset" a day of today or later counts as a reset at the start of that day (Auto-switch). A date clauth cannot read (a time, a date-time, or a quoted date with a year short of four digits) is commented out on the next load; a value that is neither text nor a TOML date, and a bare date whose year is short of four digits (not valid TOML), fails the account's load |
plan_renews |
date | none | the next day this account's plan bills, written like plan_ends, copied from claude.ai's billing page; once it passes, clauth carries it forward to the same day of each following month (a 31st bills on a shorter month's last day). No endpoint clauth reads names it, and none shows while the account's /profile reading says its plan is canceled or refused. Shown like plan_ends
|
max_auto_spend |
float | 0.0 |
dollar ceiling on pay-as-you-go fallback |
bell_threshold |
float | none | 5h % at which the TUI shows an alert toast and the daemon runs bell_command: once per crossing, again only after usage falls back below or the account is deleted and re-created. The Setup tab's alert at row edits it |
rolling_token |
bool | false |
daemon re-stamps the sidecar from the usage chain; set by clauth rolling-token, cleared by clauth static-token (bare or --clear) |
[env] |
table | {} |
extra environment variables merged into settings.json while active; when one replaces a value your own settings.json held, clauth saves that value, and a switch to an account without the key puts it back unless you changed or deleted it meanwhile (never for a key clauth sets from an endpoint, model or effort field; a value an older clauth replaced before an update was never saved, so that key is removed instead, and while an older clauth still runs and switches, a value you deleted can come back); on a proxy account holding an api key, its ANTHROPIC_API_KEY and ANTHROPIC_AUTH_TOKEN stay in config.toml and reach no session, so the account counts as one without those two keys; its sessions get its own key through apiKeyHelper
|
effort |
string | none | the account's reasoning effort: low, medium, high, xhigh, max or a custom value; rides CLAUDE_CODE_EFFORT_LEVEL in settings.json, except that while [models] default names one model a low to xhigh value is that model's level (above). The Setup tab's effort row edits it, unless [models] default names one model: the row then edits that model's [model_effort] entry, and an edit or a clear there removes effort
|
[model_effort] |
table | {} |
per-model reasoning effort, keyed by a tier or a model id: low, medium, high or xhigh, written as modelSettings.<model>.effortLevel (above). The Setup tab's effort row edits the selected model's entry |
[models] |
table | {} |
default, opus, sonnet, haiku, fable, subagent, advisor
|
[model_picker] |
table | {} |
replace_built_in, [[model_picker.options]] (model, label, description, behaves_as) |
[console] |
table | {} |
Alibaba Model Studio usage session: token, site (international / domestic), region (ap-southeast-1 / cn-beijing). clauth login writes it (above) |
hooks_json |
bool | false |
codex profiles only: link your ~/.codex/hooks.json into that profile's shared session homes and keep the hooks declared inline under [hooks] in the copied config.toml and *.config.toml layers, carrying your codex's trust for both onto each session home, so those hooks run inside clauth start sessions too. Off, or in an --isolated session, hooks.json is left out and the inline hooks are stripped from every copy, [hooks.state] kept (Codex). A change takes effect at the next session start, also on a host that cannot symlink |
last_resort and preferred are radio toggles across the chain: marking one clears it everywhere else, and no account can be both.
preferred_days has a preferred days row on the member's Fallback card, listing the presets never weekdays weekends every day with the current one lit: space steps through them and back to never, saving each step, and ⏎ opens a day picker for any other set (Interface and keys). A list matching no preset shows its days after the presets and stays one more stop after every day while the card is open, so stepping past it and back brings it back. The card's preferred row names the days once a list is set, and + add names a list an account still carries from before it left the chain. In a hand-written list, full names and three-letter forms parse in any case (["sat", "Sunday"]), and the next load writes it in clauth's spelling (["sat", "sun"]); a list holding an entry that does not parse is commented out as typed, with the entries that do parse written below it. The list is re-read per chain build, so the rollover at midnight needs no restart.
A list only claims from an account the chain walk would actually visit, so one on an account that is off the chain, disabled, auth-broken, carrying a rejected api key or setup token, or logged out claims nothing: a member's preferred days row names the blocker (its api key was rejected or its setup token was rejected for those cases), + add names one that is off the chain, and saving such a list warns (once per day-picker visit, and on each space step that sets days). A lapsed Alibaba console login does not block the claim because its inference key still serves. A list can also go inert later, or arrive by hand-editing the file, so clauth says the same at run time: once a day, naming the account, the reason, and whether another list carried the day or it fell back to preferred.
A named day is claimed against every account. On a day some list names, only the accounts naming it are home; a bare preferred = true elsewhere stands down for that day and takes charge again on the days no list claims. So the usual split is one line in one profile:
# ~/.clauth/profiles/personal/config.toml — work keeps plain `preferred = true`
preferred_days = ["sat", "sun"]Two accounts naming the same day is not rejected: the chain returns to whichever of them reads clear first, so nothing is left with nobody home. clauth still says so once — a toast in the TUI, a line in the log — and says it again at the midnight rollover or after an edit, never once per tick.
clauth's outbound HTTPS trusts the OS trust store — the same roots curl uses — instead of a bundled set. The SSL_CERT_FILE environment variable replaces that store with the certificates in the named file (curl/OpenSSL semantics): exactly those certificates are the roots. SSL_CERT_DIR is not read while the file is set.
A file clauth cannot use — unreadable, not a regular file, too large, or carrying no certificate — logs one warning naming it. On Linux clauth then fails closed with no trust roots (the platform verifier would re-read the same unguarded file), exactly as curl behaves, until the file is fixed or unset; on macOS and Windows the system store answers instead.
Login/refresh, usage and codex usage keep the roots they resolved at their first request, and the update check's release listing, sums and signature requests keep the roots resolved when its update loop started (at its daemon's or TUI's start, or a parked standby's takeover), so a change to the file's contents takes a restart to reach them; the pricing and status feeds, proxy checks, update downloads and gateway probes read it again on each call.
Claude Code deletes every transcript older than cleanupPeriodDays days (30 while the key is unset) from the store its config dir links, and where symlinks work a shared clauth start session links your own ~/.claude/projects/ (elsewhere its runtime tree is a copy of ~/.claude/, as Storage layout describes). clauth therefore remembers the last positive integer it read as cleanupPeriodDays in ~/.claude/settings.json (3650.0 counts as 3650), in ~/.clauth/settings-retention.json, puts it back when it goes missing, and carries it on shared launches. A put-back never overwrites a cleanupPeriodDays already present in ~/.claude/settings.json or a session's copy of it, valid or not; the settings sync still carries a changed number between them, as it does every shared setting. While clauth remembers no number and ~/.claude/settings.json holds no positive integer, nothing is put back and no launch carries a number.
| When | What clauth does |
|---|---|
cleanupPeriodDays goes missing from ~/.claude/settings.json
|
writes the remembered number back into that file and into every live shared session's copy that lacks it, at once, logs clauth: cleanupPeriodDays was gone from ~/.claude/settings.json, put 3650 back; open clauth to keep or remove it (3650 stands for your number), and marks the question open |
| the TUI is open, or opens later | asks in the TRANSCRIPT CLEANUP dialog (Interface and keys); the open question survives restarts until you answer it |
you answer keep 3650, or press esc or q
|
nothing more changes; the question closes and is not asked again for this loss |
you answer remove it
|
forgets the number, removes the key from ~/.claude/settings.json, every live shared session's copy and the spawn files clauth keeps current (a delegate's own number stays in its file), and stops passing it on launches; Claude Code's 30-day default then applies, and remembering starts again once a number appears in the file |
| you change the number to another one | remembers the new number silently, with no dialog; a question still open about the old number closes |
~/.claude/settings.json is missing or does not parse |
leaves it alone and asks nothing; live session copies and the launch flag still carry the remembered number |
you pass your own cleanupPeriodDays in clauth start <name> -- --settings <file or json>
|
yours wins: that session's --settings keeps your value, and clauth never rewrites it |
Each running clauth start session checks whenever it syncs settings, a shared launch checks while it builds its runtime tree, and the daemon checks too (Daemon), so while the daemon runs, a bare claude with no clauth session running is covered too. A put-back that cannot be written logs clauth: failed to put cleanupPeriodDays back into <path>: <error> once per file, opens no question, and the next check tries again.
A shared launch carries the number in two places: its runtime tree's settings.json gets it when it has none, and a clauth start or clauth resume session on a shared tree, background sessions included, or a shared delegate also passes it on the session's spawn --settings file, which outranks a cleanupPeriodDays in a project's own .claude/settings.json (the launches with a number to carry that pass no such file are listed below). The number carried is the positive integer in ~/.claude/settings.json, else the remembered one; a delegate passes the larger of that and a positive integer of its own (Claude Code plugin). clauth lists these spawn files in settings-retention.json, never one whose --settings on clauth start you gave your own cleanupPeriodDays, and rewrites each listed file in place when the number changes, since a background job's respawn reads its launch's file again; remove it takes the key out of each, down to a delegate's own number. An isolated launch (--isolated, or isolated: true on a delegate) links no transcript store and carries nothing.
Where clauth falls short:
- a
settings-retention.jsonthat cannot be read or parsed logsclauth: <error>; clauth forgot the cleanupPeriodDays it remembered, so while ~/.claude/settings.json holds no number it is neither put back nor passed to a launch, and sessions already running keep the number they hold nowonce. The next number clauth reads from~/.claude/settings.jsonrewrites the file without its list of spawn files, so the files of sessions already running are no longer kept current. - a shared launch that cannot take clauth's state lock still passes the number it read, but logs
clauth: <error>; the spawn settings file <path> is not registered, so it is not kept current: a later change orremove itleaves that session's file at the old number. - a
clauth startrun from a working directory it cannot resolve (one deleted under your shell, say), one whose own--settingsclauth cannot use or that ends in a bare--settings, and aclauth startorclauth resumewhose spawn file clauth cannot write pass no spawn--settings: any args you gave reach claude as you typed them. The session's runtime treesettings.jsonstill carries the number, but acleanupPeriodDaysin the project's own.claude/settings.jsonthen outranks it. - while clauth cannot read or write
settings-retention.json, what it remembers can lag behind, and clauth reports the fault once until a write lands again (clauth: failed to write the retention record <path>: <error>; a keep in the TUI toasts it instead): a put-back can restore an older number, a shared launch in that time can stay off the list of spawn files clauth keeps current for its whole session, and a put-back can logopen clauth to keep or remove itwith no question saved for the TUI. A listed spawn file clauth cannot update keeps its old value until a later check updates it, and clauth logsclauth: failed to keep cleanupPeriodDays current in <path>: <error>.
~/.clauth/
profiles.toml # everything in the table above; edited in place, so comments, key order and any key clauth does not model stay
codex-profiles.toml # the codex roster: active marker, chain, wrap_off, weekly line; edited in place, so comments, key order and any key clauth does not model stay
ai_pricelog_v4_price_cache.json # ai-pricelog model prices for the cost lens
status_cache.json # status.claude.com incident feed
status.json # the daemon's published snapshot (see Daemon)
devices.json # devices paired with the REST API: name, tier, sessions grant, a SHA-256 of each token (0600)
pairing.json # the waiting pairing code's SHA-256 while `clauth devices pair` runs (0600)
push-vapid-key.der # the daemon's VAPID signing key (P-256 PKCS#8), minted once on first use (0600)
push-subscriptions.json # one push subscription row per device: endpoint, p256dh, auth, the event set (0600)
tls.json # REST API certificate directory, written on the first `--listen` start
session_profiles.json # which account each Claude Code session ran on
token_ledger.json # the per-day token ledger behind the Tokens tab
stats-base.json # the frozen copy of `~/.claude/stats-cache.json` the Tokens tab reads, written once (0600)
tps_cache.json # the lease holder's live token-speed cache, republished into status.json's `tps` slot (0600)
token_speed.json # the per-day speed ledger behind the token-speed surfaces, written by the producer alone (0600); one that does not parse is renamed token_speed.json.corrupt-<epoch_ms> (0600) before the next save, and one clauth cannot read, or one a newer clauth wrote, is never saved over
tps_attribution.json # which account each session's replies ran on, and the token records clauth proxies reported for them, for the speed history (0600); one that does not parse is renamed tps_attribution.json.corrupt-<epoch_ms> (0600) before the next save, and one clauth cannot read, or one a newer clauth wrote, is never saved over
tps_days.json # the producer's list of speed days not yet in token_speed.json (0600); one that does not parse is renamed tps_days.json.corrupt-<epoch_ms> (0600) before the next save, and one clauth cannot read, or one a newer clauth wrote, is never saved over
chrome/chrome-native-host # a copy of a finished session's Claude in Chrome launcher (0700; `.bat` on Windows); when clauth's cleanup retires a runtime tree, a browser manifest naming that tree's launcher is pointed here
clauth.log, daemon.log # event lines from the TUI and the daemon
clauthd.pid # the running daemon's process id
gateway.toml # the managed shunt gateway: its adopted config, optional binary and env file, the disabled flag (0600)
gateway-admin-token # the gateway's admin write key, alone in its file (0600)
gateway-client-tokens.toml # the gateway's client tokens, one per claude profile, minted by clauth and never shown (0600)
gateway-child.json # the gateway the daemon spawned (pid, start time, stop deadline), so the next daemon can finish its stop
gateway-hold # the TUI's transient gateway stop: the pid + start time of the daemon whose gateway it holds off (0600)
gateway-env.json # the running daemon's CODEX_HOME, HOME, USERPROFILE, SHUNT_SERVER__BIND and SHUNT_SERVER__AUTH__* keys and the client names (never the tokens) its client-tokens variable holds, which the store move, the adopt, the Services card and the client-token checks read; written at its start and again on any gateway round where the config or env file names a tokens variable it does not answer for, or no record names the running daemon (0600)
gateway.log # the gateway's own stdout and stderr, size-capped like daemon.log
shunt/ # the gateway's credential stores: accounts/{claude,codex,kimi,antigravity}/, xai-auth.json, cursor-auth.json, antigravity-auth.json, codex-auth.json, claude-credentials.json
proxies.toml # the proxy registry: one [service] table per registered proxy (0600); edited in place, so comments and row order stay and a new row lands before the first row whose name sorts after it; a row with a key clauth does not know reads `misconfigured` and refuses `enable`/`disable`, naming the row and the key
proxies/<service>/ # one state dir per proxy, its CLAUTH_PROXY_STATE_DIR (0700)
accounts/ # the proxy's own account store
config.json # the proxy's own proxy-wide settings
clauth-admin-token # the proxy's admin token, alone in its file (0600)
clauth-child.json # the proxy the daemon spawned (pid, start time, stop deadline), so the next daemon can finish its stop (0600)
clauth.log # the proxy's own stdout and stderr, size-capped like daemon.log (0600)
completions/ # generated shell completion scripts
.completions_installed # marker: the first-launch completions prompt was answered
conversations/<sid>[.<agent_id>].json # the account a live conversation is on; beside it the await-job watcher's <sid>.watch lease (empty, flock-held while one watcher runs) and the <sid>.lost sidecar (the delegate job ids a wake already reported lost, so each is reported once); the record, its <sid>.watch lease and the <sid>.lost beside that lease go with the conversation, and a <sid>.lost with no lease beside it (a print-mode wait) is deleted on its own once it has outlived the job store's running window (24 h plus 600 s) and none of the job ids it lists still has a job record
daemon-stops-in-flight.json # runtime trees whose supervisor stop is in flight, the supervisors that wedged on SIGTERM (pid and start time) and, on macOS and Windows, the trees already announced as spared; no credential (0600)
.claude-json-sync.lock # the flock serializing every `.claude.json` merge, switch strip, session seed and `wire mcp server` across live clauth processes, so one Claude Code write costs each copy at most one rewrite; empty, 0600
.claude-json-sync-written.json # the `.claude.json` copies clauth wrote: path, mtime, size, a SHA-256 of the bytes and the rank of the Claude Code write they came from; tells clauth's own unchanged copies apart from Claude Code's writes, no config content (0600)
.settings-sync-written.json # the same record for `settings.json` (0600)
settings-retention.json # the last positive integer clauth read as `cleanupPeriodDays` in ~/.claude/settings.json, whether a put-back of it waits for your keep-or-remove answer, and the spawn --settings files shared launches registered, each beside its floor: a delegate's own positive integer where it set one, none otherwise (see Transcript retention); exists once clauth has learned a number or a shared launch has registered its spawn file, and `remove it` deletes it (0600)
backups/<file>.<utc stamp> # a byte copy of `~/.claude.json` or `~/.claude/settings.json`, saved after a sync pass refused to delete more than 3 of its shared top-level keys, or to drop `cleanupPeriodDays` from `settings.json`; that second refusal fires only when the winning session's copy lacks the key: with a number remembered, clauth first writes it into every keyless copy (see Transcript retention), so only while nothing is remembered or when that copy's put-back did not land; the file itself is left alone and each clauth process logs one line naming its copy (several running `clauth start` sessions can each save one), and the newest 10 per file are kept, each 0600 in a 0700 dir
base-env.json # the env values and per-model effort levels your settings.json held before clauth covered them, which model key values clauth wrote there and the values of yours they replaced, and the marker clauth's record holds (0600; a value clauth records writing only as a SHA-256 digest)
mcp-sync-state.json # the MCP login sync's memory: which login each store, live file and Keychain item held per MCP server (a truncated SHA-256 of its token, never the token) and which logins were signed out (0600); one that does not parse is renamed mcp-sync-state.json.corrupt-<epoch_ms> (0600) before the next save, and the sync then only fills gaps
.oauth-strip-pending # a `pid:nanos` stamp saying a switch's `oauthAccount` strip is still owed; the next daemon tick or sync pass strips home `~/.claude.json` under the sync lock and deletes it (0600)
jobs/<id>.json # backgrounded delegate jobs and the delegates a session's exit stopped, GC'd after a day
jobs/<id>.live.json # a blocking delegate's run while its caller is attached, then its done record until the 24 h sweep
jobs/<id>.json.delivered # exactly-once delivery ledger after collection
jobs/<sid>.resumed # left each time a `delegate` resumes a session id, so a stop that resume took is never named again (0600; removed after a day)
jobs/<id>.pending # a delegate whose leftover processes clauth could not list when it stopped the run; each `clauth mcp` start retries the stop and removes it once it can (0600)
keychain-deletes-in-flight.json # macOS namespaced-item deletes in progress
live_bare/<pid> # one marker per live bare `claude` session
live_sessions/<sid>.json # one row per live session clauth launched (start, delegate, background)
mcp_live/<pid> # one marker per live `clauth mcp` server, so its delegate jobs read dead once it exits
presets/<name>.json # endpoint + model presets you saved
rotation-locks/<name>.lock # one OAuth-rotation lock per account
limit-reset-locks/<name>.lock # one lock per account; a second spend attempt waits for the first
keychain-quarantine/ # macOS: raw bytes of a corrupted Keychain item, saved before clauth overwrites or deletes it
keychain-item-owners.json # which per-session Keychain items clauth seeded; the census deletes nothing else
keychain-which-cache/ # macOS: one cached Keychain read per service backing `clauth which`, ~30 s TTL (0600, swept after a day)
profiles/
work/
config.toml # everything in the table above
credentials.json # OAuth snapshot
credentials.json.staged # a refreshed pair waiting to land in credentials.json after a busy or failed save
auth.spent.json # fingerprints of the last 64 refresh tokens clauth traded in, never the tokens
limit_reset_pending_claude.json # a limit-reset spend whose answer was lost; naming its grant again within 10 minutes re-sends it, and no other grant is spent until then (0600)
limit_resets.json # the account's banked usage-limit resets, every grant with its label, windows, end and state, read about once an hour, retried at the usage poll's own backoff when a read is refused or gets no answer (within minutes at the default refresh interval), sooner when a usage window fills or its use falls before its reset, and re-read right after a limit-reset spend that used a reset or found one already used (0600)
mcp-logins.json # MCP-server logins parked while this profile stores no Claude login
note.txt # the account's free-form note, edited from the Usage tab's n key (0600)
session-token.json # long-lived setup-token login, when captured
session-token.static.json # the mint a rolling token superseded, kept for the restore
usage_cache.json # last-known utilization, plan and account email
usage_history.jsonl # 2 days of samples (plan and account email included), feeding burn-aware switching
wallet_history.jsonl # 2 days of balance readings, feeding the wallet-burn rate
third_party_cache.json
third_party_auth.json# set while the account's api key or setup token is rejected, or its usage login expired; a hash, never the credential
account_id.json # which account this is, so a re-login can be told apart
profile_fetched.json # when the plan tier was last read
kick_block.json # messages-limiter block state
credit_refusal.json # the credit-billed request this account last refused, until a request on it succeeds or a window reset leaves it headroom; after either or a login as another account it keeps only an instant, so no older refusal is recorded again
throughput_cache.json# observed delegate tokens/sec per model
touch-receipt.json # what the last credential swap wrote, for the watchdog
adopt_refusal.json # last standing live-credential adoption refusal announced
quarantine/ # credentials parked after a refresh token was rejected
runtime-<sid>/ # one CLAUDE_CONFIG_DIR tree per live session, holding its own Claude Code supervisor state (daemon/, daemon.lock, daemon.status.json, daemon.log, daemon.json, daemon.scheduled.status.json) inside it, never linked from ~/.claude; a --with-fallback session's tree outlives it while a background job names it, held by the daemon until none does
runtime-isolated-<sid>/ # likewise, linking nothing from ~/.claude, so any supervisor state stays inside it
sessions-<sid>/ # that session's PID file, flock-held while it runs
sessions-isolated-<sid>/
runtime-bg/ # the tree a clauth start <p> -- --bg session runs in (a --with-fallback launch keeps its own runtime-<sid>/), daemon-held while a job names it; its own supervisor state lives inside it, and collecting the tree stops that supervisor first
sessions-bg/ # that tree's per-holder PID files, flock-held while a launcher or the daemon holds it
runtime….rescuing/ # a dead session's tree whose transcripts or session files could not all move into ~/.claude yet; each cleanup retries it, and it goes once they have
runtime….rescuing.claim # held by the one cleanup moving that tree's files; stays beside a kept tree and goes with it; empty (0600)
spawn-settings-<sid>.json # that session's --settings (auto-memory dir, Read hook, a delegate's subagent-shell hook, any --settings you passed, and the cleanupPeriodDays a shared launch carries, which clauth rewrites in place in each file settings-retention.json lists when the number changes or is removed; Transcript retention says which number and which launches carry none here); removed at exit; kept while a background session's (clauth start <p> -- --bg) job names it, until claude rm <id>, or while a job store clauth reads (the global one, or the tree's own) cannot be read, or holds a job whose recorded launch flags clauth cannot read and that runs in this session's runtime tree (at clauth's cleanup of a shared session's file, also one in the profile's unsuffixed runtime/ or runtime-bg/); clauth's next stale-session cleanup (when clauth start or resume launches, the TUI opens, or the daemon or the plugin's MCP server starts) removes it after that
spawn-settings-isolated-<sid>.json # likewise: for every isolated delegate unless the --settings it was handed cannot be used, and for an isolated clauth start only when its tree sits under a symlinked path
cx/ # a codex profile (see Codex)
config.toml # harness = "codex", plus hooks_json
auth.json # the ChatGPT token chain; ~/.codex/auth.json links here after a capture
auth.lkg.json # last-known-good copy of auth.json
auth.attempt # no-replay memo: a fingerprint of the refresh token last sent
auth.quarantine.json # the verdict that killed the chain, while its token is still in the store
limit_reset_pending_codex.json # the codex twin: a lost consume, re-sent with the same ids within 10 minutes when its credit is named again (0600)
limit_resets.json # every reset credit the account's last list read named (the daemon's about-hourly codex side read, a clauth limit-reset listing, or a spend's re-read from the CLI or the TUI), re-read after a reset or a no_credit answer; gone when the account logs in as another (0600)
usage_cache.json # last usage reading and plan
codex-home/ # the durable store: sessions/, archived_sessions/, history.jsonl, the sqlite state stores
codex-home-<sid>/ # one live session's CODEX_HOME, removed at exit
codex-home-isolated-<sid>/
sessions-<sid>/ # that session's PID file, flock-held while it runs
sessions-isolated-<sid>/
~/.local/share/clauth/ # macOS ~/Library/Application Support/, Windows %APPDATA%
current@claude # points at the version dir Claude Code registers
versions/<ver>-<hash>@claude/ # the bundled plugin: plugin.json, hooks/, marketplace.json
markers/<hash> # the install record `clauth self-heal` keys on
Seven static lock files sit alongside and are never deleted on purpose: .lock, clauthd.lock, clauthd-standby.lock, usage-fetch.lock, .claude-json-sync.lock, rescue.lock (held while one rescue lands a file from a session's runtime tree into ~/.claude, so two never land on one name at once), conversations/.lock. The tree above lists the stable user-facing stores and the transient paths that are unsafe to remove; other clauth-owned temporary or migration files can appear, so an unlisted path is not by itself proof of leftover state. Every file under ~/.clauth is 0600 (0700 for one its owner may execute) and every directory 0700, re-tightened on each launch; inside a codex home, codex's own files keep the modes codex gives them. The plugin tree is not: it carries no credentials and lands at your umask.
Deleting any *_cache.json or status.json costs you history and nothing else. Deleting third_party_auth.json also drops the dead-login verdict of a rejected api key or a refused setup token, so automatic switches and clauth start --auto can land on that account again until a fetch or a probe learns the verdict anew, which for a setup token with its usage probe off never happens. Deleting credit_refusal.json drops that account's credit refusal, so a credit-billed session can land there again until the account refuses anew. Deleting usage_history.jsonl costs burn-aware switching its samples and the queue its anchor, so the queue re-spaces from scratch over the next cycle. Deleting wallet_history.jsonl costs the wallet-burn rate its series; the rate rebuilds from the next day of fetches. Deleting stats-base.json makes clauth copy ~/.claude/stats-cache.json again at its current date, so days up to that date lose their cache split and hourly detail on the Tokens tab. Deleting credentials.json or session-token.json signs that profile out. A credentials.json that cannot be read or parsed signs out that profile alone. The other accounts still load, each CLI command you run names the unreadable profile once on stderr, and switching to it links nothing. clauth keeps the file until you log in again, log the profile out, or agree to save a newer login Claude Code holds over it; an api re-key (clauth login <name> --base-url <url> --api-key <key>) refuses rather than drop it. Deleting credentials.json.staged before clauth lands it can sign that profile out. Deleting a codex profile's auth.json signs it out too, and your own codex with it when ~/.codex/auth.json links there.
The -<sid> suffix appears on every isolated session, and on a shared one wherever the OS grants symlinks. Where it does not (a home on exFAT, FAT32 or SMB, or Windows without the symlink privilege) clauth builds a shared runtime tree by copying ~/.claude/, so every shared session of one profile lands on a single unsuffixed runtime/ instead of paying for a copy each. An isolated session copies nothing from ~/.claude/, so it keeps its own suffixed tree there too and its transcripts are rescued on its own exit rather than the last one out. A codex session home follows the same rule with both flavors collapsing: codex-home-<sid> and codex-home-isolated-<sid> where symlinks work, the bare codex-home (the store itself) and codex-home-isolated where they do not (Codex). A background session instead lands on the account's one fixed pair, runtime-bg/ + sessions-bg/, on every host that links: clauth start <p> -- --bg (either --bg or --background) runs there, and the daemon holds the tree while any Claude Code job names it — a hold that needs clauth daemon running. --bg with --isolated is refused before anything spawns, and --bg on a host that copies runtime trees (any host above that copies; on Windows, Developer Mode turns linking on) is refused before anything spawns, since a copied tree cannot follow a rotation the background session would outlive.
Where symlinks work, a newly built shared runtime tree links ~/.claude/jobs/, ~/.claude/projects/ and ~/.claude/sessions/. A missing one is created first (owner-only on Linux and macOS), ~/.claude/ too if it is missing, so a background session's job record, its live session record and every transcript land where Claude Code and clauth read them, even on a machine where Claude Code never created them. When ~/.claude/ refuses the new directory (read-only or full), the session still starts and clauth start or clauth resume prints one line to stderr per store it could not create: for jobs/, that session's background jobs stay in its own tree, where claude agents outside it cannot see them; for projects/, its transcripts stay in its own tree until the session has ended and no job still holds that tree, then move into ~/.claude/projects/; while ~/.claude/ still refuses them the tree stays as runtime….rescuing and each cleanup retries it; for sessions/, its background sessions stay in its own tree, where the clauth app cannot reach them. A background session the REST API starts has no terminal for those lines, so they go to daemon.log as clauth api: device '<name>' background launch said: <line>. On a host that copies runtime trees, clauth's tree build and its copy sync both skip jobs/, so a copy-host tree never gets the job store and a background job's record lands in that tree's own jobs/. clauth reads a background job's record, on every host, from the global ~/.claude/jobs/ plus each tree's own real jobs/ (a tree-local record naming a different tree is a stale copy and is skipped).
Start here
Reference
Headless
Help