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

Built distribution (wheel)

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

Total release size: 115.8 kB

Release files / lost_sessions-0.3.1.tar.gz

Download URL lost_sessions-0.3.1.tar.gz
Size 54.2 kB
Tags Source
SHA-256 checksum
How to use checksums
975bffe205a0bda1c4a3fa02176b2c7b4832be5e9813d279e24f199063fdf460
BLAKE2b-256 checksum
How to use checksums
ccbaaca2581e7c98d30c74f0ba868249464f047f6fb791c36b363f1cc88e1b06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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.1-py3-none-any.whl

Download URL lost_sessions-0.3.1-py3-none-any.whl
Size 61.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
05578f51cea980bdca058b8f8aac67236731d7894c6c2f81a24cca3eb5a87e37
BLAKE2b-256 checksum
How to use checksums
f4d63ea1cbadc59c099c932cc5bc2f8993adef99d7b400b206df035ea9959539
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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.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