gemini-cli-session
Gemini CLI Session
Use this skill when the user wants the primary agent to send a prompt to Gemini CLI against an existing Gemini session, so Gemini keeps the prior conversation history.
Do not use wrapper scripts. Run Gemini CLI directly.
Default to --approval-mode auto_edit so Gemini CLI can use its own write_file and replace tools without interactive approval.
Use the project-root .gemini-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.
If .gemini-cli-session-id does not exist, first look up the current project's local Gemini history under ~/.gemini/tmp/<project_hash>/logs.json and recover the latest sessionId. Write that value into .gemini-cli-session-id.
If the project has no local Gemini session history yet, start a fresh headless run only for session bootstrap, capture the session_id from the init event in stream-json, and immediately persist it into .gemini-cli-session-id. After that, run the real user task by reading the session ID from .gemini-cli-session-id and using gemini -r.
Workflow
- Read
<project-root>/.gemini-cli-session-idfirst.
More from erdinccurebal/cli-session-skills
claude-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.
4codex-cli-session
Use when the user wants Codex CLI session continuity across repeated non-interactive runs. Read the session ID from a project-root `.codex-cli-session-id` file when available; otherwise bootstrap a new Codex session, persist the new session ID, and then run the real task with `codex exec resume`. Covers session continuity, `--json`, `-m`, and project-scoped session pinning.
4