codex-cli-session
Codex CLI Session
Use this skill when the user wants Codex CLI to continue work through a pinned project session instead of starting a fresh session every time.
Use the project-root .codex-cli-session-id file as the primary source of truth for the session to resume.
The main user task must never run without an active session ID.
Do not use wrapper scripts. Run Codex CLI directly.
Workflow
- Read
<project-root>/.codex-cli-session-idfirst. - If the file exists and contains a valid session ID, use that value for the real Codex command.
- If the file is missing or empty, bootstrap a fresh Codex session with a short prompt that tells Codex to inspect the current directory and get ready to continue work in this project.
- After bootstrapping, recover the newest session ID from
~/.codex/session_index.jsonland write it into.codex-cli-session-id. - If bootstrap fails and
.codex-cli-session-idstill does not contain an active session ID, do not run the main user prompt. Report the failure and stop. - Only after
.codex-cli-session-idcontains an active session ID, run the real user task withcodex exec resume. - Keep the user's prompt text exact unless they explicitly ask you to rewrite it.
More from erdinccurebal/cli-session-skills
gemini-cli-session
Use when the user wants the primary agent to call Gemini CLI directly while preserving an existing Gemini conversation history. Read the session ID from a project-root `.gemini-cli-session-id` file when available; otherwise recover the latest project session from local Gemini history or create a new session, then persist that ID. Use `--approval-mode auto_edit` by default so Gemini CLI can write files with its own edit tools. Covers `-r <session-id>`, `-p`, `-m gemini-3-flash-preview`, and `stream-json` output handling.
5claude-cli-session
Use when the user wants Claude Code session continuity across repeated CLI runs. Read the session ID from a project-root `.claude-cli-session-id` file when available; otherwise create a new UUID-backed Claude session, persist that ID, and then run the real task through the same pinned session. Covers `--resume`, `--session-id`, `-p`, `--output-format stream-json`, `--permission-mode acceptEdits`, and optional `ollama launch claude --model ...` integration.
4