Skip to content

Quickstart

github-actions[bot] edited this page Nov 18, 2026 · 73 revisions

Quickstart

Capture your first profile

From a shell where Claude Code is logged in:

clauth capture work

or launch the TUI (clauth), open the Setup tab, pick + new (the form opens on type claude, which carries the + capture current login row), press ⏎ on the + capture current login row, name it work, and ⏎ on create account. Either way clauth snapshots the OAuth token and endpoint settings your running session is using. Log into a second account in Claude Code and capture that one too.

To add an account without touching the session you are in, use clauth login instead: it opens a browser, runs Claude Code's own OAuth flow, and writes the minted tokens into a fresh profile.

clauth login personal                                   # browser login
clauth login deepseek --base-url https://api.deepseek.com --api-key sk-...

For a third-party endpoint clauth recognises, open provider console in the TUI action menu opens the page that key is minted on (Configuration).

Switch

In the TUI: move to the account, ⏎, confirm. From the shell:

clauth work
# switched to 'work'

A switch repoints the credentials your global claude reads. A session already running adopts the new account at its next request.

Run two accounts at once

clauth start personal                  # claude under personal's own config dir
clauth start personal -- --model haiku # flags for claude go after --

clauth start gives the session its own CLAUDE_CONFIG_DIR, so identity, settings, and billing caches never mix between accounts, and the global session is untouched.

For a session that keeps the account's auth while dropping your global CLAUDE.md, plugins, and hooks:

clauth start --isolated personal -p < prompt.txt

Pass the prompt on stdin when you use -p. A variadic claude flag would otherwise swallow a trailing positional prompt forwarded through clauth. Run it in an empty directory to skip project memory too.

Check what is loaded

clauth which              # profile that owns the current session's credentials
clauth which --json       # plus plan tier, endpoint and live token speed/rate
clauth which --pid 4242   # account the running process 4242 spends
clauth list               # account table with cached usage, no network

clauth which --pid <pid> answers for another process, such as a terminal pane's foreground job. It climbs the process and up to seven of its ancestors for a clauth start or clauth resume session, passing over a clauth mcp server so a delegate it hosts never names the pane, and prints the account that session runs on now, after any fallback move. With no such session, a bare claude answers the account owning the global credentials, and a bare codex the profile its login is adopted into ($CODEX_HOME/auth.json, default ~/.codex/auth.json, linked onto that profile's store); the adoption is read from the CODEX_HOME of the process asking, not the one asked about. Anything else, and a codex login that is not adopted, prints nothing and exits 0. --json answers {"profile": "work", "source": "live_session", "harness": "claude"}, where source is live_session, codex_adopted or global and every field is null when nothing resolves. It reads /proc on Linux and ps on macOS, and Windows refuses it.

Without --pid, clauth which --json carries tps: speed (float or null) and rate (float) are the profile's live 10 s figures off the token-speed cache, session is the same pair for the current Claude Code session when CLAUDE_CODE_SESSION_ID names one the cache holds (else null), peaks.today is the profile's own today peaks off the cache — speed {value, at, account, model} (the fastest reply) and rate {value, at} (the busiest 10 s), each omitted when absent — and age_secs is the cache's age; tps itself is null with no cache or one older than 30 s (Tokens and cost).

Commands

Command Flags Does
clauth open the TUI (with stdout not a terminal: command help on stderr, exit 2)
clauth <profile> switch to that profile and exit — deprecated, use clauth switch <name>; a codex name moves the codex active marker instead (Codex)
clauth start <profile> [claude args…] --isolated, --with-fallback, --explain run claude under that profile's own config dir; a codex profile runs codex under its own CODEX_HOME instead, and --with-fallback is refused there (Codex)
clauth start --auto [claude args…] --isolated, --with-fallback, --explain start on the fallback-chain member with headroom for the models the session will run, taken in your walk_order
clauth login <profile> --base-url, --api-key, --setup-token, --yes, --model add an account, or re-authenticate one in place; a proxy account re-authenticates only with --proxy
clauth login <profile> --proxy <service> --model add an account on an enabled clauth proxy through the proxy's own login, or log that account in again; clauth keeps the proxy's inference key as the account's api key, never the upstream credential (below)
clauth login <profile> --codex --browser adopt the codex login in your ~/.codex as a codex profile; --browser mints a fresh ChatGPT login in the browser instead and leaves ~/.codex alone (Codex)
clauth capture <profile> --new save the login Claude Code is using now as a new profile; the first one becomes the active account. A login that looks like a saved account's (Claude Code last signed in as it, but its tokens are newer than that account's copy) is refused with the account named: clauth capture <that account> saves the newer login into it, --new keeps it as a new profile
clauth rolling-token <profile> serve the profile's sessions a rolling token re-stamped from its usage chain
clauth static-token <profile> --clear, --yes bare: restore the preserved mint a rolling token superseded; --clear removes the long-lived token entirely
clauth delete <profile> --yes, --force remove a profile and every credential it holds, a codex profile included (Codex); without --force it refuses while a live session runs — a Claude Code background job naming one of the profile's runtime trees (clauth start <p> -- --bg) counts as one, a stopped one too, until claude rm <id> (in an --isolated session, an unfinished one only), and so does a handed-off --with-fallback background session (Auto-Switch) on every account it has run on; it also refuses while a runtime tree still has a background supervisor clauth cannot verify and stop on this host, naming the tree — --force stops every supervisor it can verify and removes the tree anyway; a delete waits up to 15 s for each supervisor it stops; before removing anything it moves what the profile's dead runtime trees alone hold (transcripts, and session files such as plans and todos) into ~/.claude, and without --force it refuses while any of them could not move, naming the first: 'work' has unrescued session files in <path>, pass --force to delete them anyway; --force still moves what it can first; on a proxy account it also deletes the account on the proxy, which signs that account out of its provider, and it refuses with nothing deleted while the proxy does not answer or refuses; the account's token and cost counts stay, its window and balance history goes with the profile
clauth rename <profile> <new-name> rename a profile in place, keeping its credentials, chain slot, env, model settings and notes (the Setup tab's rename); it stops the profile's background supervisors first, waiting up to 15 s for each; refused while a live session holds it, a token rotation runs on it or a supervisor can't be verified and stopped, and for a codex profile; a name starting with - goes after -- (clauth rename -- -x <new-name>); renaming the active profile when its live credentials can't be relinked still renames it and exits 1, so don't retry the rename: the profile already has the new name
clauth disable <profile> --yes hide it from auto-switch, polling, and the status feed; files stay
clauth enable <profile> put a disabled profile back
clauth limit-reset <profile> [<id>] --list, --yes with no id (or --list), list a codex or Claude Code account's banked usage-limit resets as a table, one row per reset under its id, and spend nothing; with an id, spend that reset (Codex). If a spend's outcome stays unknown (no answer, a 5xx, an unreadable reply), naming the same id again within 10 minutes of that spend re-sends that same request, and any other id is refused until then. A proxy account is refused before any request (exit 2): Error: 'px' is an account on proxy "stub": it signs in through its proxy and has no Claude Code login to use a reset with
clauth presets rebind [account…] --yes list the model rows a built-in preset would fill: empty, or still on an id an earlier release shipped; --yes moves them (Configuration)
clauth which --json, --pid print the profile owning the loaded credentials; inside a clauth start codex session, that codex profile; --pid <pid> answers for another running process instead
clauth list --all (--disabled) account table from the on-disk caches, never fetches; codex accounts follow in their own CODEX section, which --all leaves alone
clauth jobs --json what the delegates are doing: account, elapsed, last output, live runs first; --json also carries each run's session_id, the handle delegate({session_id}) takes after a crash, and whether the run was isolated, which is what decides whether that id is a handle at all; a run whose caller waited on it lists as done once it finishes, with "collectable": false in --json, since its result already went back through that call; a run its session's exit stopped lists as stopped, and the monitor listing names its session id only where a resume can use it
clauth switch <name> / clauth switch <sid> <profile> --list, --json (with --list) one name switches the global account (the bare clauth <name> form, deprecated); two names move a live session (its <sid> from clauth switch --list), picked up at its next request — a session on the account's fixed background tree (-- --bg without --with-fallback) or a codex session is refused: it stays on its account (an adopted --with-fallback background session moves; switching a handed-off one no daemon holds yet fails until a daemon holds it)
clauth sessions --json, --tokens, --live list Claude Code sessions, newest first; --live lists every running clauth session; clauth switch --list lists the ones switch takes
clauth resume <id|latest> --profile <name>, --with-fallback resume a session under a chosen account; --with-fallback follows the fallback chain as start --with-fallback does, or resumes pinned and says why at the first prompt (Claude Code plugin)
clauth info <id|latest> print a session's resume command, workspace, and storage path
clauth daemon --status, --standby, --replace, --no-standby, --listen [ADDR:PORT], --cert <path>, --key <path>, --dump-openapi run the refresh + auto-switch loop with no TUI
clauth devices --json; pair <name> [--control] [--sessions] [--no-qr], add <name> [--control] [--sessions], revoke <name>, allow-sessions <name> list, pair, add, revoke, and grant sessions to the devices that may call the REST API
clauth status --json --all, --disabled print the daemon's status shape once, from disk, codex accounts included
clauth mcp stdio MCP server; Claude Code launches this, not you
clauth completions <bash|zsh|fish|install> [shell] print or install a completion script
clauth herdr install --key <spec>, --no-config, --yes install the herdr plugin and bind a key to it
clauth herdr uninstall --no-config, --yes remove that plugin and the config lines it added
clauth herdr config get <key> print one herdr knob: popup_width, pane_tag, tag_watch_secs, border_label, delegate_dot, delegate_row_text, restore_notice
clauth proxy check <url | service> --admin-token-file <path>, --key-file <path>, --destructive <account> check a running clauth-compatible proxy against the clauth proxy contract: one line per departure, exit 1 when there is any. The target is a base URL (both files required) or a registered proxy's service, whose admin token and the key of the one profile whose base_url is its bind stand in for any file not given. Safe on a live proxy: every write it sends is one a conformant proxy refuses (each control write sent without the admin token, mutating routes aimed at an account id no proxy holds, PUT /clauth/v1/accounts, a PATCH /clauth/v1/config naming a setting no proxy declares); the one login flow it starts is cancelled after a paste it must refuse when it takes none; it sends one real inference request, one bearer-key request with a malformed body a conformant proxy refuses with 400, five inference probes a conformant proxy refuses with 401 (no key, the admin token, an unknown key, an x-api-key and bearer that disagree, an unknown bearer), and POST /v1/messages/count_tokens, which a proxy declaring the capability answers with an input_tokens and any other with 404. --destructive also changes each setting it can, resets it to its default with null and restores it, runs each action, re-binds a login, re-mints the key and deletes the named account — needs --key-file in both forms — for a proxy's CI. The files hold the secret alone and must be readable by you only. check <service> refuses a registry row with a key clauth does not know, naming the row and the key, and refuses clauth's own admin token file under 32 characters or holding whitespace/control characters
clauth proxy enable <service> --port <port> record a clauth-<service>-proxy found on PATH for the daemon to run: reads its manifest, refuses a contract major clauth does not speak, picks a free loopback port and mints its admin token. --port is the first enable only — a later one refuses a different --port and keeps the recorded port, token and state dir, since the proxy's profiles carry the port in their base_url. It refuses an existing admin token file other users can read (run chmod 600 on it), one holding whitespace/control characters or one under 32 characters (delete the file and clauth mints a new one), and it refuses while proxies.toml holds a row with a key clauth does not know, naming the row and the key
clauth proxy disable <service> stop that proxy and keep its row, port, admin token and state dir, so its profiles work again after a re-enable; nothing is deleted. Refuses while proxies.toml holds a row with a key clauth does not know, naming the row and the key
clauth proxy list --json one row per clauth-<service>-proxy on PATH or registered, joined with the daemon's live state: service, version, contract, enabled, port, state; --json emits an array of objects. A row that has a reason (a misconfigured row's unknown key, a refused manifest, a missing token) prints it as <service>: <reason> on its own line after a blank line below the table; --json adds a reason field to each object, a string or null

--theme <full\|compatible> is global and forces a color depth for the TUI: full paints its own surfaces, while compatible uses the nearest xterm-256 color and leaves the terminal's own background showing.

Rules worth knowing

  • start argument order. clauth's own flags go before the profile name. Anything clauth does not recognize is forwarded to claude verbatim, leading hyphens included; the one exception is a --settings before --, which clauth merges into its own settings file when it passes one. Use -- for a spelling both programs own, like --help.
  • Auto memory and Read of tool results don't prompt. Claude Code checks both the written and the resolved path, and a shared session's config dir links into ~/.claude, so the resolved one falls outside the dirs it exempts.
    • start and delegate point autoMemoryDirectory at the linked-to dir, and add a Read hook that allows only the session's own tool results. Grep and Glob on them still prompt.
    • A memory directory you set yourself, in any settings file or --settings, wins.
    • Plan files and user-scope agent memory still prompt until Claude Code checks those paths through the link.
  • start --with-fallback hands the session its own fallback chain. Refused by name when combined with --isolated, on Windows without symlink privilege, or for a non-OAuth account.
    • Also refused for an account outside the chain, when the chain has no other member, or when no clauth daemon is running.
  • start --auto picks the account instead of you naming one: the fallback-chain member with headroom for the models the session will run, taken in your walk_order (Auto-switch).
    • It takes the profile name's place, so separate claude's own args with -- whenever the first of them starts with a hyphen: clauth start --auto -- -p "hi". With no name in that slot there is nothing to tell a passthrough -p from a misspelled clauth flag.
    • Refused when the fallback chain is empty, or when no member of it can start.
  • start --explain prints the account a start would launch on and the walk behind it, then exits without launching. It runs the refusals a real launch runs and dates every usage reading it judged, so a stale cache shows as one.
  • start --isolated keeps the session. Its transcripts and session state are lifted into your global store before the throwaway runtime is discarded, so the run stays resumable and its tokens are counted.
    • A hard kill (SIGKILL) skips that teardown; the next stale-runtime sweep lifts the tree into the global store before deleting it, so a killed session is rescued too.
    • The --rescue/--no-rescue flags and the auto_rescue setting that used to decide this are gone; there is nothing to opt into and no way to opt out.
  • A killed shared session keeps its transcript too. Where clauth copies ~/.claude into a profile's runtime tree (Windows without the symlink privilege, or a home on exFAT, FAT32 or SMB), the next start or cleanup moves a dead tree's transcripts and new session files into your global store before it removes the copy.
    • A transcript that grew lands under its own name; one that diverged from yours lands beside it as <id>.rescued-<n>.jsonl. The lines the dead session added to history.jsonl after its last sync are not carried over.
    • On every OS, a session-file folder ~/.claude did not have yet (a first plans/) reaches it when the session ends.
    • A tree whose files cannot all move (a full disk, an unwritable ~/.claude) stays as runtime….rescuing in the account's directory under ~/.clauth/profiles/ and is retried at each cleanup.
  • A link at a runtime tree's path stops a start. When ~/.clauth/profiles/<p>/runtime… is a link clauth may not or cannot remove, clauth start refuses with <path> is a link, not a runtime tree clauth made; remove it and start again.
  • A --bg start can meet clauth's own stop. While clauth is stopping the background service in that account's background tree, clauth start <p> -- --bg refuses with clauth is stopping Claude Code's background service in {path}; retry in a moment, and a retry a moment later starts it. A plain start moves to a fresh tree instead, except on a Linux or macOS host where clauth copies runtime trees, where it refuses the same way.
  • A scheduled task added inside a clauth start session lives in that session's runtime tree. It is gone once clauth removes the tree; add a task you want to keep from a plain claude session.
  • delete, disable and a limit-reset spend want a TTY. Each prompts [y/N]; on a non-TTY stdin or stdout they refuse unless you pass --yes, except a limit-reset listing (no id, or --list), which never prompts and runs fine on a pipe, and disable on a profile already disabled, which says so and changes nothing. --force is the only way past delete's live-session and unrescued-files guards, and --yes alone does not override them.
  • Bare names span both rosters. clauth <name>, delete and start try the Claude Code profiles first, then the codex ones; an unknown name lists both (available: …, codex: …).
    • disable, enable, rename, rolling-token and static-token refuse a codex name as one (Codex); limit-reset takes a codex or Claude Code name.
  • A new account name can't start with - or ., or be exactly a clauth command (List is fine), and a new device name can't start with - or .. An account already stored under such a name keeps loading; the TUI, the daemon log and clauth's user-facing commands warn about one that starts with - (a lone - aside) or equals a command, since a printed command reads a - name as a flag and a bare clauth <name> runs the command instead (clauth switch <name> still switches).
  • login <existing> re-authenticates in place. The chain slot, env block, and model settings survive; on a terminal, a browser re-login asks first, and the confirm says whether it replaces the stored login or adds one beside what the profile keeps (a piped run proceeds without asking).
    • On an account that has an endpoint and a key it can still authenticate with, whether or not clauth recognises the provider, a browser re-login touches the subscription login alone and leaves the endpoint and key where they are.
    • That is because the stored OAuth chain is what you came to renew, and the key is what that account's inference actually runs on.
    • An endpoint with nothing left behind it is cleared as before, so a re-login never leaves a bare endpoint standing in front of a fresh subscription login.
    • An api-key re-login replaces the endpoint set, and so does any capture that brings one of the fields; a headless one (non-interactive stdin) with no --base-url reuses the stored endpoint instead of prompting.
    • The stored OAuth chain survives an api-key re-login: it is what usage polling and rolling-token roll from.
    • A proxy account takes one login, its proxy's. Every other form, the TUI's re-login actions included, is refused before any browser or prompt and changes nothing; the CLI exits 2 with Error: '<name>' is an account on proxy "<svc>": log in to it again with `clauth login <name> --proxy <svc>`, or delete it with `clauth delete <name>` first. capture into it is refused too, changes nothing, and names the same --proxy login.
  • login <alibaba account> opens the Alibaba Model Studio console instead, because that plan's usage figures run on a console session its api key cannot stand in for.
    • It replaces that session and nothing else: endpoint, api key and model settings all stay put. There is no confirm either, since re-running it is the routine repair.
    • The window it captures is measured from your aliyun console sign-in (Configuration).
    • Passing --base-url or --api-key still takes the ordinary api-key path, so starting one from nothing is two steps: give the account an Alibaba endpoint first (the Qwen preset on the Setup tab, or --base-url here), then run a bare clauth login <name>.
    • The console a session comes from is read off the endpoint, so a name that has none yet has no console to open.
  • login on a box with no browser (or over ssh): the same login prints the link under Browser didn't open? Use the url below to sign in and prompts Paste code here if prompted:.
    • Open the link on any device, sign in, and paste the code the page shows back into the prompt (read echo-off). The browser callback still wins if it lands first.
    • It is Claude Code's own "Browser didn't open?" path, so it mints exactly what a browser login mints: usage polling, plan tier, and rolling-token all work.
    • The Setup tab's login modal has the same: c copies the link for another device to your local clipboard through the terminal (OSC 52), p turns its row into a code field: type or paste the code, ⏎ submits, esc brings the row back.
    • A non-TTY stdin is read as one line, for a driver that takes the link off stdout and feeds the code back to the same process; EOF just leaves the browser door open. The code is bound to that process, so it cannot be piped in from an earlier run.
  • login --setup-token captures a claude setup-token mint (echo-off, or piped on stdin) as the profile's long-lived login.
    • That token never races clauth's refresher. It engages only for a genuinely long-lived token; a rotating pair pasted here is ignored and called out on the card.
    • Alone it gives /usage nothing to read. Add an OAuth login beside it, or turn on the profile's usage_probe, which reads its usage with a 1-token request that may start the 5h window — a plan with no 5h limit has none to start (Configuration).
  • login <name> --proxy <service> adds an account on a proxy you enabled with clauth proxy enable <service>; a proxy with no row, or a disabled one, is refused naming that command. clauth runs the proxy's own login flow: the proxy's page opens, its link prints under Browser didn't open? Use the url below to sign in, and on a terminal, when the proxy takes a pasted code, clauth: paste the code from the proxy's login page (empty to wait): waits beside the browser. Whichever finishes first wins.
    • The profile's base_url is the proxy's loopback address, its api key is the proxy's own inference key, and its [proxy] table names the service and the account (Configuration). The upstream credential stays in the proxy's state dir; clauth never holds it.
    • An existing name that is no account on that proxy is refused before any request: --proxy registers a new name, and an account on another proxy needs another name.
    • Run on the same name and service, it logs that account in again in place. Every other field stays, --model sets the default model, the stored key stays unless the login brings a new one, and any quarantine lifts. A re-login the proxy lands on another account changes nothing and says so.
    • A re-login cures a rejected key: clauth mints a new key over a stored one on record as rejected, and that verdict clears. A login that leaves clauth with no key at all mints one too, then prints the usual success line.
    • A new login the proxy signs in as an account another profile already holds mints nothing, deletes nothing and saves no profile; the holder is the one logged in again: Error: proxy "stub" signed 'py' in as account "acct-1", which 'px' already holds: 'px' is logged in again, and clauth saved no 'py'.
    • A failure before the login finishes cancels the flow on the proxy and saves nothing; a proxy that stops answering as itself ends the login with … The login stopped and clauth saved nothing. Check it with `clauth proxy list`, then retry.
    • A pasted code the proxy could not check prints clauth: proxy "stub" could not check that code (HTTP 503); finish signing in in the browser, or press Ctrl-C and run the login again once on stderr, and the login keeps polling.
    • A new login whose profile cannot be saved deletes the account the proxy just created: the save's error ends ; clauth deleted the account proxy "stub" had just created ("acct-1"), or, when that delete fails, , and deleting the account proxy "stub" had just created ("acct-1") failed; delete it on the proxy. A signal pending at the failed save, or the first during that delete, lets the delete finish: same line, exit 128 + signal. A further signal exits at once with the save's error alone.
    • Ctrl-C or SIGTERM stops the login and exits 128 + signal. clauth reads the flow once more and says how it ended on the proxy; a second signal exits at once.
    • Nothing had finished: clauth: login cancelled; proxy "stub" stopped its login flow, or, when the proxy does not confirm it, clauth: login cancelled, but proxy "stub" did not confirm its login flow stopped; do not finish the login in the browser.
    • A new account had already landed, so clauth deletes it: clauth: login cancelled; proxy "stub" had already created account "acct-1" and clauth deleted it, or, when that delete fails, clauth: login cancelled after proxy "stub" created account "acct-1", and deleting it failed; delete it on the proxy.
    • A re-login had already landed, or a new login on an account another profile holds: clauth: login cancelled too late: proxy "stub" had already re-bound profile "px", which stays logged in. That account is never deleted.
    • On Windows clauth handles no signal here: a Ctrl-C ends clauth and the flow expires on the proxy's own clock, so one sent after the browser finished leaves the new account on the proxy with no profile.
    • clauth never uses a Claude Code login on a proxy account, so a stored OAuth chain beside its key is never refreshed, rotated or polled. rolling-token and static-token, --clear included, refuse before changing anything (exit 2): Error: 'px' is an account on proxy "stub": it signs in through its proxy and has no Claude Code login to roll or restore.
    • A Claude Code /login while a proxy account is active is never saved into it: on one that stores no login, clauth warns once per login and the next switch away drops that login.
  • rolling-token <profile> points the profile's sidecar at its own clauth-private usage chain instead of a static mint: the daemon re-stamps it with the chain's current access token — full scopes, the account's subscriptionType and its rateLimitTier, but no refresh token.
    • That way sessions hold nothing rotatable (the split's whole point) while running a bearer the API recognizes as the plan it is, and plan-gated models work in a clauth-managed session.
    • A claude setup-token mint carries neither user:profile nor a subscription stamp and gets capped.
    • Arming widens what a session's credential can reach, and the command says so.
    • It needs the daemon running: the bearer dies in hours, and the daemon's scan is what re-stamps it before then.
    • The mint it supersedes is preserved at session-token.static.json; the bare clauth static-token <profile> — or a terminally dead usage chain — restores it rather than signing sessions out.
    • A chain that only cannot be reached for now (no network, a laptop asleep through its re-stamps) gets the same restore once the rolling bearer is within 20 minutes of expiry, and the daemon's scan puts the rolling token back within 15 minutes of the chain answering.
    • The Setup tab's token row switches to an hours-scale rolling · re-stamps in ~Nh countdown and reads rolling token stalled if the re-stamping ever stops.
  • static-token --clear is the way back out. A stored long-lived token is what every switch installs, so a plain clauth login <profile> refreshes only the OAuth pair clauth polls usage with, and never reaches a session — unless the profile has rolling_token set, when every rotation re-stamps the token from that pair, so the sessions move onto the new login at the next rotation. The login prints a note saying which case applies.
    • Clearing is the FULL exit: it drops the token, the preserved mint backup, and the rolling_token flag together.
    • A lingering flag would have the daemon re-stamp a fresh sidecar over the removal, and a lingering backup keeps a year-scale credential on disk under a command that just said "cleared".
    • Then it relinks the live credentials when the profile is active.
    • It is refused when clearing would strip the profile's last credential — a stored token (or preserved mint) with no other login behind it; a profile whose only rolling piece is the flag disarms regardless, since no credential is touched.
    • An api key counts as that other login, so an api-key profile clears with no OAuth pair to fall back to: the live credentials are removed rather than relinked, Claude Code is signed out (on macOS, out of the Keychain too), and the profile carries on authenticating by api key.
    • A flag-only profile has no login at all behind it, so the sign-out leaves nothing serving and the line says to log in before switching to it.
    • The line clauth prints for the clear names what backs the profile now: its OAuth login, its api key, or nothing; on the active profile that reads relinked, signed out with the api key serving, or signed out with nothing serving.
  • resume latest refuses rather than silently picking the second-newest when a live isolated session holds a newer one. clauth info names where any transcript actually lives.
  • daemon --listen also serves the REST API over TLS: the status feed, the OpenAPI document, the account switch, and device pairing. It is off unless asked for, and every request but a pairing or a CORS preflight from a listed origin needs the token of a device paired on this machine (a browser's terminal-stream upgrade carries a one-use ticket that token minted instead).
    • clauth devices pair <name> [--control] [--sessions] [--no-qr] prints a one-time code (5 minutes, one use) for the device to enter, and on a terminal, while a daemon runs, [serve] names the app's page, and the daemon's address is known (the one a --listen daemon publishes, or [serve] public_address), a link to the clauth app carrying the code and that address, with its QR code (--no-qr drops the QR; the [serve] rows in Configuration name both halves). clauth devices add <name> [--control] [--sessions] mints a token here and prints it once.
    • --control on pair or add lets that device switch accounts rather than only read, and --sessions (requires --control) grants it session creation once [serve] session_creation is on; clauth devices allow-sessions <name> grants that later.
    • clauth devices revoke <name> refuses its next request and closes its open streams within seconds, no restart needed. The token from before pairing keeps working as the device legacy.
    • TLS comes from this host's lego certificate, or from --cert/--key when the host's own name resolves to no certificate.
    • Full detail in REST API.
  • sessions --tokens parses every transcript in full to total tokens and cost. On a large store that takes a while, which is why it is opt-in.
  • herdr install runs herdr's own installer and passes its preview and confirm straight through, then adds the two things a herdr plugin cannot declare for itself: the key that opens the clauth dashboard, and the sidebar row that renders which account each Claude Code pane burns.
    • Both land in your herdr config.toml, appended after a diff and a [y/N], and herdr validates the result before anything is written. Run it a second time and it adds nothing.
    • --yes skips every prompt: the key prompt (the key falls back to prefix+a unless --key names one) and both confirms, herdr's install preview included. --yes is required on a non-TTY stdin or stdout.
    • herdr uninstall reverses both halves behind one confirm, and declining leaves both alone; it removes only the blocks clauth marked as its own.
    • For either command --no-config covers the plugin and leaves config.toml untouched.
    • After that, clauth keeps the plugin current on its own: it lands the plugin at the latest release and compares the installed checkout's commit against that release's commit, reinstalling when they differ, up to once per 30 minutes (turning off the Config tab's auto-update row, or CLAUTH_NO_UPDATE=1, opts out).
    • The whole surface, including the per-pane account tag: herdr plugin.
  • rex install writes the Rex plugin bundled in the binary to clauth/ beside Rex's init.lua and appends one marked require("clauth") block that loads it, after a [y/N].
    • Rex support is experimental: nothing heals or updates the install on its own, the Services tab's rex row only reports it (naming clauth rex install when it is missing or stale), and a new Rex build can break it.
    • The plugin opens Claude Code through clauth start --auto --with-fallback, shows the dashboard in a floating pane, and labels each pane with the account it spends.
    • Rerun it after upgrading clauth to refresh the files; it stops the running pane-label watcher so Rex's reload starts one on the new files. rex uninstall takes the block and the files back out, stops the watcher and removes its state under ~/.local/state/clauth-rex/; it refuses while a string outside a comment and outside clauth's block in init.lua names clauth, and while the block holds a line clauth did not write. --yes skips the prompt for either.
    • The whole surface: Rex plugin.

Environment variables

Variable Effect
CLAUTH_NO_UPDATE=1 disables the hourly background update check and self-replacement in the process it is set for, even when the Config tab's auto-update toggle is on
CLAUTH_NO_COMPLETIONS=1 skips the first-run completions prompt
CLAUTH_NO_API=1 disables the daemon's REST listener whatever --listen says
CLAUDE_CONFIG_DIR scopes which and start to that config dir's credentials
CODEX_HOME set by clauth start on a codex profile to the session's own home, which is how which answers inside one; read by login --codex as the codex home to capture from, when it is not a clauth session home; when you set your own, the home a codex switch repoints the auth.json link under and a delete detaches it from
CLAUTH_OPERATOR_CODEX_HOME internal, set by clauth start on a codex profile to the codex home you launched it from, so a clauth command run inside the session acts on your own home and not the session's. Never set it yourself
SHELL how completions install detects your shell when you do not name one
COLORTERM what the TUI auto-detects its color depth from: truecolor or 24bit picks full, anything else compatible. --theme and the [theme] name key in profiles.toml (an older scalar theme = "full" still reads) both beat it
HERDR_CONFIG_PATH which config file herdr install writes into, matching how herdr itself reads the override
HERDR_BIN_PATH which herdr binary clauth runs, else herdr on PATH. herdr injects it into every pane process itself

Exit codes

0 success, 1 failure, 2 usage error (unknown profile, bad flags). clauth daemon --status exits 0 when a daemon is running and 1 when none is.

Clone this wiki locally