save-session

save-session is a command for Claude Code from wangke19/gemini-ai-helpers. It costs 10 tokens per session (1,130 once invoked), scanned A, original, Apache-2.0.

A command that saves the current coding session as a Markdown file for later continuation. The file records conversation context, decisions, changed files, and commands.

In plain words
What is it for?
Use it to create a handoff or restart document for continuing technical work after an interruption.
Why use it?
It preserves the reasoning and working details that are easy to lose when a project is paused for days or weeks.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: mentions Gemini CLI.

Good fit Use it to create a handoff or restart document for continuing technical work after an interruption.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/wangke19/gemini-ai-helpers/save-session
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/wangke19/gemini-ai-helpers

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for save-session

README.md
[![agentmods](https://agentmods.dev/badge/commands/wangke19/gemini-ai-helpers/save-session/github.svg)](https://agentmods.dev/commands/wangke19/gemini-ai-helpers/save-session)
Your own site
<a href="https://agentmods.dev/commands/wangke19/gemini-ai-helpers/save-session"><img src="https://agentmods.dev/badge/commands/wangke19/gemini-ai-helpers/save-session/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for save-session

Your own site · 80×15
<a href="https://agentmods.dev/commands/wangke19/gemini-ai-helpers/save-session"><img src="https://agentmods.dev/badge/commands/wangke19/gemini-ai-helpers/save-session.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 10 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,130 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00010 $0.01130
Opus 5 $0.00005 $0.00565
Sonnet 5 $0.00002 $0.00226
Haiku 4.5 $0.00001 $0.00113

Measured 9d ago against content hash b3a9929023fc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

save-session scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

extensions/session/commands/save-session.md · 139 lines

How it starts

The opening of the file, as written. The whole thing — 139 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Name

session:save-session

Synopsis

/save-session
/save-session [description]

Description

Saves the current conversation session to a comprehensive markdown file that enables seamless resumption of work after extended time intervals (days, weeks, or months).

This command addresses limitations of Gemini CLI's built-in session management by capturing:

  • Complete conversation context and technical rationale
  • Detailed file modification tracking with line numbers
  • Key technical decisions and alternatives considered
  • Commands executed during the session
  • Clear resumption instructions

The generated session file is designed for engineers working across multiple projects with long gaps between sessions, providing all necessary context to continue work without losing momentum.

Implementation

The command follows a five-phase process:

Phase 0: Input Sanitization

If a description argument is provided, sanitize it for safe filename usage:

  • Convert all spaces to hyphens
  • Convert to lowercase
  • Remove or replace special characters (keep only alphanumeric, hyphens, and underscores)
  • Truncate to 100 characters maximum if longer
  • Example: "investigating OCPBUGS-12345 regarding routes" → "investigating-ocpbugs-12345-regarding-routes"

Phase 1: Context Analysis

  • Summarizes main topics and goals discussed
  • Lists all accomplishments and completed tasks
  • Identifies all files that were read, modified, or created
  • Extracts important technical decisions and their rationale
  • Captures any error messages encountered and how they were resolved
  • Notes any commands that were run (make, linter, tests, etc.)

Phase 2: File Modification Tracking

  • Reads and verifies current state of modified files
  • Lists specific line numbers and code changes
  • Includes before/after comparisons for critical changes
  • Notes which files were created vs modified vs deleted
  • Tracks any generated files (like bindata)

Phase 3: Session File Creation

Creates a comprehensive markdown document with these sections:

Read the full file on GitHub · 139 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 139 lines · 10 tokens per session scan A b3a9929023fc

Subscribe to this mod's changes

save-session is a command published in the GitHub repository wangke19/gemini-ai-helpers (2 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 10 tokens to every session and 1,130 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.