The actual ccdad TUI, captured with example accounts and no real credentials.
ccdaddy
Quota-aware account management for Claude Code and Codex.
ccdad stores your accounts, monitors usage, and rotates accounts as quota runs
low. Its terminal dashboard brings account status, usage windows, reset times,
switching policy, and capacity forecasts into one view.

|
Claude Code |
Codex |
| Add an account |
ccdad add claude |
ccdad add codex |
| How requests use it |
ccdad updates the managed Claude login, including macOS Keychain storage |
ccdad routes requests through a local authenticated proxy |
| Follow account changes |
Sessions using the managed login can follow switches |
Already-routed, unpinned conversations follow the serving account on their next request |
| Pin a session |
ccdad run c1 |
ccdad run x1 |
| Display indexes |
1, 2, 3, … within Claude |
1, 2, 3, … within Codex |
Codex must run through the ccdad wrapper to use ccdad's accounts. A provider
shown as openai in Codex's /status is a direct session; changing ccdad's serving
account does not move it. See Codex accounts.
Contents
Install
Install Claude Code or Codex separately. ccdad's release binaries are standalone;
they do not require Go or Node.js to run.
macOS and Linux
curl -fsSL https://raw.githubusercontent.com/Kweiza/ccdaddy/main/install.sh | bash
The default destination is ~/.local/bin. If it is not on your PATH yet:
~/.local/bin/ccdad setup-path
Open a new terminal after changing shell startup files.
Windows — PowerShell 5.1 or newer
irm https://raw.githubusercontent.com/Kweiza/ccdaddy/main/install.ps1 | iex
On older PowerShell 5.1 hosts, enable TLS 1.2 first if the download fails:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
The Windows installer adds %LOCALAPPDATA%\Programs\ccdad to the user PATH and
updates the current PowerShell session. Release targets are Linux, macOS and
Windows, each on amd64 and arm64.
Installer options
| Environment variable |
Meaning |
Default |
CCDAD_INSTALL_DIR |
Installation directory |
~/.local/bin on Unix; %LOCALAPPDATA%\Programs\ccdad on Windows |
CCDAD_VERSION |
A specific release tag |
Latest stable release |
CCDAD_BASE_URL |
Release download origin for a mirror |
GitHub releases |
Both installers verify SHA-256 checksums before replacing the binary. The Unix
installer does not edit shell startup files; ccdad setup-path manages those.
Windows binaries are not Authenticode-signed, so SmartScreen may show a warning.
Upgrading
ccdad update --check # check availability and installation writability
ccdad update # verify and install the latest stable release
ccdad update --version v0.24.0 # select a specific release, including a downgrade
ccdad update verifies signed checksums, checks the downloaded binary, and
restarts the daemon if one was running. It has no verification-bypass option.
Package-manager installations must be upgraded through their package manager.
The updater keeps the architecture of the running binary. Re-run the installer
to move from an amd64 build under emulation to a native arm64 build. Re-running
an installer stops the old daemon; normal account commands or
ccdad daemon start bring it back.
Verifying the download
Releases include six binaries, sha256sums.txt, sha256sums.txt.minisig, license
notices, and GitHub build-provenance attestations. Using a trusted checkout's
public key, verify downloaded checksums and their named release:
minisign -Vm sha256sums.txt -p ccdaddy.pub
sha256sum --ignore-missing -c sha256sums.txt
On macOS, use shasum -a 256 --ignore-missing -c sha256sums.txt for the second
command. Check that the signed trusted comment names the release you intended
to download. An attestation can be checked independently:
gh attestation verify ccdad-linux-amd64 --repo Kweiza/ccdaddy
Removing it
ccdad uninstall
This stops the daemon and removes ccdad's store, registration, and binary. Use it
instead of deleting the binary alone.
Quick start
Claude Code
ccdad add claude --alias work --activate
ccdad add claude --alias personal
ccdad status
ccdad # interactive dashboard; requires a terminal
claude
Adding an account stores it without switching unless you pass --activate.
For a browser login from a headless terminal:
ccdad add claude --no-browser --timeout 15m
The pasted-code flow still requires a terminal on stdin. ccdad add-token accepts
API keys and setup tokens, but those are not refreshable browser logins and do
not provide the usage polling needed for automatic rotation.
Codex
ccdad add codex # device-code login
ccdad codex shim install # Unix wrapper; add also attempts this automatically
# Open a new terminal, then verify the wrapper is first on PATH:
command -v codex
codex
On Unix, command -v codex should resolve to ~/.ccdad/bin/codex. In Codex,
/status should show provider ccdad. To route explicitly, independently of
shell PATH order, use:
ccdad codex exec
On Windows, use this explicit launcher; ccdad does not install a Windows Codex
shim. See Routing and resuming sessions.
The dashboard
Run bare ccdad in a terminal. Use ccdad status for a text listing or
ccdad status --json for scripts.
The dashboard groups accounts by provider. Each group has its own quota columns:
Claude's 5-hour, 7-day and scoped windows; Codex's primary and secondary windows
with durations supplied by its API. ? means unknown; - means that quantity is
not present. A failed reading is never displayed as zero usage.
| Key |
Action |
up / k, down / j |
Move between accounts in displayed order |
s |
Switch to the account under the cursor |
X |
Remove the account under the cursor, after a confirmation that names its provider |
a |
Choose a provider and add an account |
o |
Toggle automatic sorting by the nearest 7-day reset |
c |
Choose the switching strategy |
d |
Open daemon status and logs; S starts, x stops, R restarts |
r |
Refresh usage and due profile checks, as ccdad status --refresh does; at most once every three minutes |
? |
Show help |
esc |
Return to the previous screen |
q / ctrl+c |
Quit the dashboard |
Quota and profile refreshes belong to the daemon. For a manual refresh, press
r in the dashboard or run ccdad status --refresh. Both skip readings under
three minutes old and respect quota backoff. The dashboard also starts at most
one network refresh every three minutes, counted from the end of the last one
and whether or not it succeeded; pressed sooner, r reloads local state and
says when it can ask again. A refresh and a command never run at once, because
both can spend the same single-use refresh grant: a refresh waits for a running
command, and the first command key pressed during a refresh (switch, remove,
strategy, sort, or a daemon key) runs when it ends. q or ctrl+c during a
refresh waits for it to finish and then quits, dropping a command key pressed
during the refresh; during a command it waits and shows the command's result.
esc on that panel stays, and while it is up, q again after a two-second
pause quits at once. Closing the terminal still ends the dashboard at once.
Between key presses
the dashboard reloads local state every ten seconds without network requests,
and keeps the selected account by UUID when rows reorder.
Subscription status
Claude profiles are checked independently of usage polling. A quota API 429 does
not postpone a due subscription check.
checking: the subscription has not been verified; automatic selection is held.
unsubscribed: the profile explicitly reports a canceled, expired, or unpaid
subscription; it is excluded from automatic selection and warm-ups.
- A later profile confirming renewal restores eligibility, unless you manually
disabled the account or assigned it to another machine.
Profile checks normally run daily, with earlier checks after permission failures.
While the daemon runs, an unsubscribed account is checked every 15 minutes
instead, so a renewal shows up without waiting a day. Failed checks have a
persisted 15-minute retry interval. A network error or an empty usage window
alone is not treated as subscription expiry. Codex usage
polls also refresh the stored plan; a free Codex plan is not automatically disabled.
Commands
Run ccdad <command> --help for exact flags and argument handling.
| Command |
Purpose |
ccdad |
Interactive terminal dashboard |
ccdad status [--refresh] [--json] |
Accounts, quota, strategy, forecast, and daemon state |
ccdad which |
Managed Claude login and Codex serving account |
ccdad add claude / ccdad add codex |
Add a provider account |
ccdad add-token |
Read a token without echoing; use - to read stdin |
ccdad switch ACCOUNT |
Switch the managed Claude login or Codex serving pointer |
ccdad switch --strategy headroom |
Ask the Claude ranking engine to select a target |
ccdad run ACCOUNT |
Start a session pinned to an account |
ccdad codex exec |
Launch Codex through the local proxy |
ccdad codex shim install / uninstall |
Manage the Unix Codex wrapper |
ccdad strategy hover / manual / headroom / consume-first |
Select one switching policy |
ccdad auto --once |
Run one automatic decision from cached state |
ccdad auto |
Run the continuous engine in the foreground |
ccdad runway |
Estimate quota runway from measured usage history |
ccdad probe ACCOUNT |
Spend a small Claude request to start an unused quota window |
ccdad alias ACCOUNT NAME |
Give an account a stable handle |
ccdad move ACCOUNT POSITION |
Reorder within that account's provider |
ccdad disable ACCOUNT / enable ACCOUNT |
Change manual eligibility for automatic rotation |
ccdad own [ACCOUNT...] |
Declare which accounts this machine drives |
ccdad primary ACCOUNT on / off |
Set a credit-metered account's primary-pool policy |
ccdad remove ACCOUNT |
Remove an account and its stored credentials |
ccdad daemon start / stop / restart / status / logs |
Manage the daemon |
ccdad config get / set / unset / list / path |
Manage configuration |
ccdad setup-path |
Register executable directories in shell startup files |
ccdad export / import / bootstrap |
Transfer or provision account stores |
ccdad mcp install / uninstall |
Register the MCP server with Claude Code |
ccdad doctor |
Diagnose credentials, routing, configuration, and daemon health |
ccdad update |
Install a verified release |
ccdad uninstall |
Remove ccdad |
Normal account commands can auto-start a missing daemon. Administrative commands
such as config, update, and daemon status do not. The daemon is self-managed;
there are no supplied launchd, systemd, or Windows service units.
Account references and ordering
Display indexes start at 1 within each provider. Use c1 for Claude's first
account and x1 for Codex's first. A bare number works only when it identifies a
single account; a number present in both groups is refused as ambiguous.
Commands also accept aliases, email addresses, and UUID prefixes of at least
eight characters. Matching is case-insensitive. An ambiguous email or prefix is
an error rather than a guess.
ccdad switch c2
ccdad switch x1
ccdad alias x1 codex-work
ccdad move c3 1
ccdad remove x1
Automatic list sorting
ccdad config set auto_sort true
ccdad config set auto_sort false
The TUI's o key changes the same setting. It defaults to false.
Sorting stays within each provider and renumbers the displayed indexes. Claude
uses the overall seven-day reset; Codex uses a window explicitly reported as
seven days. Unknown or already-passed resets and inactive subscriptions sort
last. Ties keep their relative order. Sorting reads the cache without requesting
new usage data.
Disabling automatic sorting uses the stored order. Store writes while it is
on can persist the sorted order; turn it off before arranging accounts manually
with ccdad move.
idx is a display ordinal, not a key. Scripts should use UUIDs or aliases.
JSON account objects include both numeric idx and the provider-prefixed ref.
Codex accounts
ccdad owns the stored Codex login, token refresh, quota polling, and local HTTP
proxy. Routed Codex processes authenticate to that proxy with a per-launch
secret; the proxy supplies the selected account's upstream credential.
Routing and resuming sessions
A successful shim installation does not guarantee that a running shell uses it.
NVM, standalone Codex installers, shell command caches, aliases, or an earlier
PATH entry can still select another executable.
command -v codex
ccdad doctor
For Unix shells, the ccdad wrapper directory must precede directories containing
other Codex executables. ccdad setup-path registers directories but preserves
an existing entry's position; fix precedence in your shell startup configuration
if the wrapper is already present later in PATH. Then open a new terminal or
reload the startup file and clear the shell's command cache. For the current
Bash or Zsh session, you can put the wrapper first with:
export PATH="$HOME/.ccdad/bin${PATH:+:$PATH}"
Use hash -r in Bash or rehash in Zsh if the shell cached the old executable.
The explicit form bypasses PATH ambiguity:
ccdad codex exec -- resume
Exit the affected Codex process first, run the command in its project directory,
and select the existing conversation. Already-running openai sessions cannot
be rerouted by changing PATH, updating ccdad, or restarting its daemon. Confirm
provider ccdad in /status after resuming. When the wrapper is first on PATH,
plain codex and codex resume use the same route.
Editor or desktop clients that launch their own Codex executable do not
necessarily use the shell wrapper. Check the actual session's provider rather
than assuming the terminal's PATH applies to them.
Serving, pins, and retries
Existing routed, unpinned conversations follow the current serving account on
their next request. Manual switching and automatic rotation use the same
pointer. Responses already in flight finish on their original account.
ccdad switch x2
ccdad run x1 # explicitly pinned; does not follow the serving pointer
The serving pointer is the account tried first. An unpinned request can fall
back to another eligible account when the first cannot serve it. In particular,
codex.cross_account_replay controls retrying a mid-conversation HTTP 429 on
another account and defaults to true. Setting it to false stops that retry;
it does not stop following the serving pointer on the next request.
On an account change, ccdad drops the prior account's turn-state header and
forwards conversation history unchanged. Upstream may still reject that history;
continuation across accounts is not guaranteed. Codex's usage display updates
when a response provides new usage information, rather than when ccdad changes
the pointer. Successful thread/account route changes are logged with ID prefixes:
ccdad daemon logs
codex login status describes Codex's own login, not the account the proxy uses.
ccdad which reports the serving pointer. The wrapper passes codex login and
codex logout to Codex directly; an account-pinned ccdad run refuses those
commands because they do not operate on the named account. ccdad does not write
Codex's own authentication files.
An unpinned launch that cannot establish the proxy warns and falls back to a
direct Codex launch. A pinned launch refuses instead. Read that warning: a direct
launch uses Codex's own account and is outside ccdad's routing.
Request body limits
The default limit is 512 MiB (536,870,912 bytes). To change it:
ccdad config set codex.max_body_mib 1024
ccdad daemon restart
The value is a positive integer in MiB. An oversized request returns HTTP 413
Payload Too Large, not a quota-style 429, and is never forwarded upstream.
The JSON error includes limit_bytes, actual_bytes, and
actual_bytes_at_least. With Content-Length, the complete declared size is
reported. For unknown-length streams, the proxy stops at one byte over the cap
and reports the observed lower bound with actual_bytes_at_least: true.
The proxy also reads codex.proxy_port and codex.cross_account_replay at startup;
restart the daemon after changing these settings.
Switching strategies
ccdad strategy
| Policy |
Behavior |
headroom |
Prefer accounts with the most room under their thresholds; the default |
consume-first |
Prefer using perishable weekly quota before it resets |
hover |
Use accounts with a five-hour window first, then the soonest weekly reset; hand off just before any limit |
manual |
Keep observing usage but suppress automatic switches |
ccdad strategy hover
ccdad strategy manual
ccdad strategy headroom
ccdad status
Use this command to select the policy instead of independently editing the
compatibility hover and manual flags. The dashboard's c key uses it too.
Hover orders the Claude lane's accounts instead of comparing their room:
- Accounts with a five-hour window come first. The one whose week resets
soonest is used, and it is kept until it reaches a limit; it is never left
for another five-hour account that merely has more room.
- Then weekly-only accounts, such as verified Ultra seats, which report no
five-hour window. The session always goes to the one whose week resets
soonest, once that week ends at least
recovery_hysteresis (default 5m)
sooner than the current one's.
- The session returns to a five-hour account as soon as it has room again.
- An account is handed off one point before any limit it cannot avoid by
changing model (a primary credit seat at 95% of its balance), or earlier
when the work running now would run it out: on a five-hour window, before
its next reading; on a week, within three minutes after it. A five-hour
window is run that close because it comes back in hours, and work that
outruns the reading before the hand-off can stop the session, most often
for about half a minute; the longest stop in the simulated week was 37
seconds.
The work's rate is taken only between two readings of an account that were
both made while it was live, and it follows the work across a switch.
- The session is moved only to an account that would still have three
minutes of that work left after the engine has read it twice on it. When
none would, the session stays until the live account would stop before its
next reading, and then moves to an account that outlasts it by the
cooldown; once the live account is out -- empty, or projected out while the
latest pair of live readings saw the work running -- it moves to whichever
account lasts longest. Another account's last point is taken only once the
live account reads empty, so when every account is down to its last point
they are spent one at a time. A credit seat comes after all of these, only
when every account reads empty and your thresholds say the main pool is
exhausted. A primary credit seat is moved to only when the account the
session is on reads at its last point or empty. From a credit seat the
session goes back to any cheaper account that is not empty and not on its
last point, free quota first.
- The account the session moves to is read straight after the switch rather
than at its idle cadence.
An account left at a limit is held out until the window that stopped it rolls
over, so the session is not taken straight back to it; it is still used when
nothing else has room. Weekly-only quota is spent only while every five-hour
account is at a limit, so on a fleet with several such seats most of their
weekly quota can expire unspent.
Hover cannot see the work between two readings, and a session can still stop
at a limit while another account has room. Hover projects the live account at
the rate the work was last measured running. A pause is not taken for slower
work: at 5.4 points a minute, a paused live account more than about 57% spent
is projected near its limit and handed to an account that can carry the work,
before the work resumes. Another account's last point waits for the live
account to read empty, and credits wait for every account to: no projection
opens them. The projection comes too late when:
- the work runs faster than its last running rate, as a burst does after a
quiet stretch;
- the readings are whole percents, so the live account can be up to a point
further spent than it reads, a rate is measured to the nearest point, and an
account holding less than a point reads the same 99 as one holding a whole
one;
- the rate was measured on another plan, whose points are not this one's;
- the reading due before a five-hour hand-off is slow or fails -- a poll may
take up to 45 seconds -- so the hand-off waits until the projection alone
has the account out, with no newer reading to correct it.
The live account then runs out before its next reading shows it, and the
session stops until that reading lands. On a week a three-minute reserve
absorbs most of that; a five-hour window has none, since it is handed off at
the last reading before the work would stop it, so on a five-hour account
these cases stop the session, most often for about half a minute. In the
simulated week, today's fleet under the production rate of 5.4 points a
minute leaves 0.5 five-hour points at a hand-off on average and stops five
times a week, 46 seconds in all, none longer than ten; under steady heavy
use it stops six times, 174 seconds; under heavy use in three-minute bursts
five times, 145 seconds; and under the production rate in short bursts with
pauses between them four times, 107 seconds, the longest 37. With the reserve
on five-hour windows too it left 27 points a hand-off and stopped only under
burst load, once, for 29 seconds. Six more cases cost the session something:
- A rate stands until a newer running measurement replaces it, across window
resets and daemon restarts alike. A five-hour rate measured in a burst can
outlive the burst: above about 12.5 points a minute even a freshly reset
five-hour account is not one the work can be moved to, so a session on a
weekly-only seat stays there until that seat's limit. A weekly rate is
usually one point over a few minutes, several times the true weekly rate,
which keeps a week near its end from taking the work and leaves about one
more point of a five-hour account's week unspent.
- Right after ccdad is installed, before any account has been measured twice
while live, there is no rate: other accounts are judged by their levels, and
the live account by its own window's average.
- Accounts sharing one organization share its polling budget. The first look
at an account after a move is the shared floor the hand-off already counts,
but the looks after it come at the live cadence times the number of accounts
sharing it, later than a single account's would.
- When the only accounts with anything left are on their last points, a live
account that runs out while it still reads short of empty stops the session
until the reading that shows it empty, though another account holds a
point: that reading is what confirms the live account spent before the next
one is started.
- A pause that began after the latest live pair, with every account's stint
since too short to make one, is not seen: the login can still move onto an
account holding more than its last point and too little to carry the work,
on that pair's word. And when nothing is running and the live account is
projected near its limit, ccdad can move the login to an account holding a
cooldown's worth more than the live one has left and less than a carrier's
-- at 5.4 points a minute, up to about 43 to 59 points -- and later back
again. No session is cut, no credit is
bought, and a primary seat's balance is moved onto only from an account
that reads at its last point; but each move writes the credential, polls the
account and updates Claude Code's settings, and if the work resumes just
after a move, the next move waits out the cooldown.
- Money is decided on readings alone, in both directions. With credits opted
in and every account dry, a live account that runs out between two readings
stops the session until the reading that shows it empty: three minutes at
the live cadence, and longer while the usage endpoint throttles the poll,
360 to 1800 seconds after a 429. And the session moves onto a primary credit
seat only when the free account it is on reads at its last point or empty.
At 5.4 points a minute a reading three minutes apart rarely lands on the one
point a last point is, so a running hand-off onto the seat usually stops the
session at the free account's limit until the next reading: 0 to 180
seconds, about 90 on average, by calculation rather than measurement, and
longer while the usage endpoint throttles the poll, 360 to 1800 seconds
after a 429.
In a simulated week, with whole-percent readings and the daemon's warm-ups, a
session stopped while another account had room in eighteen of 28
fleet-and-load variants, for between 36 and 3501 seconds, and in none of the
rest, every light and idle load among them. On the fleets that do not run dry
those are mostly the five-hour hand-offs above, up to 37 seconds a stop; on
the two that do, they also hold the wait for a last point to read empty. Those
figures belong to the simulated fleets and loads; they are not a bound on what
a real week can cost. The remedy not taken is a reserve on the live account's
level: handing off with enough left to cover a step and a burst through one
reading interval, about five to eight five-hour points at every hand-off
whatever the work is doing -- an estimated 140 to 235 more five-hour points
left unspent a week on today's fleet under steady heavy use.
When the live account is at a limit and no account is better placed, hover
reports the switch as blocked until the soonest rollover. When the move left
waits on the live account's own reading -- onto money, or onto another
account's last point -- hover stays and names that reading instead, or a
rollover that comes before it. When every account is past its last point, it
orders them by which comes back first, and status says so.
Hover sets the threshold, credit threshold, strategy, preemption lead (the
three minutes above), probe setting, and cooldown (2m) itself. It uses your
recovery_hysteresis, and does not read hysteresis_pct or headroom_ratio:
every hover move is made on the order's own rules.
ccdad config list identifies overridden values; status shows the order hover
is using, and says of an account that would not carry the work running now
how soon it would run out. Hover does not
override account ownership, manual eligibility, credit-spend permission, or
Codex-specific settings, and the Codex lane does not use it.
ccdad switch
ccdad switch work
ccdad switch --strategy headroom
ccdad switch --strategy headroom --model sonnet
Targetless selection uses cached readings and the engine's switching margins.
An explicit account names the target directly. Use ccdad status --refresh or
run the daemon to keep the cache current; switching does not itself poll usage.
Recovery and preemption
When all eligible main-pool accounts are over their thresholds, the headroom
strategy enters recovery mode. Empty accounts sort behind accounts with some
quota; resets within the next hour take priority, followed by remaining slack.
Unknown usage is not treated as exhausted quota.
The engine also projects usage across its polling interval plus preempt_lead.
Measured burn between readings informs that projection; without a measurement it
falls back to the existing quota-based rules. Polling delay and upstream behavior
mean automatic switching cannot guarantee that every limit is avoided.
ccdad probe
ccdad probe work
ccdad probe --all
A probe spends a small real Claude request to start a quota window whose reset
time is unknown. It is not a free metadata query. probe_unknown defaults to
true; set it to false to disable automatic probes under configured strategies.
Hover enables probes: a window that has reported no reset cannot be placed in the
reset order hover uses.
ccdad runway
ccdad runway
ccdad runway --json
Runway estimates depletion, rollover, and needed capacity from usage samples that
have already been collected. It does not generate traffic to measure the fleet.
Accounts with too little history remain unknown. Runway currently forecasts
Claude accounts only; it explicitly reports Codex accounts as not forecast.
Codex usage and reset windows remain visible in the account dashboard.
Credit-metered accounts
Extra-usage credits are normally a last-resort pool, after the main pool's quota
is exhausted. Unattended fallback requires both the account's extra-usage setting
and a positive credit.max_auto_spend; the latter defaults to zero.
A seat billed in credits as its normal meter can be marked primary:
ccdad primary work on
Primary credit seats join the main pool and bypass credit.max_auto_spend;
marking one primary is permission to spend that way. Profiles identifying a
credit-only entitlement can receive this default when first added. Re-adding an
account preserves its existing primary setting. credit.threshold controls the
utilization threshold for credit-metered accounts.
Configuration
ccdad config path locates the store's config.toml (normally
~/.ccdad/config.toml). It contains settings, not credentials.
ccdad config list
ccdad config get codex.max_body_mib
ccdad config set auto_sort true
ccdad config unset auto_sort
An unset key uses its default. Unknown keys already in a file are preserved, but
config set rejects unknown names rather than silently accepting typos.
| Key |
Default |
Purpose |
threshold |
80 |
Claude quota utilization threshold (%) |
hysteresis_pct |
10 |
Minimum improvement for switching |
headroom_ratio |
2 |
Required relative headroom improvement |
cooldown |
5m0s |
Hold between ordinary switches |
recovery_hysteresis |
5m0s |
Reset-time margin during recovery |
preempt_lead |
6m0s |
Extra time covered by preemption |
strategy |
headroom |
Configured ranking strategy |
probe_unknown |
true |
Permit automatic Claude quota warm-ups |
hover |
false |
Compatibility storage for the hover policy |
manual |
false |
Compatibility storage for the manual policy |
credit.threshold |
80 |
Credit utilization threshold (%) |
credit.max_auto_spend |
0 |
Unattended fallback credit-spend ceiling |
codex.threshold |
80 |
Codex quota utilization threshold (%) |
codex.binary |
Empty |
Override the real Codex executable |
codex.proxy_port |
0 |
Auto-resolve a stable local proxy port |
codex.max_body_mib |
512 |
Maximum buffered request body in MiB |
codex.cross_account_replay |
true |
Retry a mid-thread 429 on another account |
auto_sort |
false |
Order accounts by nearest seven-day reset |
tui.theme |
auto |
auto, dark, light, ansi, or none |
tui.glyphs |
auto |
auto, unicode, or ascii |
update_check |
true |
Check for a newer release daily; does not install it |
mcp_switch_without_elicitation |
false |
Allow MCP switching when the client cannot ask for confirmation |
Per-window thresholds
threshold = 80
[window_threshold]
five_hour = 85
seven_day = 60
seven_day_opus = 50
A window without an override uses the lane's default threshold. Scoped weekly
windows can also be named, for example weekly_scoped:model:Opus 4.5; use names
reported by your accounts. Unrecognized scope names require an explicit opt-in
and are reported separately. Hover holds every window to its hand-off point
instead of using the numbers in this table; an entry still opts an
unrecognized scope in.
Appearance
The interactive TUI asks the terminal for its background color when the theme is
auto. One-shot listings use dark colors without a terminal background query.
Select tui.theme light explicitly for light-terminal listings, or none for no
color. JSON output is unaffected.
Automatic glyph selection uses ASCII on incompatible Windows consoles and under
RUNEWIDTH_EASTASIAN. ccdad does not change the console code page. Use
ccdad config set tui.glyphs ascii if characters do not align or display correctly.
Environment
| Variable |
Purpose |
CCDAD_HOME |
ccdad store root; defaults to ~/.ccdad |
CLAUDE_CONFIG_DIR |
Claude configuration root |
CLAUDE_SECURESTORAGE_CONFIG_DIR |
Independently scoped Claude credential root |
CODEX_HOME |
Codex's own configuration/session home; not ccdad's credential store |
CCDAD_IMPORT |
Account export path, or - for stdin, consumed by bootstrap |
CCDAD_MCP_SWITCH_WITHOUT_ELICITATION |
Per-MCP-process override for unavailable confirmation support |
CCDAD_HOME does not move the Claude login. Separate stores should also use
separate Claude configuration/credential homes; otherwise their engines can
compete over one login. ccdad doctor diagnoses the resolved paths and ownership.
Running sessions side by side
ccdad run work
ccdad run work -- --model opus
ccdad run --full-profile work
ccdad run x1
Claude sessions receive isolated credentials without changing the machine's
live login. The default scopes credentials only; MCP logins do not accompany it.
It requires Claude Code 2.1.113 or later because earlier builds ignore the scoped
credential-home variable.
--full-profile instead gives a Claude account a persistent configuration home,
seeded from top-level configuration without copying project history. Its MCP
logins and trust choices survive subsequent runs. API-key accounts require this
mode. Setup-token accounts are passed through the session's environment.
A shell can carry credentials that outrank the selected account: token variables,
a helper, a hosted-session token, or an Anthropic CLI profile. ccdad refuses a
launch it cannot scope reliably and identifies the conflicting source. It does
not silently remove your environment settings. Read ccdad doctor's API-key and
OAuth-source checks when the observed account differs from the intended one.
For a Codex account, run launches Codex through ccdad with an explicit account
pin. Its tail may be empty or begin with codex; --full-profile is not supported
for Codex. The exit status is the child application's status.
Commands that would change the machine's Claude login are refused from inside a
scoped Claude session. Run those commands from a plain shell outside the session.
Running ccdad on more than one machine
Declare a separate pool for each machine:
ccdad own work personal
ccdad own # show this machine's assignment
ccdad own --clear # return all accounts to this machine
Accounts assigned elsewhere are not automatically selected or polled here, except
for observing the currently live account. Accounts added after a split are
assigned elsewhere by default. Explicitly naming an account for a switch or
manual refresh is separate from the automatic ownership policy.
Prefer separate logins on each machine to copying a live refresh grant. A copied
grant can be rotated by one holder while the other still has the previous value.
Multiple machines also share provider-side quota and API rate limits; ccdad's
local locks do not coordinate separate hosts.
MCP registration
ccdad mcp install
ccdad mcp install --scope local
ccdad mcp install --scope project
ccdad mcp install --print-config
ccdad mcp uninstall
The default scope is user. Claude Code starts ccdad mcp as a stdio server;
its stdout is reserved for the protocol.
| Tool group |
Tools |
| Read |
list, status, which, doctor, config_get, runway |
| Store |
enable, disable, alias, move, primary |
| Switch |
switch |
| Daemon |
daemon_start, daemon_stop, daemon_restart, daemon_status |
The switch tool asks for confirmation when the client supports it. If it cannot,
switching is refused unless explicitly enabled through
mcp_switch_without_elicitation or CCDAD_MCP_SWITCH_WITHOUT_ELICITATION.
That permission does not suppress confirmation on a client that can ask.
Credential-export, login, shell-setup, and uninstall commands are not exposed as
MCP tools.
The plugin
The optional Claude Code plugin registers the same MCP
server and still requires the ccdad binary on PATH. It contains MCP wiring, not
the executable, skills, agents, or hooks.
Tool names depend on how the server is registered:
| Registration |
Example tool name |
ccdad mcp install |
mcp__ccdad__switch |
| Plugin |
mcp__plugin_ccdad_ccdad__switch |
Permission rules and hook matchers must use the matching name. Direct and plugin
registrations naming the same command are deduplicated by Claude Code.
How the switch stays safe
On macOS, ccdad follows Claude Code's Keychain-first credential behavior and
file fallback. It does not assume .credentials.json is always the active
source. Locked or inaccessible credential storage is an error, not proof that
no account is signed in.
Claude credential swaps preserve non-account data, including MCP logins and
unrecognized keys. ccdad rereads credentials under Claude Code's locks, uses
atomic file replacement, and refuses unsafe file paths. Network refresh work is
kept outside those credential locks. ccdad doctor reports storage conflicts
and unexpected credential keys.
A switch writes the Keychain item first and the credentials file second, and
skips a store that already holds the login. A Keychain write that does not
answer (ccdad allows 30 seconds) is read back before anything is reported: if
the item holds the new login the switch completes, and if it cannot be read
back ccdad says the outcome is unknown rather than claiming either.
When the Keychain item and the credentials file hold different logins, the
login is split: Claude Code falls back to the file whenever its own Keychain
read fails, so sessions can spend an account ccdad does not show as live.
- The daemon repairs a split on its next pass by putting one login in both
stores and recording it: the target of ccdad's own switch whose outcome was
unknown, if one is pending, otherwise the more recently issued login (the
Keychain item's on a tie). A login it cannot name is identified through the
profile endpoint and is not repaired from or towards until it is named;
switching is not held back for it, and
ccdad doctor warns about it.
ccdad switch repairs a split instead of answering "Already on".
ccdad doctor's login-split row names which store holds which account. It
fails when the stores hold logins of different accounts, and warns when a
login cannot be named yet or when only ccdad's record of the live account is
behind.
On Windows, file protection relies on the inherited ACL rather than Unix mode
bits. Account exports containing credentials must be treated as secrets.
Containers
The Dockerfile is a reference image you build yourself, not a
published container image. It includes Claude Code; install Codex separately if
you need it in a derived image.
CGO_ENABLED=0 GOOS=linux go build -o ccdad ./cmd/ccdad
docker build -t ccdaddy .
docker volume create ccdad-data
docker run -it --rm -v ccdad-data:/data ccdaddy \
ccdad add claude --alias work --no-browser --activate --timeout 15m
Build the binary for the architecture of the container you will run. Keep /data
on a persistent volume: it contains the account store, credentials, usage history,
and engine state. The image sets both CCDAD_HOME and CLAUDE_CONFIG_DIR.
A full export can provision the volume:
ccdad export --full --out backup.json
docker run -d --name ccdad \
-v ccdad-data:/data \
-v "$PWD/backup.json:/run/secrets/ccdad-export:ro" \
-e CCDAD_IMPORT=/run/secrets/ccdad-export \
ccdaddy ccdad daemon logs --follow
CCDAD_IMPORT takes a file path or -, never inline JSON or a base64 document.
Full exports contain refresh tokens; mount them as secrets rather than putting
their contents in the container environment. --base64 encodes the same export
as one line but does not encrypt it.
The entrypoint runs bootstrap, starts the daemon, and executes the supplied
command. Do not run the continuous ccdad auto beside that daemon: they share
the engine singleton. API keys and setup tokens alone do not supply the
refreshable OAuth usage data needed for quota-based rotation.
Scripting
Exit codes
| Code |
Meaning |
0 |
Success |
1 |
Runtime failure |
2 |
Invalid usage or a refused session launch |
3 |
Understood, nothing to do |
4 |
Blocked: no viable target or the action cannot proceed |
5 |
Negative query result, such as no daemon running |
130 |
Interrupted by SIGINT |
ccdad doctor returns 0 when no checks fail and 1 otherwise; warnings alone do
not fail it. Session launchers return the child application's exit status.
ccdad daemon status does not start the daemon it is querying.
--json
Commands with --json document it in their help. Status and other read results
use a single JSON object with schemaVersion; ccdad auto --json emits NDJSON
(one event per line). Missing values mean unknown, not zero. Key scripts on
account UUID or alias, not mutable indexes.
ccdad status --json
ccdad which --json
ccdad runway --json
Troubleshooting
Start with ccdad doctor. Use ccdad daemon logs to inspect account routing,
profile failures, token refresh, and daemon activity.
| Symptom |
What to check |
ccdad is not found |
Run the installed binary's setup-path command, then open a new terminal. |
| Codex spends a different account from the serving display |
Check /status for provider ccdad, wrapper precedence with command -v codex, explicit account pins, and route/fallback logs. Resume direct sessions through ccdad. |
| Codex still displays the old usage after a switch |
The display needs new usage information from a response. Verify actual routing; do not infer it from a cached usage panel alone. |
Codex returns 413 Payload Too Large |
Read the size and limit in the error; adjust codex.max_body_mib and restart the daemon if appropriate. |
Account shows checking |
Subscription verification is pending. Due profile checks run independently of quota backoff; failed checks retry after 15 minutes. |
Account shows unsubscribed |
The profile explicitly reports an inactive subscription. Re-add only if authentication needs repair; the daemon re-checks it every 15 minutes, and a renewal it sees restores eligibility unless the account is disabled or assigned to another machine. |
Usage remains stale after status --refresh |
The quota endpoint's freshness floor or 429 backoff still applies. Profile refresh and quota refresh are separate. |
Codex shows needs-relogin |
Its refresh grant was rejected; use ccdad add codex. |
| Claude switches do not affect the session |
Check credential-root resolution, Keychain access, overriding token/helper settings, and whether the session is scoped. |
Sessions spend an account ccdad which does not show as live |
Check doctor's login-split row. A split login is repaired by the daemon on its next pass, or now by ccdad switch to the account the row names. |
| Two daemons fight over a login |
Give separate stores separate credential homes; inspect doctor's ownership report. |
accounts.toml is missing but credential files remain |
Restore a backup or recover the accounts; do not delete the remaining credentials. |
| MCP tools disappeared after changing installation method |
Check direct versus plugin-prefixed tool names. |
| TUI glyphs are broken |
Select tui.glyphs ascii; for light terminals, choose tui.theme light. |
For bug reports, include ccdad's version, OS, provider, relevant command, and
sanitized diagnostics. Never include tokens, credential files, or full account
exports. Report security issues through SECURITY.md.
Building from source
git clone https://github.com/Kweiza/ccdaddy
cd ccdaddy
go build ./cmd/ccdad
scripts/ci.sh all
go.mod is the authority for the required Go version and dependencies
(currently Go 1.26.4 or newer). scripts/ci.sh runs formatting, vet, race tests,
six target builds without cgo, citation checks, and plugin validation when the
Claude CLI is available. GitHub CI runs tests on Linux, macOS, and Windows.
go install github.com/Kweiza/ccdaddy/cmd/ccdad@latest also builds a binary, but
without the release version stamp. Use published releases for automatic version
comparison and ccdad update. Release binaries include the required license
notices and signed checksum metadata.
Contributing
See CONTRIBUTING.md. Issues and pull requests are welcome;
open an issue before a change to account-switching behavior.
License
MIT. See LICENSE, NOTICE, and
THIRD-PARTY-LICENSES.txt.