This release is a pre-release and may not be stable for production use.
Overview
When OpenAI Codex CLI can't resume safely, Rescue tells you what actually happened and gets you back to work.
Codex Rescue is a local-first fsck and crash-recovery tool for OpenAI Codex sessions. It diagnoses interrupted or damaged sessions, verifies repository working tree state, and reconstructs a bounded evidence-backed continuation without modifying the original Codex rollout.
[!WARNING] Codex Rescue is experimental alpha software. It is an evidence-gathering release designed to collect real failure cases. See Alpha Limitations below.
Core Commands
Rescue provides four narrow, read-only diagnostic and recovery entry points:
| Command | Usage | Description |
|---|---|---|
sessions |
codex-rescue sessions |
Discover and list recent local Codex rollout sessions |
doctor |
codex-rescue doctor --latest |
Inspect and diagnose a damaged session (read-only) |
salvage |
codex-rescue salvage --latest --fork |
Create an immutable, content-addressed recovery handoff |
verify |
codex-rescue verify <rescue-id> |
Detect repository divergence before executing continuation |
Confidence Model
Rescue reconstructs facts with explicit, uncompromised confidence levels. Model prose alone is never accepted as source of truth.
| Level | Badge | Meaning & Source of Truth |
|---|---|---|
| VERIFIED | VERIFIED |
Directly proven by durable evidence: Git HEAD SHA, working tree diff, tool execution exit code, or durable output record |
| RECONSTRUCTED | RECONSTRUCTED |
Strongly inferred from available evidence with no unresolved contradictions |
| UNKNOWN | UNKNOWN |
Cannot be proven safely. UNKNOWN is deliberate. Rescue refuses to guess when execution state is uncertain |
[!NOTE] Safety Invariants:
- Source rollouts are immutable (
doctor,salvage, andverifynever write to the original.jsonlfile).- No automatic replay — an action whose execution status is
UNKNOWNis never automatically re-executed.
Quick Start
1. Installation
Install directly from the GitHub release tag:
# Recommended global installation via pipx
pipx install git+https://github.com/shleder/codex-rescue.git@v0.1.0-alpha
# Or via standard pip
pip install git+https://github.com/shleder/codex-rescue.git@v0.1.0-alpha
2. Workflow Example
# 1. Discover recent Codex sessions
codex-rescue sessions
# 2. Diagnose the latest session
codex-rescue doctor --latest
# 3. Generate an immutable recovery handoff
codex-rescue salvage --latest --fork
# 4. Verify repository state before continuing
codex-rescue verify <rescue-id>
Sample Output
$ codex-rescue doctor --latest
Doctor: UNFINISHED_TOOL_CALL
Findings: UNFINISHED_TOOL_CALL
Repository: /path/to/repo (HEAD a6cfe48)
$ codex-rescue salvage --latest --fork
Salvage: 8f8f4e822c9ce353ed584c5f
Original session untouched: yes
Rescue directory: .codex-rescue/rescues/8f8f4e822c9ce353ed584c5f
$ codex-rescue verify 8f8f4e822c9ce353ed584c5f
Verify: REVIEW_REQUIRED
Review: unfinished action requires inspection before replay
Review: handoff contains load-bearing unknowns
Proven Compatibility & Evidence
| Version / Scope | Status | Proven Real-World Evidence |
|---|---|---|
| Codex CLI 0.147.0 | Validated | Genuine interrupted session diagnosed (UNFINISHED_TOOL_CALL), source rollout preserved, repo state verified |
| Codex CLI 0.146.1 | Smoke-tested | Isolated authentication & basic rollout parser validation |
| Codex 0.145.0-alpha.18 | Observed | Legacy envelope format compatibility observed |
| Synthetic Fixtures | 5/5 PASS | kill_apply_patch, kill_shell_before_result, lost_tail_after_compaction, malformed_jsonl, oversized_payload |
Alpha Limitations
[!IMPORTANT] The following limitations are documented honestly. Do not claim recovery guarantees that have not been validated.
- Compaction recovery — broad real compaction-related recovery is not yet validated; only synthetic fixtures exist.
- Interactive continuation — automatic fresh continuation depends on terminal/TTY environment (Windows ConPTY limitations noted).
- Previous versions — validation is focused on Codex CLI 0.147.0; earlier versions are smoke-tested or observed.
- Side-effect replay — Rescue does not automatically replay unknown side effects; it reports them as
REVIEW_REQUIRED.
Privacy & Security
- 100% Local-First — zero telemetry, zero analytics, zero network uploads, zero cloud dependencies.
- No private DB mutation — Rescue never modifies
state_*.sqliteor internal Codex databases. - Secret Redaction — built-in secret redaction automatically filters common API key patterns (
sk-*,ghp_*,AKIA*, Bearer tokens). - Sanitization Notice — Codex rollouts can contain secrets; sanitize all session files before attaching to public issues.
Development & Verification
# Clone the repository
git clone https://github.com/shleder/codex-rescue.git
cd codex-rescue
# Install in editable mode
pip install -e .
# Run full unit test suite (43 passed, 1 skipped)
python -m unittest discover -s tests -v
# Run synthetic fixture harness (5/5 PASS)
python -m codex_rescue.harness fixtures --output .validation-output/test
# Run deterministic alpha demo
python scripts/demo_alpha.py
Submit a Recovery Report
The primary goal of this public alpha is collecting real broken Codex sessions to expand our sanitized regression corpus.
[!CAUTION] Do NOT upload raw rollout files containing secrets or credentials. Always sanitize session data before attaching.
License
Distributed under the MIT License. Copyright (c) 2026 shleder.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codex_rescue-0.1.0a1.tar.gz.
File metadata
- Download URL: codex_rescue-0.1.0a1.tar.gz
- Upload date:
- Size: 30.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ef93a600ca8f708778a622ecd4a4c879a9ed89fc5ffd9ac5e311011f3b3cc7b
|
|
| MD5 |
e70ac3b2ba0e6b70fc881312b39c6ee8
|
|
| BLAKE2b-256 |
2026b08771f4d440246a7c28a0d7a8dcfacf68912e96d8644cc07777c58f0659
|
File details
Details for the file codex_rescue-0.1.0a1-py3-none-any.whl.
File metadata
- Download URL: codex_rescue-0.1.0a1-py3-none-any.whl
- Upload date:
- Size: 33.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb881f68940d64068c16913d485fbfbbc87aa97abaff99a892ba9b3acc3ed8fc
|
|
| MD5 |
77b0e3e2c0b0b2654cbe274b7fbd60d0
|
|
| BLAKE2b-256 |
ed779d1953e71a3e93fa8de0a6bc232cb2bc5d141776c88773f15067b7acb97b
|