sessiontools
session: one command for the coding-agent sessions on this machine.
Which are live, whether each is busy or idle, how full its context is,
and how to start one from an agent file. For anyone running several
Claude Code sessions side by side, and for the tools that watch them.
Install
uv tool install sessiontools # puts `session` on the PATH
Python 3.11 to 3.14. Optional: the Claude Code plugin adds
the session skill and two hooks.
Shell completion, one line per shell (shell completion):
eval "$(session completion zsh)" # zsh: in ~/.zshrc, after compinit
session completion bash > ~/.local/share/bash-completion/completions/session # bash with bash-completion 2
eval "$(session completion bash)" # bash 3.2 or any bash without it: in ~/.bashrc
Quick start
session list # the live sessions: panes, state, context
session get state # this session: busy, idle with children, idle
session context # how full this session's context window is
session context --parts # what filled it: boot, then growth by category
session ledger --short # each file read and command run, by tokens
session account status # which Claude account this Mac is on
session start --list-agents # the agents it can start
session reap # seats idle past 1h: CLOSE or KEEP, and why (a dry run)
session --help # every verb
Switching accounts
session account use NAME moves this Mac to another Claude account from
a token you already hold: no browser, no restart, and it never prints a
token. On a Keychain host it moves every seat, not one:
| route | moves | cache cost | reversible by | gate |
|---|---|---|---|---|
account use (Keychain) |
every seat on the Mac with no env token, within ~50 s | the sum of their contexts (2.07M / 1.10M measured) | use back, or restore from the backup |
witness, --yes, preflight, backup |
account use (token file) |
no live seat; each one that relaunches from a shell that reads the file | none now; each seat's context when it restarts | use back, or restore from the backup |
witness, --yes, preflight, backup |
A host whose shell exports CLAUDE_CODE_OAUTH_TOKEN from a file names it
in the session setting account.token_file, and use swaps the file.
Without --yes, use shows the plan and writes nothing. To add an
account, session account new NAME --email E signs in through claude setup-token, saves the token to passage, reads it back and registers
it; the token is never shown. See Switching Claude accounts.
Uninstall
uv tool uninstall sessiontools
It leaves ~/.session/ (session dirs, the list cache) and
~/.sessionkit/tools/settings/; remove them by hand to leave nothing
behind.
Docs
- The
sessionverbs: list, get, context, ledger, account, settings, operator, reap - Starting a session: agent files, flags, tmux, one holder
- Switching Claude accounts:
session account, its blast radius, andnew, which adds an account - The
session listcache: one computation, many readers - Operator and privileged seats: who seats ask
- Closing idle seats:
session reap, a dry run by default - Shell completion:
session completion bash|zsh, a static script built from the verbs' own parsers - The Claude Code plugin: the skill and the hooks
- The settle alert: one line past a context threshold
- The busy sound: a sound while a tool batch runs long
- The sound engine: the busy sound from one resident process
- The status line:
session statusline installputs it in the kit's claude-code layer, never~/.claude.session startseats show it; a bareclaudedoes not (alias claude='session start -') - The pane signal: BUSY / FREE on each seat's tmux pane,
and
session pane-state agent, the launchd agent that publishes it - The Python library:
from sessiontools import sessions - Building and testing: make targets, specs, releases
- CHANGELOG; licence AGPL-3.0-or-later (LICENSE)
Configuration
Nothing needs configuring: unset, every part uses its default. What can be set, and where each one lives (configuration):
- Settings files, JSON in layers:
~/.sessionkit/tools/settings/session.json(the operator, the list cache, the pane signal, accounts, a session's home),~/.sessionkit/tools/settings/sounds.json(the busy sound), and~/.sessionkit/tools/settings/claude-code.json(the model, effort and status linesession startpasses on). Every key, its default and which layers it is read from: settings. - Folders of its own:
~/.session/(sessions, seats, agent files, the state dir) and~/.sessionkit/tools/accounts/(session account). - Environment variables: the settle alert's
SESSION_SETTLE_AT, the hooks'SESSIONTOOLS_HOOK_*switches, and the paths it reads, such asSESSIONS_DIRandSESSION_STATE_DIR. The configuration page lists each one with its default, under the part that reads it.
Logs
- The sound engine:
~/Library/Logs/sessiontools/sound-engine.log, oncesession sound engine onhas run. - The pane signal's agent:
~/Library/Logs/sessiontools/pane-state.log, oncesession pane-state agent onhas run. session reap --yes:~/.session/state/reap.log, one line for each seat it closed or failed to close.- Each session's settings at birth:
~/.session/sessions/<session-id>/log/settings.jsonl, whatsession startread into that session's settings: each environment variable by name, never its value. - The status line:
~/.config/session/statusline-log.jsonl, one line per render, only when~/.config/session/already exists.
Follow one as it grows with tail -F, for example
tail -F ~/Library/Logs/sessiontools/pane-state.log.
- Health:
session listprints a row for each live session, with its state and context. A session you know is running that is not listed is one sessiontools cannot see.
Metadata
Release files for sessiontools 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| sessiontools-0.2.0.tar.gz | 397.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sessiontools-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 842.6 kB
Release files / sessiontools-0.2.0.tar.gz
| Download URL | sessiontools-0.2.0.tar.gz |
|---|---|
| Size | 397.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
84098c81148172798f76ab51c11622af0833be120551a2207a1c1f3ba72cfff3
|
|
BLAKE2b-256 checksum How to use checksums |
9af7ef8c8ab184c3988ca1c5ed1b936dea11767390f3a9f6213e3376df0cee2d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.9 {"installer":{"name":"uv","version":"0.11.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / sessiontools-0.2.0-py3-none-any.whl
| Download URL | sessiontools-0.2.0-py3-none-any.whl |
|---|---|
| Size | 445.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
af9d0b9ada973d74662d5284f81a63cb1813f17311fff2757de0633e6eb44133
|
|
BLAKE2b-256 checksum How to use checksums |
d1f7e71b815e01d81cfb7ec335bbb8e7b9c177e88cf8379e6ee3565a8e70b8d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.9 {"installer":{"name":"uv","version":"0.11.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for sessiontools 0.2.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.