Use ccdeck from a terminal or over SSH
To use ccdeck from a terminal or over SSH, run npx ccdeck tui on that machine: one screen lists your Claude accounts and the sessions waiting on you, Enter switches accounts, a turns Auto-switch on or off, and + signs an account in from any browser.
You will
- See your Claude accounts and the sessions waiting on you on one screen
- Switch accounts, turn Auto-switch on or off, and sign an account in
- Check usage and sessions with one command
- Open the deck in your own browser over SSH
Before you start
- A terminal on the machine where Claude Code runs, at the machine or over SSH, with Node.js 18 or newer for
npx. - ccdeck 3.48.0 or newer running there: signing in and Auto-switch go through it.
npx ccdeckstarts it.
Steps
-
Open the accounts screen
Run
npx ccdeck tuiin the terminal. It fills the screen and stays up until you press q.Accounts lists each Claude account with its 5-hour and 7-day use and when each resets: ● marks the one in use, ⌂ Auto-switch’s home account. Under it, Waiting on you lists the sessions stopped on a permission prompt or a question, with the question. Press ? for every key.
More about the screen
It reads the accounts and sessions again every few seconds. It needs at least 40 columns and 12 rows, and from 120 columns the selected account’s detail sits beside the waiting sessions. It follows
NO_COLOR, and draws in plain characters where the console cannot show its lines.With no deck running it reads claude-swap’s store, says so at the top right, and d starts a deck in the background. It does not start, resume or stop agents.
-
Switch to another account
Move with ↑ and ↓, or the account’s slot number, then press Enter. Every running Claude Code session uses the new account from its next message, and the line above the keys says how many moved.
Press b to select the account Auto-switch would pick, then Enter to switch to it.
On an account whose login expired, Enter signs it in again instead of switching (step 4).
-
Turn Auto-switch on or off
Press a. The bottom edge of the Accounts box says Auto-switch on, with its threshold and next-account rule, or Auto-switch off.
The home account and the rule are set in the deck, as in Use your main Claude Code account first.
Auto-switch runs inside the deck. With none running, press d first.
-
Sign an account in from any browser
Press + to add an account, or Enter on one whose login expired, then Enter again for the sign-in link.
Open the link in any browser, your own computer’s included, and approve. The page then shows a code: paste it into the terminal and press Enter. The account you are using stays active.
Sign-in goes through the deck, so it needs one running. In a browser on the same machine, it finishes without a code.
-
Or ask with one command
Each prints its answer and exits:
npx ccdeck accountslists your Claude accounts with their 5-hour and 7-day use.npx ccdeck switch workswitches to the account with that slot number, e-mail or alias, or a part of one that names one account. With no account named, it shows a list to pick from.npx ccdeck switch --bestgoes where Auto-switch would.npx ccdeck usageshows every limit of the account in use.npx ccdeck sessionslists what each Claude Code and Codex session is doing, the ones waiting on you first.
More about the commands
They ask the deck that is running, so a switch takes the same route as Switch in the Claude accounts panel. With no deck,
accounts,switchandusageread and drive claude-swap’s store;sessionsandopenneed a deck.status,stopandlogsare--status,--stopand--logs.Every command but
tuitakes--jsonfor a script, and every one takes--portto name a deck. They exit 0 when done, 1 on a failure, 2 when the command line was wrong and 3 when no deck is running. A misspelled command is refused and starts nothing. -
Open the deck in your own browser
Over SSH,
npx ccdeck openopens nothing there and prints anssh -N … -L 14317:127.0.0.1:4317 …line instead. Run that line on your own computer and keep it open, then open the address it prints:http://127.0.0.1:14317for a deck on 4317.The deck still listens only on that machine’s 127.0.0.1: the tunnel is your SSH connection. Your end is not 4317, so it never lands on a deck of your own.
If something goes wrong
“ccdeck tui needs a terminal at both ends”
The command ran without a terminal, as in ssh host npx ccdeck tui. Add -t to that ssh, or open the SSH session first and run it at its prompt.
The screen says “too small”
Make the terminal at least 40 columns wide and 12 rows tall. A long sign-in link needs more rows: the screen says how many.
“needs a fresh sign-in” when you switch
That account’s login expired, and a switch would sign every running session out. Sign it in again, as in step 4, then switch.
“predates this command”
The deck running there is older than the command. npx ccdeck --new replaces it with the new version.
The ssh line exits at once
Another program on your computer holds port 14317. Change 14317 to a free port, in the line and in the address.
Something else? See Troubleshoot ccdeck: status, logs, port and hooks.