pk-session-manager
Parse, index, name, and compress AI agent sessions from Claude Code, Codex, Gemini, and pluggable adapters.
Provides:
- A unified Python API and SQLite index over heterogeneous session sources
- A
smCLI for listing, viewing, renaming, describing, and compressing sessions - A Textual TUI for browsing sessions across all agents
- Optional LLMLingua-2 token-aware compression for feeding a past session back into a model
- Optional OpenRouter-powered auto-naming via
openai/gpt-oss-120b - An optional PyWebView desktop shell
Install
pip install pk-session-manager
Optional extras:
pip install 'pk-session-manager[compress]' # LLMLingua-2 semantic compression
pip install 'pk-session-manager[desktop]' # PyWebView desktop shell
pip install 'pk-session-manager[dev]' # pytest + ruff
Dev install (editable)
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -e .
For semantic compression: pip install -e ".[compress]". For the desktop shell: pip install -e ".[desktop]".
Quick start
sm index # discover and index sessions from all known sources
sm list # show indexed sessions
sm show <id|name> # render a session's turns
sm compress <id> # write a token-compressed bundle to stdout
sm-tui # launch the Textual TUI
Storage
State lives under ~/.session-manager/:
sessions.db— SQLite + FTS5 index (sessions, turns, tool calls, names)config.toml— user config (sources, compression target, OpenRouter key location)models/— LLMLingua-2 model cache (downloaded lazily on first compression)
Sources
Out of the box:
- Claude Code —
~/.claude/projects/<encoded-cwd>/<uuid>.jsonl - Codex —
~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonland~/.codex/archived_sessions/ - Gemini —
~/.gemini/tmp/<project>/chats/session-*.jsonl - Generic JSONL — point a YAML at any path and provide a field mapping
Auto-naming
If OPENROUTER_API_KEY is set, sm describe <id> will call openai/gpt-oss-120b via OpenRouter and store a short title + 1-sentence description. Heuristic names (first user prompt + cwd) are generated for free at index time.
Metadata
Release files for pk-session-manager 0.1.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 | Actions |
|---|---|---|---|---|
| pk_session_manager-0.1.0.tar.gz | 31.6 kB | Without provenance | Details for pk_session_manager-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pk_session_manager-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pk_session_manager-0.1.0-py3-none-any.whl |
Total release size: 67.1 kB
Release files / pk_session_manager-0.1.0.tar.gz
| Download URL | pk_session_manager-0.1.0.tar.gz |
|---|---|
| Size | 31.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
47f177515ecf3e58f90dc5015fdc5d0cc11cf80f1e567099d49a089540957425
|
|
BLAKE2b-256 checksum How to use checksums |
32f0e490b1c78d7171d7d89ffd57b41c9ed394d4ad519618aad984c53d9b710f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / pk_session_manager-0.1.0-py3-none-any.whl
| Download URL | pk_session_manager-0.1.0-py3-none-any.whl |
|---|---|
| Size | 35.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d02c274687791a3adb0dc791bdb060b02074a92a5decdc6fce2752bb70bc3536
|
|
BLAKE2b-256 checksum How to use checksums |
260387926f7749b31656dd88bd49967fbee1b4978855c1d19c0f18acb83c6cd4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Security for pk-session-manager 0.1.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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.