Skip to main content

lost-sessions

Recover the agent sessions a reboot dropped. lost-sessions finds Claude Code, Codex, Muse and OpenCode sessions that started before the last boot and that no session manager will restore, then prints their resume commands or reopens them in Herdr or Rex.

Agents and session managers are plugins, the way simonw/llm does plugins. The six built-ins use the same interface a third-party lost-sessions-<name> package uses.

Install

uv tool install "lost-sessions @ git+https://github.com/smorinlabs/lost-sessions"

This installs the latest main. Python 3.13 or later. macOS and Linux. Tagged releases, and a PyPI package, follow once publishing is set up.

Use

Command What it does
lost-sessions recover Interactive menu: choose Print, Rex or Herdr for each dropped session, then run them all
lost-sessions list Numbered list of the dropped sessions in the window
lost-sessions open REF… --print|--rex|--herdr [--focus [REF]] Print or open sessions without the menu; REF@DEST picks a destination
lost-sessions workspaces The Herdr workspaces and Rex sessions you can open sessions in
lost-sessions history [--json] Every action taken, from ${XDG_STATE_HOME:-~/.local/state}/lost-sessions/history.jsonl
lost-sessions inventory [--json] Read-only inventory of every agent session on this machine
lost-sessions plugins [--all] Installed plugins, as JSON
lost-sessions install PKG… / uninstall PKG… Add or remove plugins in the uv tool install

The window is every session that started before the last boot and was active since its start: by default 00:00 on the day before the boot. --since sets that start, as a date (--since 2026-11-09) or a duration back from now (--since 3d); pick an earlier start to widen the window. Running sessions and sessions a manager restores are hidden unless --all.

Library

from lost_sessions.inventory import collect, select

inventory = collect()  # an Inventory: sessions, census, sources, failed
for session in select(inventory, live=True):
    print(session.tool, session.id, session.resume)

Plugins

See Writing plugins for the hooks, the AgentTool and SessionManager contracts, and how to test and install a plugin. The design is in design 0006.

Develop

make bootstrap   # bare machines only: just + uv
just setup       # dev environment and git hooks
just check       # tests, lint, types, import contracts

See AGENTS.md for the full workflow.

Metadata

Release files for lost_sessions 0.2.1

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

Source distribution (sdist)

Source distribution for lost_sessions 0.2.1
File Size Uploaded Provenance Actions
lost_sessions-0.2.1.tar.gz 46.6 kB Without provenance Details for lost_sessions-0.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 99.2 kB

Release files / lost_sessions-0.2.1.tar.gz

Download URL lost_sessions-0.2.1.tar.gz
Size 46.6 kB
Tags Source
SHA-256 checksum
How to use checksums
29530a4749fadb09882f248e1f5205b6fb28665382fda03cbba63781da8eb6c9
BLAKE2b-256 checksum
How to use checksums
fb0b5643eb33599d086eaa89d97508d2f45fbf941eb8a6b3b77601edc7ef2392
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / lost_sessions-0.2.1-py3-none-any.whl

Download URL lost_sessions-0.2.1-py3-none-any.whl
Size 52.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3800986009b38bcd2b41a22e48f7b2c3cb413a89d8a300acac3bb9c1fd6d355a
BLAKE2b-256 checksum
How to use checksums
127c997a882c0e3886f894a5ff12f44dcb14c8f7aa4b0de793bf11d72daf223a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for lost_sessions 0.2.1

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.

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