npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

claudecodex-cli

v1.0.13

Published

Manage multiple Codex and Claude Code logins as named sessions, with a live sticky dashboard of remaining 5-hour and weekly limits.

Readme

Claude / Codex Session Manager — Switch & Borrow Accounts

One keystroke to switch between all your Codex and Claude Code logins, see which account still has quota — and borrow a friend's Codex / Claude without ever knowing their password.

npm version node license


Both Codex and Claude Code keep only one active login at a time — log into a second account and the first is signed out. If you juggle multiple ChatGPT/Claude subscriptions (your own, a teammate's, a friend's), you're constantly re-logging in and losing your place.

claudecodex saves each login as a named session, lets you switch between them instantly, and shows a live dashboard of every account's remaining 5-hour and weekly limits — read straight from each provider's own usage API, so you see real numbers without switching first.

It can also borrow Codex / Claude from a friend: send them a link, they tap "Authorise" in their browser, and a scoped coding-tool token lands on your machine — without you ever getting their password or account access.

claudecodex dashboard

Install

No install (recommended to try):

npx claudecodex-cli

Global install — then use the short ccx command anywhere:

npm install -g claudecodex-cli
ccx

Installed globally, ccx checks npm for a newer version on startup and offers to update (you confirm; it never updates silently). Opt out with CLAUDECODEX_NO_UPDATE=1.

Requires Node ≥ 18. macOS and Linux. (Claude support reads the macOS Keychain / Claude's credentials file; Codex reads ~/.codex/auth.json.)

Quick start

ccx # pick Codex or Claude, then manage interactively
  1. Log into an account the normal way (codex login, or sign in to Claude Code).
  2. In ccx, press s to save it as a session (e.g. work).
  3. Repeat for your other accounts.
  4. Press b to jump to whichever account has the most quota — then run codex / claude.

Commands

Interactive (run ccx, or ccx codex / ccx claude):

| Key | Action | |----:|--------| | ↑/↓ enter | select / switch to a session | | b | switch to the best session (most 5h headroom, skips exhausted) | | g | get a new session — browser sign-in for another account | | s | save the current login as a session | | c | copy the selected session's token to the clipboard (to share) | | a | accept a token from the clipboard (paste a shared one in) | | r | remote link — generate a guide page your friend opens to share their session | | n d R | rename · delete · refresh live limits | | q | back to provider chooser (or quit) |

Scriptable (ccx <codex|claude> <command>):

ccx codex ls                     # dashboard with live limits
ccx codex save work              # save current login
ccx codex use work               # switch active login
ccx codex best                   # switch to the account with most quota
ccx claude refresh               # refresh every session's live limits
ccx codex get-session alice      # browser login → save a new account
ccx codex share work tok.txt     # write a shareable token file
ccx codex set work             # save a token from the clipboard (or pass it / @file / stdin)
ccx codex rename work old        # rename / delete
ccx codex delete old
ccx codex remote                 # generate a remote guide link for a friend
ccx claude remote                # same for Claude

Borrow Codex / Claude from a friend — without their password

If a friend has a ChatGPT Plus or Claude Pro subscription but doesn't use Codex / Claude Code themselves, you can borrow their session in seconds. You never get their password, email login, or account access — they simply authorise the coding tool in their own browser and a scoped OAuth token lands on your machine. Their ChatGPT/Claude conversations, account settings, and credentials stay completely private.

One-time setup (you): get a free ngrok account and set your authtoken:

export NGROK_AUTHTOKEN=your_token_here   # add to ~/.zshrc to make it permanent

Every time:

  1. In the TUI press r (or run ccx codex remote / ccx claude remote).
    A link is copied to your clipboard — send it to your friend on WhatsApp, iMessage, etc.
  2. Friend opens the link on any device. They see a 3-step guide that first explains exactly what is shared (the coding-tool access only) and what stays private (chats, account, password):
    • Step 1 — tap “Authorise Codex / Claude Code Access” and sign in on the provider's own page

    • Step 2 — copy what the provider shows after signing in. The guide includes a screenshot of exactly what to look for:

      Codex — the browser lands on a localhost:1455 error page; they copy the URL from the address bar:

      Codex callback URL in the address bar

      Claude — Anthropic shows an Authentication Code page; they tap Copy Code:

      Anthropic authentication code page

    • Step 3 — paste it into the form on the guide page and hit Submit

  3. The token lands on your machine automatically. The session is saved and named after their email. Friend sees “✅ All done!” and closes the page.

⚠️ A token grants full access to that account. Share only over trusted channels.

⚠️ One live session per account: the provider ends the previous session when the same account signs in again elsewhere. If a borrowed session shows “session ended,” re-run get-session or ask your friend to use remote again. Different accounts coexist fine.

Borrowing a session the manual way (no ngrok)

If you'd rather not use ngrok, you can still share sessions via token blobs:

# Friend runs:
ccx codex get-session            # browser login → prints a one-line token blob

# You run:
ccx codex set alice              # reads from clipboard (or @file / piped stdin)
ccx codex use alice && codex

In the TUI: press c on a session to copy its token, send it to your friend, they press a to paste and name it. Tokens are provider-tagged — a Codex token can't be imported into Claude.

How it works

  • A session is a snapshot of the provider's live credentials, stored under ~/.claudecodex/<provider>/ with 0600 permissions:
    • Codex~/.codex/auth.json
    • Claude Code → the Claude Code-credentials entry (macOS Keychain)
  • Switching restores a snapshot over the live credentials. The outgoing session is re-synced first, so rotated refresh tokens are never lost.
  • Switching mid-session: Claude Code hot-swaps, Codex needs a restart. A running claude session picks up the new account on its own. Codex loads auth.json once at startup and keeps it in memory (openai/codex#17041), so claudecodex warns you when it detects running codex processes after a switch. Your conversation isn't lost: close the running Codex, switch, then pick the chat back up under the new account with codex resume --last.
  • Live limits, per account, without switching:
    • Codex → chatgpt.com/backend-api/wham/usage (primary = 5h, secondary = weekly)
    • Claude → api.anthropic.com/api/oauth/usage (five_hour + seven_day)
    • Expired access tokens are refreshed transparently via each provider's OAuth refresh grant.
  • best drops exhausted accounts (a window ≥ 99% used, reset-aware), then picks the most 5-hour headroom, tie-broken by weekly headroom.

Nothing leaves your machine except the authenticated usage requests to each provider's own API.

Configuration

| Env var | Effect | |---|---| | CLAUDECODEX_HOME | Where sessions are stored (default ~/.claudecodex) | | CODEX_HOME | Codex home (default ~/.codex) | | CLAUDECODEX_NO_UPDATE=1 | Disable the startup update check |

Develop

git clone <repo> && cd claudecodex
npm install
npm run dev        # tsc --watch — rebuilds dist/ on every save
npm link           # exposes `claudecodex` and `ccx` globally from your checkout

Built with Ink. The dashboard is a pinned, live-updating panel (countdowns tick, rows re-sort by availability) — the same sticky-frame technique Claude Code uses.

License

MIT