Skip to content

About

Track shared Claude Max/Pro and ChatGPT Plus (Codex) quotas: each account's 5-hour and weekly usage, every member's allotment, and usage by model. Menu bar/tray app plus a self-hosted server.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

ShareCodex

ShareCodex

One subscription, many coders, no guesswork.
See how much of each shared Claude and ChatGPT plan is left — and who used it.

English | 繁體中文

Release GitHub downloads macOS | Windows | Linux Server image Stars

Download · Getting started · Run the server

When a few people share Claude Max/Pro, ChatGPT Plus and Google AI subscriptions, the provider tells you only one thing: how much of the whole account is gone. ShareCodex adds the rest — how much of each 5-hour and weekly window is left, how much each person is allotted, roughly how much each has used, and which models used it.

Each member runs a small menu bar (macOS) or system tray (Windows) app, and a command-line agent on Linux machines such as ones used over SSH. It reads the Claude Code, Codex and Antigravity logs already on the computer, asks the official CLIs which account is signed in, and syncs token counts to a server you host yourself.

Only coding-agent usage counts: Claude Code (including Claude Desktop's Code tab and Cowork), the Codex CLI, desktop app and IDE extension, and Antigravity's CLI (agy). Chat in Claude Desktop or on the web, ChatGPT web chat, and the Antigravity IDE, which encrypts its conversations, are not tracked. Antigravity accounts show their 5-hour Gemini and Claude quotas, or their recent usage until a quota reading arrives.

See it in action

Desktop popup, light Desktop popup, dark

Admin console overview Admin console accounts, dark

Public dashboard, dark Public dashboard usage

What it shows

Your own usage

The popup opens with your own usage across every account, for today and the last 30 days: total tokens, input and how much of it was cached, output, requests, and an estimated API-equivalent cost.

Every shared account at a glance

The popup lists each shared account with its 5-hour and weekly windows, how much of each is used, and when it resets. The numbers come straight from Claude Code, Codex and Antigravity; an Antigravity account has a 5-hour Gemini pool and a 5-hour Claude pool, which GPT-OSS also draws on. Accounts are listed in the server's order, the ones your computer is signed into first; Account order in Settings puts the most used 5-hour or weekly window first instead, and dragging a card by its grip arranges them your own way.

Who used what

Each member has a bar for their estimated usage and a tick mark at their allotment. Anyone past their share is marked over allotment. Quota used with no matching record from anyone is shown as unattributed instead of being pinned on someone. Under each member, their usage is split by the computer it came from. Click a member's name for their usage over 24 hours, 7 days or 30 days by account, model and device; Details beside your own totals opens yours.

Who is signed in where

Each account shows who is signed into it in Claude Code, Codex or agy right now, with You on the account your own computer uses. Someone drops off the list about 15 minutes after they sign out or their computer goes offline. Claude Desktop signs in on its own, so it counts separately: it shows up on the account it last used for Claude Code, for 15 minutes after that use.

Which models used it

Each window also breaks usage down by model — requests, tokens, and an estimated share — so you can tell whether the week went to Opus or to a long run of Sonnet. Models are listed by estimated share, which weighs tokens by price; Model order in Settings lists them by tokens instead.

Usage over time

A chart under the window switch shows each model's tokens over the last 5 hours or 7 days, a point every 5 minutes (every 3 hours on the weekly chart). With Cumulative on, it draws running totals that start again from zero at each reset, marked by a dashed line with its time, so the previous window stays in view after a reset; with it off, the tokens used in each span. Switch it between everyone and a single member, and hover to read the values. Full chart detail in Settings draws every minute (every half hour on the weekly chart) instead.

Beneath it, short bars stack each model's tokens in every hour (every day on the weekly chart) on the same time axis; an hour or day the chart starts or ends partway through is a narrower bar. The bars follow the member switch, not Cumulative.

Third-party models

Claude Code and Claude Desktop can be pointed at other vendors' models through a gateway. Those requests are recorded against the account the client used and shown as dashed lines on its chart and in a separate Third-party models list, with bars on the same scale as its own models, but they never count toward the quota, the estimates or the allotments. The list covers the same span as the chart, not only the current window. Models used through OpenCodex or Ollama (ollama launch claude) are tagged OCX or Ollama.

ChatGPT used from Claude Code or Claude Desktop through OpenCodex does draw on a ChatGPT subscription, so it counts on the Codex account the computer is signed into, as its own OCX row. When OpenCodex's own request log shows another account in its pool served a request, that request stays third-party.

Joining takes one link

An admin creates a single-use join link in the web console; a member who has joined can create more for their other computers. The member pastes it into the app, signs in to the shared account in Claude Code, Codex or agy as usual, and is added to that account automatically.

Pin an account to the screen

The pin in an account's corner puts that account in a small window of its own that stays on top of other windows. Drag it by its title row to move it; it reopens where you left it the next time the app starts. Its × closes it and unpins the account. Leaving an account is under Accounts in Settings.

Share it as an image

The button to the left of Refresh copies the whole popup, full length, as an image ready to paste. Email addresses in it are replaced with Account 1, Account 2 and so on.

Runs quietly in the background

The app keeps working when the server is unreachable and uploads when it's back. It can start at login, refreshes when you open it, and never opens a terminal window.

Admin in the browser

Members, join links, account names, allotment weights and devices are all managed at /admin/ on your server. No shell access to the container is needed. The console shows everything the popup does for every member, plus everyone's usage over 24 hours, 7 days or 30 days by member, account and model. Click a member on the Usage page or in Members for theirs, down to each device.

A dashboard anyone can open

An admin can publish a read-only dashboard at /dashboard: each account's windows, usage chart, members' estimated usage and models, refreshed every minute; on a wide screen each window's chart sits beside its lists. Like the popup's, its charts switch between tokens per span and running totals with Cumulative. Accounts follow the order set in the console, or put the most used 5-hour or weekly window first. Its Usage page, at /dashboard/usage, has everyone's usage by member, account and model over 24 hours, 7 days or 30 days, and each member's by account and model. Its Capacity page, at /dashboard/capacity, shows the same capacity analysis as the console, without plan notes. On a phone, Chrome can install the dashboard as an app of its own. It leaves out email addresses and device names; an account still named by its email shows as Account 1, Account 2 and so on. It is off until turned on under Settings.

Privacy by design

  • Only token counts, model names, timestamps and quota percentages leave the computer.
  • Prompts, responses, working directories and project paths are never read into the ledger or uploaded.
  • Accounts are identified by a one-way hash; the server keeps only a masked email such as al***@example.com so admins can tell accounts apart.
  • Claude Code's own sign-in is read — from the macOS Keychain, or from .credentials.json where there is none — and used for one thing: asking Anthropic for that account's rate limits. Accounts you add under Claude quota get ShareCodex's own sign-in, kept in the OS credential store (an owner-only file on Linux) and used the same way. agy's sign-in is read from the OS credential store to ask Google for that account's quotas; it is never refreshed, and macOS asks before the first read. No token is ever uploaded, logged, or written to the ledger. Everything else about identity comes from claude auth status, Codex's own app server, the folder names of Claude Desktop's Claude Code sessions, and the active account in ~/.gemini/google_accounts.json for agy.
  • The server is yours. There is no third-party service, analytics or tracking.

Getting started

  1. Get a join link from whoever runs your ShareCodex server.
  2. Install the app (see Get the app) and open it from the menu bar or system tray.
  3. Paste the join link. Each of your computers needs its own link, and all of them count as you. Once one computer has joined, get a link for the next from Settings › Add device or sharecodex invite. On Linux, see Linux and SSH machines.
  4. Sign in to the shared account in Claude Code, Codex or agy as usual. The account appears once the app sees it.
  5. Get Claude's quota. Claude Code's own sign-in is read automatically. To cover an account used only in Claude Desktop, add it under Settings › Claude quota › Add account (on Linux, sharecodex claude-login). statusLine capture in the same place also reads it from Claude Code sessions; your existing statusLine keeps working, and turning it off restores your original setting.

Usage from before you joined is not uploaded.

Run the server

Requires Docker. The server does not terminate TLS; put it behind a reverse proxy such as Caddy, nginx or a Cloudflare Tunnel.

Download sharecodex-server-compose.zip from the latest release. It runs the published image ghcr.io/koukeneko/sharecodex-server (linux/amd64 and linux/arm64), pinned to that release.

unzip sharecodex-server-compose.zip && cd sharecodex-server-compose
cp .env.example .env    # set POSTGRES_PASSWORD, PUBLIC_URL and ADMIN_PASSWORD
docker compose up -d

PUBLIC_URL is the address members reach the server at; it appears in join links. To upgrade, set SHARECODEX_VERSION in .env to the new release (or use a newer bundle) and run docker compose up -d again.

Then open PUBLIC_URL/admin/ and sign in with ADMIN_PASSWORD:

Page What you do there
Overview Everyone's usage over 24 hours and 30 days; every account's windows with who is signed in, a usage chart, each member's allotment and estimated usage by device, and usage by model, including third-party models
Usage Tokens, requests and estimated cost by member, account and model over 24 hours, 7 days or 30 days; open a member for theirs by account, model and device
Members Add members, create single-use join links, see each member's last sync and 30-day usage, and delete members along with their devices and usage
Accounts Rename accounts, drag them into the order the console, dashboard and popup list them in, set each member's allotment weight, and delete accounts along with their usage
Devices See which account each device is signed into, its 30-day usage and last sync, and revoke devices
Settings Publish the dashboard at PUBLIC_URL/dashboard, or preview it first; a signed-in admin sees it before it is published

Admin sessions are kept in memory, so restarting the server signs the admin out. Once the dashboard is published, PUBLIC_URL itself opens it instead of the console.

Compatibility

  • Desktop: macOS (Apple silicon and Intel) and Windows (x64 and ARM64)
  • Command line: Linux (x64 and ARM64), including machines used only over SSH
  • Agents: Claude Code with a Claude Pro/Max subscription; Codex CLI, desktop app and IDE extension with a ChatGPT subscription; Antigravity's CLI (agy) with a Google account
  • Server: any Docker host, linux/amd64 or linux/arm64
  • Interface: Traditional Chinese

Usage routed to other vendors' models — Claude Code through a gateway, or Codex with a third-party model provider — is ignored, because it doesn't draw on the shared subscription.

Get the app

macOS, with Homebrew:

brew install --cask koukeneko/tap/sharecodex

Windows, with Scoop:

scoop bucket add koukeneko https://github.com/KoukeNeko/scoop-bucket
scoop install koukeneko/sharecodex

Without Homebrew or Scoop, use the install script. It downloads the latest release, checks its SHA-256 and installs the app in /Applications on macOS, sharecodex in ~/.local/bin on Linux, or the app in %LOCALAPPDATA%\Programs\ShareCodex on Windows. Run it again to update.

curl -fsSL https://raw.githubusercontent.com/KoukeNeko/ShareCodex/main/install.sh | sh   # macOS, Linux
irm https://raw.githubusercontent.com/KoukeNeko/ShareCodex/main/install.ps1 | iex       # Windows

Or download ShareCodex-macos-universal.zip, ShareCodex-windows-amd64.zip or ShareCodex-windows-arm64.zip from the latest GitHub Release. The macOS app is signed with a Developer ID and notarized by Apple. The app checks GitHub for new releases and tells you when one is out; it never installs anything by itself.

Updating

macOS — refresh the tap first, or Homebrew may not see the new version yet:

brew update
brew upgrade --cask sharecodex

Windows — quit ShareCodex from the tray icon first, since Windows won't replace a running app:

scoop update
scoop update sharecodex

The first command refreshes the bucket; the second installs the new version. If you installed with the install script, run it again instead. Your settings, join and statusLine capture carry over.

Linux and SSH machines

Linux has no tray app. The sharecodex command runs the same agent in the background, so usage on a machine you reach over SSH adds up with your other computers under your name.

brew install koukeneko/tap/sharecodex-cli                # Homebrew on Linux
sharecodex join 'https://sharecodex.example.com/join/…'  # from Settings › Add device on your Mac
sharecodex claude-login                                  # Claude's quota, for accounts not signed in here
sharecodex statusline-capture on                         # Claude's quota from Claude Code sessions
sharecodex autostart on                                  # systemd user service
loginctl enable-linger                                   # keep it running after you log out
sharecodex status

Without Homebrew, use the install script above, or download sharecodex-linux-amd64.tar.gz or sharecodex-linux-arm64.tar.gz from the latest GitHub Release and put sharecodex on your PATH, for example in ~/.local/bin. SSH sessions usually have no keyring, so the device token is kept in ~/.config/ShareCodex with owner-only permissions. autostart on copies your current PATH into the service so it finds claude and codex; run it again if they move.

To update, run brew update && brew upgrade sharecodex-cli (or rerun the install script, or replace the binary), then sharecodex autostart on to restart the service.


Technical reference

How usage is measured

  • Claude Code — ~/.claude/projects/**/*.jsonl transcripts. Each response is counted once by message ID and request ID, keeping the largest output count (earlier lines carry partial counts while streaming). Resumed sessions that copy earlier requests into a new file are counted once.
  • Codex — ~/.codex/sessions and archived_sessions rollouts. Per-request records are used when present; older files fall back to the difference between cumulative totals.
  • Antigravity — ~/.gemini/antigravity-cli/conversations/*.db, agy's SQLite conversation databases. Each finished request's token counts are read from its generation metadata, once per conversation step; failed requests carry none and are skipped. Prompts and responses are not read.
  • Quota — Codex reports its windows in the rollouts and through codex app-server; Claude's come from the statusLine input, which the app captures through a small shim, and from Anthropic's usage endpoint, read with Claude Code's own sign-in and with the accounts added to ShareCodex. That endpoint needs no session, so an account used only through Claude Desktop reports its limits too. Antigravity's pools come from Google's Cloud Code endpoint, read with agy's own sign-in.
  • Claude Desktop — its Code tab writes to the same transcripts, and Cowork keeps its own under Desktop's local-agent-mode-sessions. Desktop signs in separately from the claude CLI, so its usage is matched to the organization in the folder holding the session's metadata (claude-code-sessions/<account>/<organization>). Desktop also lists sessions started in the terminal; those keep the CLI's account. Sessions whose metadata was deleted, and Desktop set up for third-party inference, are skipped.
  • Account — each other event is matched to the account the device was signed into at that moment.

How shares are estimated

Each member's allotment is weight ÷ sum of all members' weights on that account. All weights default to 1; a weight of 0 removes a member from the allotment but keeps their usage.

Providers report only the percentage used for the whole account. Each person's — and each model's — part is estimated from their share of API-equivalent cost within the same window, so it is always labelled as an estimate. The prices in internal/attribution/pricing.json set only the relative weight between models; they are not a bill.

Development

Requires Go 1.27, Node 24, pnpm, and the Wails CLI (go install github.com/wailsapp/wails/v3/cmd/wails3@v3.0.0-beta.25).

go test ./...                     # server integration tests also need TEST_DATABASE_URL
wails3 task dev                   # run the desktop app in development mode
wails3 task package VERSION=0.1.0 # package the app (bin/ShareCodex.app on macOS)
go run . scan                     # print local daily token totals without writing to the database

Set SHARECODEX_HOME to use another data directory, for example to simulate several devices on one computer. To build the server from a checkout, run docker compose -f docker-compose.yml -f docker-compose.build.yml up -d --build in deploy/.

Dependencies point inward only:

domain  ←  provider adapters  ←  client / server  ←  Wails / HTTP / SQL / OS

internal/account, identity, usage, quota and attribution must not depend on storage, networking, the desktop framework or provider code; internal/architecture_test.go enforces this. Design notes and verification records are in docs/plan.md and docs/spikes.md (Traditional Chinese).

Releases

Pushing a v* tag runs .github/workflows/release.yml. It builds a universal macOS .app, Windows .exe files for x64 and ARM64, the Linux CLI and server binaries and the Docker Compose bundle, pushes the server image to ghcr.io/koukeneko/sharecodex-server, and creates a GitHub Release with SHA256SUMS. It then runs .github/workflows/packages.yml, which updates the cask and the Linux formula (sharecodex-cli) in KoukeNeko/homebrew-tap and the manifest in KoukeNeko/scoop-bucket; run it by hand to backfill a release.

install.sh and install.ps1 download release assets by name and check them against SHA256SUMS, so renaming an asset breaks them.

Code signing runs only when its repository secrets are set. Without them, the macOS app is only ad-hoc signed and users must allow it the first time in System Settings › Privacy & Security.

Secret Purpose
MACOS_CERTIFICATE_P12_BASE64 (base64 of a .p12 containing a Developer ID Application certificate and its key), MACOS_CERT_PASSWORD Developer ID signing
ASC_KEY_P8_BASE64 (base64 App Store Connect API key .p8), APPLE_API_KEY_ID, APPLE_API_ISSUER_ID Notarization
WINDOWS_CERT_PFX (base64), WINDOWS_CERT_PASSWORD Windows code signing
HOMEBREW_TAP_TOKEN, SCOOP_BUCKET_TOKEN (fine-grained tokens with Contents read/write on the tap and the bucket) Publishing packages; required

CI Go Wails Svelte PostgreSQL

Support

If ShareCodex is useful to you, you can support development:

Buy Me a Coffee

About

Track shared Claude Max/Pro and ChatGPT Plus (Codex) quotas: each account's 5-hour and weekly usage, every member's allotment, and usage by model. Menu bar/tray app plus a self-hosted server.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages