Integration · Google

Persistent memory for Gemini CLI

One command sets cachly up for Gemini CLI. Each session starts with a briefing from your project's memory, and lessons that match your prompt are added before the agent runs.

Set it up

  1. In your project folder, run:

    npx @cachly-dev/mcp-server@latest autopilot
  2. Sign in once in the browser when asked. If autopilot did not find Gemini CLI, set it up directly:

    npx @cachly-dev/mcp-server@latest init --editor gemini
  3. Start a new Gemini CLI session.

What happens automatically

Session start
A short briefing: the most useful lessons of this project.
Every prompt
Lessons that match the prompt are added before the agent runs (BeforeAgent hook).

On top of that, Gemini CLI can call the cachly tools itself, for example smart_recall before a task and learn_from_attempts after a fix.

Files cachly writes

.gemini/settings.json
The cachly MCP server and the hooks, merged into your existing settings.
.gemini/hooks/
The hook scripts.
GEMINI.md
Tells Gemini when to use its memory (only where a .gemini folder exists).

Limits

  • There is no hook at the end of a turn. Gemini stores lessons through the cachly MCP tool.

Frequently asked questions

Does cachly overwrite my Gemini settings?

No. cachly adds its server and hooks to .gemini/settings.json and keeps your other settings.

Where is my memory stored?

On cachly servers in Nuremberg, Germany. Your project files hold no key; the key comes from your environment or from ~/.cachly/credentials.json on your machine.

Can my other coding tools use the same memory?

Yes. A lesson stored from one tool is available in every other tool connected to the same Brain, and to teammates who share it. Claude Code, Cursor, GitHub Copilot, JetBrains, Codex CLI and Gemini CLI all read from one Brain.

More about cachly and Gemini CLI