# Save Session Id

> Save the active Codex session ID before a conversation ends so the user can later resume. Use at the end of every Codex session, before final responses that finish, pause, hand off, or close work, and when asked to preserve or recover session continuity.

- Skill: `just1cup/save-session-id` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add just1cup/save-session-id`
- Raw SKILL.md: https://api.skillmd.com/api/skills/just1cup/save-session-id/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: Just1cup (https://skillmd.com/u/just1cup)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/just1cup/save-session-id

---


# Save Session ID

## Overview

Use this skill to keep a durable pointer to the current local Codex session.
It records the session ID, transcript path, working directory, and save time so
the user can recover the conversation later without remembering the ID.

## End-Of-Session Workflow

Before the final response of any session that is ending, pausing, handing off,
or preserving work:

1. Run the saver from the current working directory:

```bash
python3 /home/tintas/.codex/skills/save-session-id/scripts/save_session_id.py --reason final --cwd "$PWD"
```

2. If the task changed code or project understanding, run any relevant project
   memory update first, then run this saver last.
3. If sandbox permissions block writes to `~/.codex`, rerun the same command
   with approval/escalation instead of saving somewhere else.
4. Include the saved session ID in the final response when the user asked for
   session continuity or when it helps them resume.

## Saved Files

The saver writes:

- `~/.codex/last-session.json`: the latest saved session pointer.
- `~/.codex/session-checkpoints.jsonl`: append-only history of saved pointers.

Do not store full transcript contents in these files. The transcript path is
enough for local recovery.

## Recovery Commands

Show the latest saved pointer:

```bash
python3 /home/tintas/.codex/skills/save-session-id/scripts/save_session_id.py --show-last
```

Show recent saved pointers:

```bash
python3 /home/tintas/.codex/skills/save-session-id/scripts/save_session_id.py --history 10
```

