Skip to main content

CTally

A floating status light for your Claude Code sessions on macOS and Ubuntu: whose turn is it? Glance over instead of tabbing back to the terminal.

pipx install ctally
ctally setup --tmux

The name comes from the tally light, the lamp on a broadcast camera that shows it's live, and from tallying up your sessions.

CTally with one session, three sessions, a list of six with each one's context window, a question waiting to be answered, subagents at work and the usage limits, and the list folded

Every session gets a hexagon whose glyph and color say what it's doing:

State Meaning
▶ cyan working Claude's turn: it's working, or its subagents or a workflow still are
⏸ amber waiting your turn: a permission prompt, a question or a plan to approve, or it's waiting for input
⏸ amber limit stopped by your plan's usage limit; it turns to done when the limit resets
✓ green done your turn: the turn finished, and it stays here until your next prompt
• slate idle nothing running

And a small gauge beside each one says how full its context window is: 62%, turning amber at 75% and red at 90%, so you see a session nearing compaction before it gets there. More below.

Features

  • Floats above everything without ever taking keyboard focus; on macOS on every Space and beside full-screen apps too.
  • One to three sessions show as big badges; four or more become a compact list with each session's name and directory. Past 16 rows (or the screen's height) it scrolls, with a scroll bar that marks the sessions waiting on you. Session names come from /rename, or else the title Claude gave the session.
  • Sees subagents and workflows: while a session's agents run, its row says how many and what they're up to (4 agents · Verify), with a progress bar for a workflow, and its badge carries the count. More below.
  • Answer without switching: a session waiting on you says what for, a tool to allow (Allow Bash(npm publish)?), a question or a plan, and in tmux you answer it from CTally with the choices Claude Code shows. More below.
  • Your plan's usage limits: the session, the week, and each model's week, as bars with when each resets, kept fresh after every reply and asked of Anthropic every few minutes, as /usage does. More below.
  • How full each session's context window is: a small gauge on every row and badge fills as the conversation grows, turning amber at 75% and red at 90%, before Claude Code compacts it. These are Claude Code's own numbers. More below.
  • Your week with Claude: ctally stats adds up, day by day, how long Claude worked and how long it waited on you, your prompts, finished turns and limit hits. More below.
  • Built for tmux: every row shows its pane, a click switches to it, prefix + J jumps to the session that needs you, and the counts can sit in tmux's status line. More below.
  • Click a row to bring that session's terminal forward: the exact tmux pane, and on macOS the exact Terminal tab.
  • Fold the list down to a bar of counts with the chevron.
  • When a turn finishes, its row washes green and its mark bounces once; then everything holds still.
  • Menu bar (or top bar) icon to show or hide CTally. Off stays off across restarts, and the app sits idle with no timers but the snapshots', if they're on.
  • Settings window with an on/off switch, an opacity slider (80% by default), switches for the usage limits, asking Anthropic for them, and the snapshots, and how often snapshots are taken and how long they're kept.
  • Snapshots for after a restart: every two minutes (or as often as you like), your tmux sessions and the Claude Code sessions in them, and a Restore Sessions item in the menus to bring them back. More below.
  • Silent: no sounds, no notifications, no Dock icon.
  • One Python package, installed with pipx: the same Qt app on macOS and Linux, and a ctally command for the terminal and tmux.

The settings window

Subagents and workflows

When a session hands work to subagents, or runs a whole workflow of them, CTally follows along:

  • The row grows a line about its agents: how many are running, and what they're doing. For a workflow that's the phase it has reached (4 agents · Verify), with a progress bar of its agents finished out of those started so far (12/16; the total grows as each phase sets off more). For a single agent it's the task it was given (1 agent · Find callers of parseConfig).
  • Click that line for a closer look: a workflow's phases, each with its own progress bar and the agents still at work in it (Verify verify:schema, verify:queries 0/4), or each agent and what it's doing (Explore · Find callers of parseConfig). Click again to fold it away. Hover over a badge for the same.
  • The badge carries the count (⚙ 4) on its shoulder.
  • The session stays working until its agents are back. A session that sends agents off in the background finishes its own turn at once, and would otherwise look done for as long as they run, sometimes hours. CTally keeps it cyan until they return and Claude has taken in their results, and prefix + J leaves it alone till then.
  • Stopping by hand counts. Press Esc, dismiss a question, or kill agents or a workflow, and Claude Code runs no hook to say so. CTally reads it from the transcripts instead: the session shows done within a couple of seconds (or working again, if you dismissed a question while its agents were still at it), and the agents you stopped leave the agents line.

ctally list shows the count too. This needs the subagent hooks that ctally setup adds; if you set up CTally before they existed, run ctally setup again and restart your sessions.

Answering from CTally

A session waiting on you says what for, on a line under its row (or on its caption, among the badges):

  • a tool to allow, the way Claude Code shows it: Allow Bash(npm publish)?, Allow Write(src/db.py)?
  • a question Claude asks you: Which colour do you prefer?
  • a plan to approve: Approve the plan: Add a dark mode toggle

Hover over the session for more: the whole command, every question and its options, the plan's first lines. The session stays waiting for as long as that's on screen, even while its subagents or a workflow work on behind it.

In tmux you can answer it from CTally. Click that line, or right-click the session, and pick from the choices Claude Code is showing: 1. Yes, 2. Yes, and don't ask again…, 3. No. CTally reads them off the session's tmux pane, just as you'd see them, and types your pick there, after checking the same choices are still on screen, so a key never lands anywhere else. Choices that leave you something to type (Type something, Tell Claude what to change) bring the terminal forward for it. A form of several questions takes one answer at a time, then its review.

Outside tmux, the menu shows what's asked and takes you to the terminal to answer it.

Context window

Every session shows how much of its context window it has used: a little pie that fills clockwise, and the percentage beside it.

  • In the list it ends the row's directory line (webapp:0.0 ◔ 34%); on a badge it sits on the lower-left shoulder.
  • Colours: quiet grey while there's room, amber from 75%, red from 90%. Claude Code compacts a conversation when it's nearly full, so an amber or red session is one to wrap up, or to /compact yourself at a good moment.
  • Hover over the session for the tokens: Context 62% full: 124k of 200k tokens. A 1M-token window shows as of 1M, and fills that much more slowly.
  • ctally list has it as a column, between the agents and the project.

The numbers are Claude Code's own: after every reply it hands the status line each session's context_window (its size, what's in it, the share used), and CTally's status line keeps the latest per session in ~/.claude/ctally.d/.status/. A session shows its gauge from its next reply once that status line is in place: after upgrading from 0.3.2 or earlier, run ctally setup again (sessions already running pick it up without a restart). With --no-statusline there's no gauge.

Claude Code counts from the replies it has had, so a session you've just reopened on an earlier conversation (claude --resume, --continue) reports nothing in its window until its next reply. CTally shows no gauge for it till then, rather than a 0% that isn't so.

Usage limits

CTally shows your plan's usage limits the way Claude Code's /usage does: the current session (the five-hour window, on a plan that has one), the week across all models, any per-model weekly limit (Fable, say), and usage credits if you've switched them on.

  • The list gives every limit a line between the sessions and the count bar: a bar, the share used, and when it resets (in 1h 48m, Sat 10 pm).
  • The folded bar and the badges carry two small meters, the session (5h) and the week (7d).
  • A plan with no session limit shows the week alone. Once Claude Code's replies stop giving a five-hour window, an empty one it still has on file isn't shown.
  • Hover over any of them for the details, and how fresh they are. The menu bar (top bar) icon's menu lists them too.
  • Colours: a bar turns amber at 75% and red at 90%. Numbers more than an hour old are dimmed.
  • A model's week is asked for. Replies bring only the session and the week, and Claude Code saves a model's week (Fable's, say) only when you run /usage. So CTally asks Anthropic for all of them, the way /usage does, every five minutes while Claude Code is in use: see Privacy. Switch that off (Exact usage in Settings), or while it can't get through, and a model's week stays as /usage last had it. Once that's more than an hour behind the rest, its line is dimmed and says so (13 h ago, or as of 9:33 am in the menu and ctally usage).
  • Hitting a limit shows it at 100% at once, and the sessions it stopped as limit. A prompt you send before it resets doesn't make them look busy, because it can't get through. A limit reset early starts a new window, and the meter follows it from the next reply.
  • More than one account: the limits are the account's you're signed in to. Sign in to another, or swap accounts under the sessions that are running (with a tool like claude-swap), and within a couple of seconds the meters are that account's, as CTally last saw them: nothing to wait for if you've used it before, and its first reply if you haven't. Switch back and the first one's are there again.
  • tmux's status line gets 5h 71% 7d 49% after the counts, coloured the same way, and ctally usage prints the lot:
$ ctally usage
Current session            ███████░░░  71%  resets 7:30 pm (in 2h 25m)
Current week (all models)  █████░░░░░  49%  resets Sat Oct 10, 10 pm
Current week (Fable)       ░░░░░░░░░░   0%  resets Sat Oct 10, 10 pm
Updated just now

Where the numbers come from: Claude Code passes the session and week limits to its status line after every reply, so ctally setup adds a status line that hands them to CTally and shows nothing itself (a status line you already had keeps showing; CTally's runs it). Everything else comes from asking Anthropic, as /usage does: the app asks every five minutes, while its limits are on screen and Claude Code has replied since the last answer (or that answer is an hour old), and ctally usage asks when what CTally has is five minutes old. The copy of the /usage numbers Claude Code keeps in ~/.claude.json counts too, when it's the newer. Limits apply to Pro, Max and Team plans; with an API key there are none to show.

Claude Code doesn't say which account a session's numbers are for, and a session keeps handing over the ones from its last reply, hours later and accounts later. So CTally takes a session's numbers only when it has just had a reply, keeps the latest for each account apart, and tells the accounts by their week: every account's week ends at its own time. Numbers from a session that hasn't replied since you changed accounts, or since a limit was reset, change nothing.

Turn the limits off with the switch in Settings, or right-click → Hide Usage Limits. That hides them from tmux too, and the app stops asking for them. Exact usage in Settings stops the asking alone: then a model's week is as new as your last /usage. ctally setup --no-statusline leaves the status line out; the session and the week then refresh only as often as CTally asks, or Claude Code refreshes its copy.

Your stats

ctally stats adds up the last week (or --days 30) from a small history CTally's hook keeps:

$ ctally stats
             working  waiting on you  prompts  turns  sessions  limit hits
Thu Oct 22    4h 10m             12m       41     38         6           -
…
Today         1h 43m              2m        3      3         2           -
Last 7 days  21h 36m          1h 05m      284    261        31           1

Claude worked 21h 36m in all, with up to 6 sessions at once (Tue 3:40 pm); something was working for 11h 20m.
You answered what it asked in 48s, and came back to finished turns in 3m (medians).
History since Oct 22.
  • working adds up every session's time, so sessions running side by side count twice; the line under the table says how long something was working.
  • waiting on you is time a session sat on a permission, a question or a plan. Time after a finished turn isn't counted there: that's your turn, not Claude being stuck. How soon you got back to it is the median at the bottom (only within two hours; longer, and you'd moved on).
  • With nothing heard from a session, a stretch counts for so long and no more: an hour working, half a day waiting on you. Longer than that the computer was asleep, or the session's turn was stopped with nothing to tell the hook. That goes for a session still running, too, so a day's numbers don't shrink later.
  • --json gives the same, with times in seconds.

The history starts once the hook from 0.3.3 is set up (ctally setup, then restart your sessions), and keeps 90 days.

Built for tmux

Running a dozen Claude Code sessions across tmux sessions and split panes is exactly what CTally is for. It knows where each one lives, because tmux leaves TMUX and TMUX_PANE in the environment of everything started inside it.

  • Every row shows its pane. webapp:0.1 is tmux session webapp, window 0, pane 1, and it sits next to the directory, so two sessions in the same folder are easy to tell apart.
  • Click a row and tmux switches to that exact pane. Then the Terminal tab attached to that tmux session comes forward, or a new Terminal window attaches to it if no tab shows it.
  • prefix + J jumps to the session that needs you, without touching the mouse: waiting sessions first, then finished ones, longest-waiting first, passing over those stopped by the usage limit. Press it again for the next one.
  • The counts sit in tmux's status line (!1 ▶2 ✓5: waiting, working, done), and they change the moment a session does. Your plan's session and week usage follow them (5h 71% 7d 49%).

Turn on the key and the status line with:

ctally setup --tmux

This adds a marked block to ~/.tmux.conf and applies it to your running tmux at once. The file is backed up first, and ctally uninstall takes the block out again. To set it up by hand instead:

bind-key J run-shell -b "'$HOME/.local/bin/ctally' jump '#{pane_id}' '#{client_name}' '#{socket_path}'"
set -ag status-right ' #($HOME/.local/bin/ctally status --tmux)'
set -g status-right-length 80

The same ctally command works in any shell (it's installed to ~/.local/bin):

$ ctally list
waiting  webapp:0.0       -         34%  webapp                   5f3c…
done     webapp:0.1       -         81%  webapp                   9a1e…
working  api:0.0          4 agents  62%  api                      c27d…
$ ctally status
!1 ▶1 ✓1
$ ctally usage         # your plan's usage limits
$ ctally stats         # the last week: Claude's time and yours
$ ctally jump          # inside tmux: go to the session that needs you

Snapshots, for after a restart

Switch on Snapshot Sessions in CTally's menus (or Snapshots in its settings) and every two minutes (or as often as you set) it notes your tmux sessions: their windows and layouts, each pane's folder, and the Claude Code session in it with the options it was started with, or the background job it shows. After a restart, the menus offer Restore Sessions (Mon 10:14 pm): it makes the tmux sessions that aren't running, lays them out as they were, and resumes each Claude Code session in its pane (claude --resume <id>), or attaches to its background job again (claude attach <job>). Their rows turn up in CTally as they start.

  • Only what's missing is restored: a tmux session of the same name that's running is left alone, and a Claude Code session already running elsewhere is typed into its pane but not started. A tmux session that can't be made is left out, and the rest are restored.
  • The options it was started with come back with a session (--dangerously-skip-permissions, --model, a system prompt), not the ones that pick a session, nor a prompt, which would be sent again. An option CTally doesn't know, followed by something that could be its value or a prompt, is left out.
  • Never Claude Code in the wrong folder. A session whose folder isn't there yet, on a disk still being mounted, is waited for for up to five minutes, by its own tmux session only: the others are restored at once. If the folder never comes, or has been deleted, the tmux session is made all the same, with cd <folder> && claude --resume <id> typed into that pane and not started: press Return once the folder is back. A plain shell whose folder is gone opens in the nearest one above it.
  • Not yet, or gone? A folder may yet come when it's on one of the computer's own disks that isn't mounted (as /etc/fstab lists them), or under where disks are put (/Volumes, /media, /run/media, /mnt) with no disk mounted on the way down to it. Otherwise it's taken as deleted, and isn't waited for. Only what's mounted is asked: no folder of yours is looked into for this.
  • The snapshot it restores is the newest from before the computer started (the ones taken while it came up are of nothing much) with a tmux session that isn't running now. Once you've restored, it's the newest.
  • Kept for three days (or as many as you set), and a snapshot the same as the last isn't saved again. The newest from before the last restart stays however old it is, so a week switched off doesn't lose it.
  • How often, and for how long: in CTally's settings, under Snapshots, Every takes one every 1 to 60 minutes (2 by default) and Keep for keeps them 1 to 30 days (3 by default). A new time between them counts from now; with fewer days to keep, the older snapshots go when the next one is saved. ctally snapshot save keeps them as long as the settings say, too.
  • They're ccsnap's snapshots, in the same place and form (~/.local/state/ccsnap/snapshots, on macOS ~/.ccsnap/snapshots), so if you used ccsnap, its snapshots are there to restore. Switching CTally's on switches ccsnap's own timer off (its systemd timer or launchd agent; its files stay, for ccsnap auto on).
  • Snapshots go on while CTally is hidden; quitting it stops them.

From the shell:

$ ctally snapshot list            # newest first; * marks the one restore picks
$ ctally snapshot restore --dry-run
$ ctally snapshot restore [N]     # that one, or number N from the list
$ ctally snapshot save            # one now

Requirements

  • macOS 12 or later, or Ubuntu 22.04 or later (other Linux desktops should work too; see Ubuntu)
  • Python 3.9 or later and pipx. Qt comes ready-built for each system, and the newest Python can be ahead of what's built for an older one: macOS 12 runs CTally with Python up to 3.13, macOS 13 up to 3.14, and macOS 14 or later, Ubuntu 22.04 or later and Windows up to 3.15. If pipx's own Python is newer than yours takes, name one: pipx install --python python3.14 ctally.
  • Claude Code

Install

pipx install ctally
ctally setup            # or: ctally setup --tmux

pipx puts CTally in an environment of its own, with Qt (PySide6, about 100–400 MB depending on the platform), and the ctally command in ~/.local/bin. Then ctally setup does four things:

  1. Copies the hook and status line scripts to ~/.claude/hooks/ (ctally.sh, ctally-statusline.sh).
  2. Adds the hooks and the status line to ~/.claude/settings.json. It merges with your existing settings and backs the file up first. A status line you already had is kept, and still shows.
  3. Starts CTally at login: a LaunchAgent on macOS, an autostart entry (~/.config/autostart) on Linux.
  4. Starts CTally now.

Restart any Claude Code sessions that were already running so they pick up the hooks.

Option Effect
--tmux also set up tmux: the prefix + J jump key and status-line counts (details)
--no-hooks leave ~/.claude/settings.json alone (add the hooks yourself; see below)
--no-statusline no status line: the usage limits refresh only when Claude Code refreshes them
--no-autostart don't start CTally at login
--no-launch set up without starting CTally now

To upgrade: pipx upgrade ctally, then ctally setup again. It restarts CTally and keeps your preferences. For the latest commit, before it's released: pipx install --force git+https://github.com/JinyuJinyuJinyu/ctally.git (or, keeping the Qt you have, pipx runpip ctally install --no-deps --force-reinstall git+https://github.com/JinyuJinyuJinyu/ctally.git), then ctally setup. Its version ends in .dev0, and pipx upgrade leaves it until the next release.

Upgrading from the Swift version (CTally.app, installed with ./install.sh): remove the old ctally script first, since pipx won't replace a file it didn't put there: rm ~/.local/bin/ctally. Then install as above. ctally setup quits and removes ~/Applications/CTally.app and its login item, and keeps your opacity, fold setting and position.

Ubuntu

sudo apt install pipx libxcb-cursor0
pipx ensurepath          # then open a new terminal
pipx install ctally
ctally setup --tmux

libxcb-cursor0 is the one library Qt needs that a desktop install of Ubuntu lacks.

  • Wayland (Ubuntu's default) lets no app keep itself on top or choose where its window goes, so CTally runs through XWayland, which allows both. That happens on its own; you don't need to switch sessions.
  • The top-bar icon uses Ubuntu's AppIndicator support, which is on by default. A click opens its menu; a double click opens Settings, and another closes it. On a desktop without a tray, right-click the indicator itself for the menu.
  • Clicking a session switches tmux to its pane, and opens a terminal on that tmux session if none shows it. Raising the terminal's window works on X11 with xdotool installed (sudo apt install xdotool); under Wayland no app may raise another's window, so bring the terminal up yourself. prefix + J needs neither.

Using it

To Do this
Move it Drag it anywhere. It remembers the spot and grows left from there, and away from the nearer screen edge: up from the bottom half of the screen, down from the top half, where the list unfolds downward.
Go to a session Click its row (or its badge).
See what a session's agents are doing Click the line about its agents; again to fold it.
Answer a session waiting on you Click the amber line saying what it asks, or right-click the session, and pick a choice. In tmux.
Jump to the session that needs you In tmux, press prefix + J (set up by ctally setup --tmux). Again for the next one.
Fold or unfold the list Click the chevron on the count bar, or right-click → Fold List.
Hide or show it Use the hexagon in the menu bar (top bar on Ubuntu), or right-click → Hide CTally.
Change opacity Menu bar → Settings…, or right-click → Settings…
See your usage limits Hover over them. Hide them with right-click → Hide Usage Limits, or in Settings.
Take snapshots for after a restart Right-click → Snapshot Sessions (or the menu bar's), or Snapshots in Settings, where Every and Keep for set how often and for how long.
Bring your sessions back after a restart Right-click → Restore Sessions, or ctally snapshot restore.
Start or stop it ctally run starts it; Quit in its menu stops it.
Name a session Run /rename my-name in Claude Code. CTally picks the name up within seconds.

The first time you click a session on macOS, macOS asks whether CTally (shown as Python, which runs it) may control Terminal. Allow it so CTally can bring the right tab forward. You can change this later in System Settings → Privacy & Security → Automation.

How it works

Claude Code ──hooks──▶ ~/.claude/ctally.d/<session id> ──read 2×/s──▶ ctally run
            ──status line──▶ ~/.claude/ctally.d/.usage/…  ───┤
            ──its own list──▶ ~/.claude/sessions/<pid>.json ─┘

Two pieces, connected by a folder:

  1. Hooks. ctally.sh (in src/ctally/hooks/) runs on Claude Code events and writes one small file per session: working <pid> <project>.

    Event State written
    UserPromptSubmit working
    PreToolUse working (a tool is about to run); not while another part of the session has a question up
    PostToolUse / PostToolUseFailure working (back to work after a permission prompt), once it's the tool that was asked about
    PermissionRequest waiting, the moment a permission, a question or a plan to approve is on screen; what's asked goes in ~/.claude/ctally.d/.asks/<session id> until it's settled
    Stop done, or still working if subagents or a workflow run on in the background
    StopFailure limited when the usage limit stopped the turn; waiting for a login or billing problem; else done
    Notification waiting (a permission prompt still open); idle input after a turn that never ended, as Esc leaves it, means done
    SessionEnd removes the file
    SubagentStart / SubagentStop adds / removes a file per agent in ~/.claude/ctally.d/.agents/<session id>/

    A waiting never overwrites done: Claude Code also sends its idle notification after a turn ends. Nor does the idle notification count while the session's agents are still out. A session with a permission, a question or a plan on screen stays waiting until that's settled: the tool asked about has run or failed, whoever asked (Claude, or the agent of its that did) has gone on to another tool, the turn is over, or you've sent a new prompt. Its other agents carrying on meanwhile, and tools started alongside the one asked about, change nothing. A usage limit hit is also noted in ~/.claude/ctally.d/.limit: what Claude Code said, when the limit resets, from the status line, and the account it was hit on. Until then a new prompt leaves the session limited, and the limit shows as used up, unless you've changed accounts since. The note goes once a turn gets through on that account (the session's own, or another session's that has done something since the limit was hit: a reply already on its way then shows nothing), Claude Code says the limit has reset, or the status line shows a new window. Esc and killed agents get no hook, so CTally also reads the end of each busy session's transcript, and of its agents' transcripts: a stop there with nothing after it means the turn is over, and an agent whose transcript ends interrupted (or that Claude Code marks stoppedByUser) is gone. Inside tmux, a change of state also redraws tmux's status lines, so the counts there update at once. For ctally stats, each change of state, each prompt, and every five minutes of a lasting one, gets a line in ~/.claude/ctally.d/.history/<date>: the time, the session id and the state.

    The status line. ctally-statusline.sh saves what Claude Code hands its status line whenever it includes the usage limits: the latest for each account, in ~/.claude/ctally.d/.usage/<account id> (the id ~/.claude.json gives the account signed in), and the latest for the one signed in also in ~/.claude/ctally.d/.statusline, where the hook looks up when a limit resets. Each session hands over the numbers from its own last reply, on whichever account that was, and an idle one redraws its line now and then with numbers hours old. So a session's numbers count only when it has had a reply since it last drew its status line, which the same JSON tells: Claude Code's count of the time the session has spent on the API moves with every reply. The latest reply's numbers are kept as they are, more used than before or less (a limit reset where it stood). Whose they are, the week says: for a week already kept they're that account's, and for one not seen before, the account signed in's. It also saves each session's latest to ~/.claude/ctally.d/.status/<session id>, for how full that session's context is and to tell its next reply by. It prints nothing, or runs the status line you had before and prints what that prints.

  2. The app. It polls the folder twice a second, checking modification times first so unchanged files aren't re-read. Sessions whose process has exited drop off the display. The exception is when nothing else is running: a finished one stays so you can still see it. Leftover files are cleaned up after a day. The usage limits it checks every two seconds, the same way, and asks Anthropic for them, on a thread of its own, once they're five minutes old and Claude Code has replied since. The answer goes in ~/.claude/ctally.d/.fetched/<account id>, the way ~/.claude.json keeps its copy, and the newer of the two counts.

    The hooks hear of a session only once it does something, so the app also reads Claude Code's own list of its running sessions, ~/.claude/sessions/. A session the hooks haven't heard from yet, idle since setup or never sent a prompt, shows from there: idle, or working or waiting as Claude Code has it. Once its hooks run, they say. Background jobs count too, but not the spare processes Claude Code starts ahead of need. A session sent to the background goes on as a job under a new id: CTally shows it once, in the terminal that sent it, which is where clicking it takes you. A terminal running claude attach <job> (the way CTally's snapshots and ccsnap bring such a pane back after a restart) is where its job is, too: Claude Code doesn't list those, so CTally finds them by their command line every few seconds while a job has no terminal of its own. The list also says when a session went idle without a word to the hooks, as a job can after a prompt it never answers: one the hooks last heard working is then done, unless its agents are still at work. Sessions are listed oldest first, by when they started.

To add the hooks by hand, copy src/ctally/hooks/ctally.sh and ctally-statusline.sh to ~/.claude/hooks/ and merge this into ~/.claude/settings.json (to keep a status line you have, put its command after CTally's as one quoted argument: "\"$HOME/.claude/hooks/ctally-statusline.sh\" 'your command'"):

{
  "statusLine": { "type": "command", "command": "\"$HOME/.claude/hooks/ctally-statusline.sh\"" },
  "hooks": {
    "UserPromptSubmit": [{ "hooks": [{ "type": "command", "command": "\"$HOME/.claude/hooks/ctally.sh\" working" }] }],
    "PreToolUse":       [{ "hooks": [{ "type": "command", "command": "\"$HOME/.claude/hooks/ctally.sh\" working" }] }],
    "PostToolUse":      [{ "hooks": [{ "type": "command", "command": "\"$HOME/.claude/hooks/ctally.sh\" working" }] }],
    "PostToolUseFailure": [{ "hooks": [{ "type": "command", "command": "\"$HOME/.claude/hooks/ctally.sh\" working" }] }],
    "PermissionRequest": [{ "hooks": [{ "type": "command", "command": "\"$HOME/.claude/hooks/ctally.sh\" asking" }] }],
    "Stop":             [{ "hooks": [{ "type": "command", "command": "\"$HOME/.claude/hooks/ctally.sh\" done" }] }],
    "StopFailure":      [{ "hooks": [{ "type": "command", "command": "\"$HOME/.claude/hooks/ctally.sh\" failed" }] }],
    "Notification":     [{ "hooks": [{ "type": "command", "command": "\"$HOME/.claude/hooks/ctally.sh\" waiting" }] }],
    "SessionEnd":       [{ "hooks": [{ "type": "command", "command": "\"$HOME/.claude/hooks/ctally.sh\" end" }] }],
    "SubagentStart":    [{ "hooks": [{ "type": "command", "command": "\"$HOME/.claude/hooks/ctally.sh\" agent-start" }] }],
    "SubagentStop":     [{ "hooks": [{ "type": "command", "command": "\"$HOME/.claude/hooks/ctally.sh\" agent-stop" }] }]
  }
}

Privacy

Everything stays on your machine. The one network request CTally makes is for your usage limits: it asks https://api.anthropic.com/api/oauth/usage, the place Claude Code's /usage asks, as your Claude Code sign-in, and keeps the answer (the limits, nothing else) in ~/.claude/ctally.d/.fetched/<account id>. For that it reads Claude Code's access token each time it asks, from ~/.claude/.credentials.json, or on macOS the Claude Code-credentials item in your keychain. It sends the token only to api.anthropic.com, and never saves, logs or renews it: once it runs out, CTally waits for Claude Code to renew it. Switch off Exact usage in Settings and CTally makes no network requests at all, and never reads the sign-in.

To show session names it reads each transcript in ~/.claude/projects/, but only two parts:

  • the last 256 KB, for the /rename name or the generated title
  • the first 256 KB, once, for the directory the session started in

While agents run it also reads, beside the transcript, a running workflow's progress journal (for its phases, its agents' labels and how many are done) and each running subagent's one-line task description. It never reads your conversations otherwise.

While a session waits on you, the hook keeps what it asked (the tool and its input, the questions, or the plan) in ~/.claude/ctally.d/.asks/, and deletes it once that's settled. To answer from CTally, it reads the screen of that session's tmux pane when you open the menu, and types only the digit you pick.

For how full each session's context is, it reads the latest its status line was handed for that session (which also holds the model, the session's cost so far and its folder; CTally uses only the context numbers). For the usage limits it also reads what its status line saved, and from ~/.claude.json only the cached /usage numbers and your account's id, to show the numbers that are that account's (the status line and the hook read the id there too, and name files by it).

The history behind ctally stats holds nothing but times, session ids and states, and is kept for 90 days.

To list sessions the hooks haven't heard from, it reads Claude Code's list of running sessions in ~/.claude/sessions/: each one's id, process, folder, status and start time.

Snapshots, when you switch them on, hold your tmux sessions' names, layouts and pane folders, and for each Claude Code session its id, name, folder and the options it was started with; for a background job, its id, name and folder from ~/.claude/jobs/. To find which pane runs which session, CTally reads the command lines of the processes under each pane.

Terminal support

On macOS, clicking a session works best in Terminal.app, with or without tmux: CTally finds the exact tab, or the exact tmux pane and the tab attached to it. In other terminals (iTerm2, VS Code, …) and for sessions in the Claude desktop app, it still switches tmux to the right pane and brings the app forward, but can't pick the tab. On Linux, see Ubuntu. The prefix + J jump key works in any terminal.

Uninstall

ctally uninstall
pipx uninstall ctally

The first removes the hooks and status line in ~/.claude/settings.json (putting back a status line you had) and the block in your tmux config, both after a backup, then the scripts, starting at login, the state files and the preferences. Your other Claude Code and tmux settings are left as they are. The second removes the command and its Qt.

Troubleshooting

  • pipx install ctally says "No matching distribution found for PySide6-Essentials". Your Python is newer than any Qt built for your system (see Requirements). Install with an older one: pipx install --python python3.14 ctally. The same goes for pipx reinstall after your default Python moves on.
  • CTally doesn't change state. Restart your Claude Code sessions after installing. Then check that ~/.claude/ctally.d/ gets a file when you send a prompt.
  • Clicking a session does nothing. On macOS, allow Python (which runs CTally) to control Terminal under System Settings → Privacy & Security → Automation.
  • prefix + J says "nothing needs you". That means no session is waiting or done; ctally list shows what CTally sees. A session started outside tmux can't be jumped to.
  • CTally is gone. Use the hexagon icon in the menu bar → Show CTally. If the icon is gone too, it isn't running: run ctally run. Its log is ~/Library/Logs/ctally.log on macOS and ~/.local/state/ctally/ctally.log on Linux.
  • No context gauge. It needs CTally's status line (not with --no-statusline), a version of it from 0.3.3 on (run ctally setup again after upgrading), and a reply in that session since: since it was reopened, too, if it's a conversation you resumed.
  • No usage limits. They need a Pro, Max or Team plan, and a reply in some session since CTally's setup (restart sessions that were running then). ctally usage shows what CTally has. Just after changing to an account CTally hasn't seen, there are none until its first reply.
  • The limits look like another account's. After upgrading from 0.3.4 or earlier, run ctally setup again: it's the newer status line script that tells accounts apart.
  • A model's week says as of …. CTally couldn't ask Anthropic for it: ctally usage says why, and so does the log. Most often Claude Code's sign-in has run out and no session has renewed it yet, or the answers came too often and CTally is waiting as it was told. Check that Exact usage is on in Settings.
  • Ubuntu: "Could not load the Qt platform plugin xcb". Install the library it names, usually sudo apt install libxcb-cursor0.

Developing

python3 -m venv .venv && .venv/bin/pip install -e . pytest
.venv/bin/ctally run                 # the indicator, from your checkout
.venv/bin/python -m pytest tests     # the tests
.venv/bin/python tools/snapshot.py   # the README's screenshots, from demo data

Every push runs the tests and pyflakes on GitHub (.github/workflows/test.yml), on Ubuntu with Python 3.9 and 3.15 and on macOS with 3.15.

Set CTALLY_STATE_DIR, CTALLY_PROJECTS_DIR, CTALLY_SESSIONS_DIR, CTALLY_CONFIG_DIR and CTALLY_CLAUDE_JSON to run it against other folders than ~/.claude/ctally.d, ~/.claude/projects, ~/.claude/sessions and its own settings, and another file than ~/.claude.json.

Releasing

Releases go to PyPI from GitHub, by .github/workflows/publish.yml, using PyPI's Trusted Publishing: PyPI trusts that workflow in this repository, so no token is stored anywhere.

Pushing doesn't release anything. Between releases, __version__ in src/ctally/__init__.py is the next version marked .dev0 (0.3.2.dev0), so builds from main say they aren't a release.

  1. Drop the .dev0 (0.3.2.dev0 → 0.3.2), then commit and push.
  2. Create a release whose tag matches it: gh release create v0.3.2 --generate-notes, or on GitHub.
  3. The workflow builds the package, checks it and uploads it. pipx upgrade ctally then picks it up.
  4. Set __version__ to the next one, 0.3.3.dev0, and commit.

Once, before the first release: on pypi.org → your account → Publishing, add a pending publisher with PyPI project ctally, owner JinyuJinyuJinyu, repository ctally, workflow publish.yml and environment pypi.

License

MIT

CTally is an independent community project. It is not affiliated with or endorsed by Anthropic.

Metadata

Release files for ctally 0.3.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ctally 0.3.6
File Size Uploaded Provenance Actions
ctally-0.3.6.tar.gz 218.8 kB With provenance Details for ctally-0.3.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ctally 0.3.6
File Interpreter ABI Platform Actions
ctally-0.3.6-py3-none-any.whl Python 3 none any Details for ctally-0.3.6-py3-none-any.whl

Total release size: 351.6 kB

Release files / ctally-0.3.6.tar.gz

Download URL ctally-0.3.6.tar.gz
Size 218.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0f37903070d2ef62a26027ea49e6e144a27bb2ea77db60a41e82eb0017098890
BLAKE2b-256 checksum
How to use checksums
8c9da119c6292980f250cf6c03ae7c1079f0b0209ff9e40a03aa5167f049f0d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / ctally-0.3.6-py3-none-any.whl

Download URL ctally-0.3.6-py3-none-any.whl
Size 132.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f8d8a1d561afda8042f1e87c021e1bbd6393e4a2de599664fe24a19b7f87919
BLAKE2b-256 checksum
How to use checksums
3f91be5547b177cfe4c83eace849167d760c432c25561d54ed415319109b72a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Security for ctally 0.3.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ctally-0.3.6.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page