Editor’s Notice: This new function was made potential by Christopher Beeson, an excellent open supply contributor within the Gemini CLI group. His meticulous work throughout nine-plus well-crafted pull requests have been instrumental in bringing this to fruition.
Context is all the things when working with Gemini CLI. Whether or not you might be refactoring a fancy codebase or debugging a tough error, your dialog historical past comprises useful reasoning, instrument outputs, and choices.
Beforehand, closing your terminal meant shedding that context. Beginning over required re-explaining the issue to the mannequin. That is not the case, Gemini CLI now robotically saves your classes and allows you to search by means of your session historical past to renew proper the place you left off!
Computerized Saving: Peace of thoughts
Each time you work together with Gemini CLI, your session is now robotically saved within the background. You needn’t bear in mind to save lots of or export your chat; we deal with it for you with our new Session Administration system.
We seize the whole state of your work, together with:
- Your prompts and the mannequin’s responses.
- All instrument executions (inputs and outputs).
- Token utilization statistics.
- Assistant ideas and reasoning summaries.
Crucially, these classes are project-specific. When you swap directories to a unique undertaking, Gemini CLI robotically switches context to that undertaking’s session historical past, making certain Gemini CLI is at all times on the identical web page as you.
Resuming Classes
We now have made it extremely simple to leap again right into a earlier workflow, whether or not you like command-line flags or our interactive UI.
The Interactive Session Browser
Inside Gemini CLI, you possibly can merely sort /resume to open the brand new Session Browser.
This interactive interface means that you can:
- Browse: Scroll by means of a chronologically sorted listing of your previous classes.
- Preview: See particulars like message counts and 1-line abstract to establish the fitting chat.
- Search: Press / to filter classes by ID or content material key phrases.
- Choose: Press Enter to immediately restore the complete context of that dialog.
Command Line Energy
For individuals who choose flags, you possibly can resume classes proper from the beginning while you launch Gemini CLI.
- Resume newest: gemini –resume will instantly load your most up-to-date session.
- Resume particular session: gemini –resume 5 (by index) or gemini –resume
(by session ID).
You’ll be able to listing all obtainable classes on your present undertaking as properly:
Out there classes for this undertaking (3):
1. Repair bug in auth (2 days in the past) [a1b2c3d4]
2. Refactor database schema (5 hours in the past) [e5f67890]
3. Replace documentation (Simply now) [abcd1234]
Plain textual content
Managing your Historical past
With nice energy comes nice duty… or on this case, a number of historical past recordsdata! We’ve added the instruments that can assist you maintain your surroundings clear.
To forestall your historical past from rising indefinitely, you possibly can allow automated cleanup insurance policies in your settings.json configuration file.
{
"common": {
"sessionRetention": {
"enabled": true,
"maxAge": "30d", // Maintain classes for 30 days
"maxCount": 50 // Maintain the 50 most up-to-date classes
}
}
}
JSON
Monitoring your Gemini CLI utilization
With detailed message, thought, instrument name, and token utilization data being recorded robotically, now you can analyze your Gemini CLI utilization. You should utilize group developed instruments like Splitrail, or develop your personal!
Get began as we speak
Session administration is out there in Gemini CLI and on by default as of v0.20.0+.
All you should do is replace to be sure to can make the most of the brand new function:
npm set up -g @google/gemini-cli@newest
Plain textual content







