Agent Session Rescue
Agent Session Rescue is an offline, non-destructive CLI for inspecting one explicitly selected Codex rollout JSONL file and creating a separate, hash-audited recovery bundle.
Version 0.1.0 is a narrow beta. It does not modify Codex files, indexes, SQLite databases, configuration, or application state, and it does not promise that every damaged thread can be made resumable.
Install
Python 3.11 or newer is required. The package has no runtime dependencies.
python3 -m pip install agent-session-rescue
session-rescue --help
To install from a source checkout instead, run python3 -m pip install . in
the repository root.
Read-only scan
Choose the rollout file yourself. v0 never crawls ~/.codex or chooses a session on your behalf.
session-rescue scan /path/to/rollout.jsonl
session-rescue scan /path/to/rollout.jsonl --format json
The report includes only structural metadata: the displayed input path, SHA-256, byte and record counts, finding codes, locations, sizes, and recovery limitations. It does not echo prompts, tool output, encrypted reasoning, inline images, or environment values.
Explicit salvage
Salvage is a second, explicit command and requires a new or empty output directory:
session-rescue salvage /path/to/rollout.jsonl --output ./recovery-bundle
Depending on the findings, the bundle can contain:
manifest.json: input/output hashes, transformations, byte counts, and loss warnings.report.json: the same metadata-only structural report.resume.md: bounded user/assistant text plus tool names/statuses; no raw tool output or binary data.quarantine/: exact malformed fragments that could not be parsed.attachments/: safely decoded oversized data payloads addressed by SHA-256.repaired.jsonl: only when all transformations are supported and the candidate passes the same validator.
The original input hash and byte length are checked again after salvage. The product never installs repaired.jsonl into Codex; reintegration is outside the v0 support boundary.
Records over the 8 MiB parser cap are never decoded or parsed. Salvage can stream their exact bytes into quarantine, but it will not emit a repaired copy.
Exit codes
0: supported file is structurally clean.1: findings exist and every blocking finding has a supported salvage transformation.2: only partial recovery/export is safe; no loadable repaired JSONL is promised.3: invalid invocation, unreadable input, unsafe output, or unsupported schema.4: unexpected internal failure; the original remains unchanged.
The stable finding catalog is in docs/findings.md. The recovery bundle and data-loss contract is in docs/repair-contract.md.
Privacy and safety
- No network access, account, cloud storage, background process, or CLI telemetry.
- Default
scanperforms no writes. salvagewrites only under the explicitly selected new/empty output directory.- The input rollout, Codex indexes, SQLite, and configuration are never modified.
- Recovery outputs can contain sensitive session text or raw fragments. Protect, review, and delete the bundle like the original session.
See SECURITY.md before using salvage on a real session.
v0 non-goals
No Claude Code/OpenClaw/Cursor/Copilot/Gemini formats, live tracing, observability dashboard, model calls, semantic replay, AI summarization, GUI, cloud sync, automatic Codex-state repair, licensing system, workflow engine, scheduler, or management UI.
Local verification
PYTHONPATH=src python3 -m unittest discover -s tests -v
python3 scripts/dry_run.py
python3 -m compileall -q src tests scripts
Metadata
Release files for agent-session-rescue 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 | |
|---|---|---|---|---|
| agent_session_rescue-0.1.0.tar.gz | 18.3 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agent_session_rescue-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.8 kB
Release files / agent_session_rescue-0.1.0.tar.gz
| Download URL | agent_session_rescue-0.1.0.tar.gz |
|---|---|
| Size | 18.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
af6b838d3af5242819216d3645bfae632f22fed19fabd595f516ce8ef65cfa85
|
|
BLAKE2b-256 checksum How to use checksums |
628d1e5224fdd4ec92d89a88400e57ec5ba84ddbf128989761d809c4f1b28c1f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 28, 2026.
Transparency logRelease files / agent_session_rescue-0.1.0-py3-none-any.whl
| Download URL | agent_session_rescue-0.1.0-py3-none-any.whl |
|---|---|
| Size | 16.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
11f3ea1a73cd745aa7e9167e7e7b272b0e8366a4d9115c4d4900624f54163721
|
|
BLAKE2b-256 checksum How to use checksums |
207d5ff588769aa5b8ce0f17912f8da702215eafa094dc334040c22cb586bfca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 28, 2026.
Transparency logSecurity for agent-session-rescue 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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for agent_session_rescue-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 28, 2026.
Transparency logA 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.