agentleFS
wufei-pngwufei-png/skills/skills/productivity/codex-session-recovery/SKILL.md

codex-session-recovery

Skill1 starsChanged 4 days agoMITView on GitHub

Find local Codex sessions read-only and provide CLI recovery commands. Use for missing history, prior thread lookup, resume or fork help, and explicitly requested Desktop visibility.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read local Codex JSONL only.

    line 13
  2. Very specific:

    Never edit $CODEX_HOME, SQLite-backed state, rollout files, or provider or account metadata.

    line 15
  3. Distinctive:

    Do not create or manage Desktop threads unless the user explicitly requests Desktop visibility.

    line 16
  4. Very specific:

    Use the bundled scanner. Resolve <skill-directory> from this loaded skill's location.

    line 20
  5. Very specific:

    Use --help for all options.

    line 39

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Codex Session Recovery

Recover access to local Codex history without mutating live state by default.

Safety

  • Read local Codex JSONL only. Prefer copied fixtures or temporary copies for testing.
  • Exclude archived and subagent sessions unless requested. Show only short prompt snippets unless the user requests more.
  • Never edit $CODEX_HOME, SQLite-backed state, rollout files, or provider or account metadata. Never copy or import JSONL into live Codex state.
  • Do not create or manage Desktop threads unless the user explicitly requests Desktop visibility. A Codex Desktop context is not enough.

Find sessions

Use the bundled scanner. Resolve <skill-directory> from this loaded skill's location; do not assume it is installed under $CODEX_HOME/skills.

python "<skill-directory>/scripts/scan_codex_sessions.py" \
  --codex-home "${CODEX_HOME:-$HOME/.codex}" \
  --cwd "/Users/example/project" \
  --since "2026-06-10" \
  --timezone "Asia/Shanghai" \
  --format table

From this repository checkout:

python skills/productivity/codex-session-recovery/scripts/scan_codex_sessions.py \
  --codex-home /tmp/copied-codex-home \
  --format json

Use --help for all options. The main filters are --cwd, --since, --until, --timezone, and --query; archived sessions, subagents, prompt snippets, unknown-time records under date filters, and index-referenced paths require explicit flags (--include-archived, --include-subagents, --show-prompts, --include-unknown-time, and --show-paths). Prefer JSON when another tool consumes the result.

The index or transcript filename provides the canonical thread id; other observed id, thread_id, or session_id values are reported as aliases and merged into that record. Report its thread name, cwd, time, archived or subagent status, match_score and matching_reasons as given, source path, and exact codex resume and codex fork commands. The score ranks candidates within one search; it is not a probability or percentage and may exceed 100. The JSON field was renamed from confidence to match_score, with no old-field alias. If nothing matches, state the filters and suggest relaxing one at a time.

Desktop visibility

A Codex Desktop context is not enough. When the user explicitly requests Desktop visibility and the candidate is unique or already selected, follow references/desktop.md. If the candidate is ambiguous, ask the user to choose first. Otherwise remain CLI-first.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.