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 inventory --evidence [--json] The same inventory with optional session evidence
lost-sessions evidence record --file FILE [--json] Explicitly record an event or work assessment
lost-sessions evidence list|view --tool TOOL --session ID [--json] Read evidence history or a combined view
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.

Optional session evidence

Optional evidence preserves opening/ending observations and scoped work assessments without changing recovery decisions. See the evidence reference and the companion skill. Installing the skill does not enable lifecycle hooks; hook templates are a separate opt-in.

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.3.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.3.0
File Size Uploaded Provenance Actions
lost_sessions-0.3.0.tar.gz 54.2 kB Without provenance Details for lost_sessions-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 115.8 kB

Release files / lost_sessions-0.3.0.tar.gz

Download URL lost_sessions-0.3.0.tar.gz
Size 54.2 kB
Tags Source
SHA-256 checksum
How to use checksums
582be3660acfdae4d71c5f492d7c9c04dee02c9f4432998b8aa47942a17adad8
BLAKE2b-256 checksum
How to use checksums
16ab2f248d2e278aa171296ef023bf2dbcf9229f0b011139943424256695847c
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.3.0-py3-none-any.whl

Download URL lost_sessions-0.3.0-py3-none-any.whl
Size 61.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
103dcf28173cba202a0983e0965e6382b1dc438375b4ab92ead58b569e27acb5
BLAKE2b-256 checksum
How to use checksums
acbc40a59a0ef3b9870809e8ff713cff7c126c6bda383355d1126472f3d68b2f
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.3.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