Metadata-Version: 2.4
Name: claude-session-hub
Version: 0.1.1
Summary: A local dashboard for all your Claude Code sessions: who is working, who is waiting for you.
Author: lolloi
License-Expression: MIT
Project-URL: Homepage, https://github.com/lolloi/claude-session-hub
Project-URL: Issues, https://github.com/lolloi/claude-session-hub/issues
Keywords: claude,claude-code,dashboard,sessions,anthropic
Classifier: Programming Language :: Python :: 3
Classifier: Environment :: Web Environment
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development
Classifier: Intended Audience :: Developers
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Claude Session Hub

[![tests](https://github.com/lolloi/claude-session-hub/actions/workflows/tests.yml/badge.svg)](https://github.com/lolloi/claude-session-hub/actions/workflows/tests.yml)

**See all your Claude Code sessions in one page, and know at a glance which one is waiting for you.**

If you run several Claude Code sessions at once (one per feature, one per role…), it is easy to
lose track: which one is still working, which one is only running tests, which one finished, and
**which one has been waiting for your answer for twenty minutes**. Claude Session Hub reads the
files Claude already writes on your computer and shows it all on a local page, with an optional
notification when a session needs you.

![Claude Session Hub: a session finishes and asks a question, a handoff note opens, then tokens and commits](https://raw.githubusercontent.com/lolloi/claude-session-hub/main/docs/demo.gif)

*The built-in demo (`--demo`): made-up sessions, no real data. Here "Checkout API" finishes its turn
with a question and moves to the top as "Waiting for you".*

## What you see

- **Who is waiting for you**, on top, with the question in the session's own words, and a
  notification if you want one. If a session tells you to answer in another session's window,
  the card says so.
- **What each session is doing**: working, running checks in the background (tests, a build),
  or done.
- **Its last handoff note**, if it keeps one (click to read it whole).
- **Tokens** per session and per day for the last 14 days.
- **Commits each session landed on the main branch**, even after a rebase.
- **Plan limits** (5-hour and weekly windows), as last seen by the Claude desktop app, with the
  tokens used this week and an estimate of how many make 100%.

It works with sessions in the **Claude desktop app** (Code tab) and with sessions started with
**`claude` in a terminal**.

## Run it

Needs Python 3.9 or newer and git 2.31 or newer. No other dependencies.

```bash
pipx install claude-session-hub
claude-session-hub
```

The page opens at <http://127.0.0.1:4777>. To try it without your own sessions:

```bash
claude-session-hub --demo
```

Other ways: `uvx claude-session-hub` runs it without installing; `python3 -m pip install claude-session-hub`
works too where your Python allows it (inside a virtual environment, for example). From a clone of
this repository: `PYTHONPATH=src python3 -m claude_session_hub`.

Options: `--port 4777`, `--no-open`, `--archived` (also archived desktop sessions), `--demo`,
`--json` (print one snapshot and exit).

## Privacy

- **Read-only.** It only reads files Claude and git already have on your computer, and runs only
  read-only git commands.
- **Local.** The page is served on `127.0.0.1` only. Nothing is sent anywhere, there are no API
  calls and nothing costs money.
- **One file of its own**: `~/.cache/claude-session-hub/usage-v1.json`, token counts per
  transcript so the page has numbers as soon as it opens. Delete it any time; set
  `CLAUDE_SESSION_HUB_CACHE` to move it.

## How it works

| Source | Where | Used for |
|---|---|---|
| Claude desktop app, Code sessions | `~/Library/Application Support/Claude/claude-code-sessions/` | name, model, folder, branch, the app's summary of the last turn |
| Claude Code transcripts, end of each file | `~/.claude/projects/*/*.jsonl` (last 16 MB the first time, then only new lines) | is a turn running, is a question waiting, background jobs, the session's last words |
| Transcripts of terminal sessions | `~/.claude/projects/*/*.jsonl` changed in the last 30 days | sessions started with `claude` in a terminal |
| Running Claude Code sessions | `~/.claude/sessions/<pid>.json` (and whether that process still runs) | a terminal session whose `claude` has exited is Done, not waiting |
| Transcripts, whole files | `~/.claude/projects/**/*.jsonl` (only new bytes are read) | tokens per session and per day, notes written, `git commit` times |
| Git history of each session's repository | worktree reflogs and `git log <main branch>` | commits each session landed on the main branch |
| Shared notes of Code sessions | `~/Library/Application Support/Claude/side-session-notes/` | each session's handoff note |
| Plan usage seen by the desktop app | `~/Library/Application Support/Claude/plan-usage-history.json` | 5-hour and weekly limits |

**States.**

- **Waiting for you**: the session asked you something (a question card, the question in the
  desktop app's "next step" box, or, in a terminal, a turn that ends with a question) and you have
  not answered, or the app marked it as blocked on you and its last words are a question. This
  wins over every other state. When the app says "blocked" but nothing was asked ("send me the
  screenshot when they reply"), the card is Done with a "Next step is yours" line instead.
- **Working**: a turn is running. In a terminal, a turn with no progress for 90 s says it may be
  waiting for your permission.
- **Running checks**: the turn is over but a job it started in the background has not reported
  back yet, so the work is not finished.
- **Done**: the turn is over and nothing is pending, with the session's own words on what it did.
  Sessions done for more than 14 days go into a closed "Older sessions" box. (The desktop app also
  labels many finished turns "ready for review"; the hub does not repeat that label, because a
  session that really needs you asks a question, and then it is "Waiting for you".)
  A terminal session whose `claude` has exited is Done too, even if it ended on a question:
  nobody can answer it any more. The card keeps the question ("Closed before you answered").

**Handoff notes.** A session's note is the note-like Markdown file it wrote most often: any `.md`
in the desktop app's shared notes folder, or a file named like a note elsewhere (`HANDOFF.md`,
`NOTES.md`, `progress.md`…). Writes count whether made with Write/Edit or from the shell; reads
never count.

**Tokens.** Each answer is counted once, even when it is copied into a resumed or forked
transcript; sub-agents count toward their parent session. Most tokens are usually cache reads
(Claude re-reading the conversation), which weigh much less on plan limits than new text. The
"≈ $ at API prices" figure is what Claude Code itself computes; on a Pro or Max plan you do not
pay it.

**Commits.** Git does not record which session wrote a commit, and commits are often rebased
before they reach `main` (new hash, same subject). The hub reads the commits each session made
from the reflog of the worktree it works in and matches them to the main branch by subject. When
several sessions share one checkout, a commit goes to the session that ran `git commit` there just
before. Merge commits are not counted.

**Plan limits.** The desktop app saves them only now and then, so the page always says when the
reading was taken; a 5-hour reading older than 5 hours is not shown, since that window has reset.

**Tokens this week.** Anthropic does not say how many tokens a plan allows, and the app saves only
percentages. The hub finds when your week starts again from the readings (the weekly percent drops
at the same time every week), adds up the tokens used since then, and estimates 100% as the median
of "tokens so far ÷ percent" over the readings of the last 3 weeks. It is an estimate: the limit is
not counted in plain tokens (models weigh differently), and chats on claude.ai or other devices use
the same limit without showing up here.

## Limits

- Used daily on **macOS** with the Claude desktop app. The tests run on macOS, Linux and Windows
  (Python 3.9 and 3.13), but real use on Linux and Windows is still untested: reports welcome.
- The desktop app's session files are not a documented format, so an app update may change them.
  Terminal sessions rely on Claude Code transcripts and its running-session files.
- If something looks wrong, please open an issue with what the page showed and what you expected.

## Development

```bash
PYTHONPATH=src python3 -m unittest discover -s tests
```

The tests build small fake transcripts, notes and git repositories; they never read your data.

## License

[MIT](LICENSE). Not affiliated with or endorsed by Anthropic. "Claude" is a trademark of Anthropic.
