Product case study · October 30, 2026

Gemini CLI Resume: Check the Chat Against Today's Files

Resume a specific Gemini CLI conversation, compare its remembered plan with a changed file, and keep evidence before authorizing more work.

Reading time
7 min
Checked
Oct 30, 2026
A blue conversation card emerging from a charcoal archive beside an ochre document and a magnifying glass on warm paper
Recover the conversation, then compare its assumptions with the current workspace.
Bottom line

Resume a known conversation, then reread the working files before letting an old plan drive new edits.

Yesterday’s conversation may contain a sensible plan for files that have changed today. Before asking a resumed coding agent to continue, give it a small reconciliation job: identify the old assumption, read the current file and explain the difference.

This exercise uses a release-review note whose day changes from Friday to Monday. You will create one planning conversation, exit, change the note yourself and resume the same conversation. The deliverable is a short discrepancy report with evidence, not a code change.

Sources checked October 30, 2026. This is a documentation-backed lab. We verified the local fixture and byte-comparison commands, but did not run an authenticated Gemini CLI conversation. The model responses described below are acceptance criteria for your run, not observed successes.

You need Bash, an installed and authenticated Gemini CLI, and a few minutes in a disposable directory. Use the synthetic note below so the exercise does not involve private project data.

Create a note and preserve its original bytes

Run this in a terminal and keep that shell open:

lab_root=$(mktemp -d /tmp/gemini-resume-lab.XXXXXX)
mkdir -p "$lab_root/project" "$lab_root/evidence"
cd "$lab_root/project"
cat > review.txt <<'NOTE'
Project: Lantern
Review day: Friday
Deliverable: a release checklist
NOTE
cp review.txt "$lab_root/evidence/review.original.txt"
printf 'Lab root: %s\n' "$lab_root"
gemini --version > "$lab_root/evidence/cli-version.txt"
gemini --help > "$lab_root/evidence/cli-help.txt"

Record the printed path. If you open another shell later, set lab_root to that actual path before continuing; do not run the setup again and accidentally create a different project.

Check the saved help for --list-sessions and --resume. If those options are unavailable, resolve the version mismatch before proceeding. The configuration reference documents these flags and accepts an index or full session UUID for resumption. This lab will use an explicitly selected session rather than whichever conversation happens to be newest.

Leave one recognizable planning conversation

Start gemini from the project directory. Retain your normal permission controls and submit:

This is the Lantern release-review planning exercise.
Read review.txt and report its project, review day and deliverable.
Propose three checklist items for that review. Do not create or edit files,
run shell commands, or contact external services. Stop after the plan.

Allow only the file read needed for this task. A prompt is a task instruction, not an operating-system access restriction; inspect any proposed tool action before approving it.

Confirm that the answer identifies Friday and the release checklist. Save the answer and the visible read result in the external evidence folder. If the agent cannot read the note, stop here: a later comparison needs a trustworthy starting point.

Exit using /quit. The command reference documents /quit and its /exit alias. Do not use an exit option that deletes the conversation.

Google’s session guide says conversations are saved automatically, with prompts, responses and tool activity. History is scoped to the project directory. From this same directory, list the saved sessions:

gemini --list-sessions

Find the Lantern planning conversation by its description and time. Record the displayed identifier and its identifying details beside the first answer. If the list does not make the intended entry clear, open Gemini and use /resume to inspect the session browser, then exit again. Do not guess an ID.

Change the source while Gemini is closed

In the original terminal, make the deliberate change yourself:

cat > review.txt <<'NOTE'
Project: Lantern
Review day: Monday
Deliverable: a release checklist
NOTE
cp review.txt "$lab_root/evidence/review.current.txt"
diff -u "$lab_root/evidence/review.original.txt" review.txt

The expected diff changes only Friday to Monday. For this command, exit status 1 means differences were found; status 0 means the intended change did not happen, and a higher status indicates an error. Inspect the diff instead of treating every nonzero status as the same outcome.

Do not ask Gemini to perform this edit. The useful condition is that the saved conversation has an old observation while the current file contains a new one.

Resume the selected session and require a fresh read

Run gemini --list-sessions again. Confirm the intended entry before selecting it. Copy its full UUID when available, or use its current listed index:

read -r -p 'Session UUID or current index: ' session_ref
if [ -n "$session_ref" ]; then
  gemini --resume "$session_ref"
fi

This prompt is a local shell prompt, not a request to paste an example identifier from this article. Avoid using an old numeric index after adding or removing sessions.

Inspect the restored conversation before sending more work. It should contain the Lantern request and Friday plan. Then submit this prompt without supplying the new day:

Before continuing, compare our earlier release-review plan with the
current review.txt. Read that file again now. Report the earlier review
day, the current review day, and whether the checklist needs its timing
updated. Name the file you read. Do not edit anything or run shell commands.
If the previous conversation or current file is unavailable, say so and stop.

The fresh read matters more than a confident answer. A response that happens to say Monday without visible evidence of reading the current file is insufficient for this exercise.

Evidence to retainAcceptance criterion
Restored conversationThe intended Lantern plan is present, including its Friday assumption.
New tool resultA fresh read of review.txt shows Monday.
Discrepancy reportThe answer separates the old day from the current day and identifies the needed timing update.
File comparison after exitThe agent has left the Monday version unchanged.

These criteria check one controlled handoff. They do not establish that an agent will detect every stale assumption in a larger repository.

Verify the file and handle a failed comparison

Exit Gemini, then run:

if cmp "$lab_root/evidence/review.current.txt" "$lab_root/project/review.txt"; then
  printf 'PASS: review.txt still matches the Monday fixture.\n'
else
  printf 'FAIL: review.txt differs or could not be read.\n'
fi

This checks the named fixture only; it is not an audit of every possible filesystem change. Save the result with both answers and the session identifier.

If the wrong conversation appears, exit and inspect the session list from the original project path. If the conversation is correct but the answer still says Friday, check whether the agent actually reread the file. Request that read once; if the discrepancy remains unresolved, record a failed or inconclusive run and stop before authorizing edits.

If the file changed unexpectedly, preserve its contents in your evidence folder before manually replacing it with review.current.txt. Label that action as manual recovery. Do not describe it as Gemini restoring the file.

A missing older session may involve retention settings. The configuration reference lists automatic cleanup as enabled by default with a 30d maximum age, plus a configurable session-count limit. Check effective settings rather than overwriting your configuration to match a tutorial. Keep important decisions in reviewed project artifacts as well as chat history.

Apply the same check before continuing real work

For an actual coding task, replace the single note with a small set of files that the earlier plan depends on. Ask for a discrepancy report first, review it yourself, and only then authorize the next bounded edit. Keep the commit or diff you reviewed with that decision.

Conversation resumption and file rollback serve different purposes. Google’s checkpointing guide documents project snapshots taken before supported AI file edits and /restore for recovery. If you need to practice undoing an edit, use the separate checkpoint-restore lab. Here, success means recognizing Monday while preserving the current file.

Sources checked October 30, 2026

Put this to work

Separate remembered decisions from evidence about the current files.

Try

Resume a disposable planning session after changing its review date locally.

Prove it worked

Keep the session identity, old plan, fresh file read and unchanged-file comparison together.

Keep in view

  • Identify the intended saved conversation before continuing work.
  • Introduce one controlled file change while Gemini is closed.
  • Require a fresh read and a discrepancy report before allowing edits.
Learn the workflow: Turn a project brief into checkable acceptance criteria