gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

feature request: Give Gemi CLI basic memory in between reboot

Open haden111 opened this issue 1 year ago • 2 comments

What happened?

I think it would be extremely useful if the CLI program recorded changes made after each request and stored them in a changelog file. I've experienced numerouis instaances of the CLI either getting stuck in a loop and requiring reboot or else I've gone over quota and had to swp to the Gemini Flash model which makes you repeat the previous request. It would therefore be extremely useful if the CLI was able to keep state in between sessions, or at least be aware of the la\st request made and what caused a potential crash/neverendung loop so as to avoid such pitfalls and also be able to seamlessly pick up where it left off if requests were mid way through completion or be abke to undo recent changes instead of having the LLM check the code base and guess what actions were last taken and the reasons for partricuylar decision made in the code - such insights are missing currently which makes using tne CLI cumbersome and inefficient. It woul;dn;t be a massive /complicated feature to implement and would seemj to be a natural extension iof the cli tool which at presdent loses context of progress nd state of thd project and wastes time requriing user input to brief the LLM every reboot.

What did you expect to happen?

remember change history and be able to avoid crash loops, provide ongoing changelog which is automatically loaded into memory on boot

Client information

  • CLI Version: 0.1.18
  • Git Commit: cd7e60e0
  • Operating System: win32 v22.17.1
  • Sandbox Environment: no sandbox
  • Model Version: gemini-2.5-flash
  • Memory Usage: 165.2 MB

Login information

API Key

Anything else we need to know?

No response

haden111 avatar Aug 10 '25 10:08 haden111

This is a great feature request. Currently Gemini CLI starts fresh each time, but basic memory between sessions would be very useful.

A few approaches could work:

  1. Auto-save last N messages:
  • Save last 10-20 messages automatically
  • Load them when CLI restarts in same directory
  • Use /memory commands to manage
  1. Extend existing /chat system:
  • Auto-save current session on exit
  • Auto-resume if saved session exists in directory
  • Add /memory auto on/off toggle
  1. Project-specific memory:
  • Store .gemini/memory.json in project root
  • Include recent changes, context, ongoing work
  • Automatic changelog integration

The /chat save/resume commands exist but require manual management. This request is for automatic persistence which would be much more user-friendly.

Would need to balance memory size vs. token usage for optimal performance.

shivas1432 avatar Aug 10 '25 11:08 shivas1432

Currently this has to be done manually with /chat save and /chat load. We are investigating ways of doing it automatically but it may conflict with people's expectations for running the tool.

scidomino avatar Aug 18 '25 21:08 scidomino