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.0

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.0
File Size Uploaded Provenance Actions
lost_sessions-0.2.0.tar.gz 46.6 kB Without provenance Details for lost_sessions-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 99.2 kB

Release files / lost_sessions-0.2.0.tar.gz

Download URL lost_sessions-0.2.0.tar.gz
Size 46.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a4632190b4e35beb5d0b0bfd7aa37fc29a87df18626111e1a09809e7a961910c
BLAKE2b-256 checksum
How to use checksums
42e43b4599854e10728c155b721b4812d7ea67800f014f82929f45f0624451ed
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.0-py3-none-any.whl

Download URL lost_sessions-0.2.0-py3-none-any.whl
Size 52.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1b32d9d257c182761cfd15551f10efcef453a0a4af97468289c491b23848bab
BLAKE2b-256 checksum
How to use checksums
0f568141a65b49d9306b835006baed3e658669bd3c73eff5697fff70f0f78871
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.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.

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