How to clear Gemini CLI cache on Mac

By AI Agent Clean Team · Published 2026-08-09 · Last updated 2026-08-09 · macOS 14+

Gemini CLI stores regenerable temp/cache data under ~/.gemini. Chat JSON trees and OAuth files need care. This guide separates safe cleanup from protected paths on macOS 14+.

Try free for 7 days

Do not confuse home-directory ~/.gemini with project-local .gemini/ folders inside repositories. AI Agent Clean scans the CLI home directory only — not workspace project trees.

Why Gemini CLI cache grows

  • tmp workspaces — ephemeral files under ~/.gemini/tmp.
  • cache trees — regenerable model/tool artifacts under ~/.gemini/cache.
  • Mixed chat trees — chat JSON can live under tmp hashes; those need exclusion when cleaning cache.

Gemini CLI path table (macOS)

PathTypical contentsSafe to clear?
~/.gemini/tmp/ (excluding chats)Ephemeral cacheYes
~/.gemini/cache/Regenerable cacheYes
~/.gemini/tmp/**/chats/**CLI chatsKeep (confirm if removing)
~/.gemini/settings.jsonPreferencesKeep
~/.gemini/oauth_creds.jsonOAuthKeep
~/.gemini/google_accounts.jsonAccountsKeep
Project .gemini/ inside reposProject-local configDo not bulk-delete as “system cache”

Exit Gemini CLI before deleting. Prefer Trash. Nested chats folders under tmp are session-like — leave them alone for a safe cleanup.

Step-by-step: manual Gemini CLI cache cleanup

  1. Exit Gemini CLI — stop active sessions in your terminal.
  2. Open ~/.gemini — in Finder use Go to Folder, or du -sh ~/.gemini/* in Terminal.
  3. Clear regenerable cache — remove safe contents under cache and non-chat debris under tmp.
  4. Skip chats and auth — leave **/chats/**, settings.json, and oauth/account files.
  5. Rerun gemini — confirm login still works and caches rebuild as needed.

FAQ

Is it safe to clear Gemini CLI cache on Mac?

Yes for regenerable tmp/cache data when chat trees are excluded. Keep settings and OAuth files.

Where is Gemini CLI cache stored on macOS?

Under ~/.gemini — typically tmp and cache. Project-local .gemini/ folders are separate.

Will cleaning Gemini CLI delete my chats?

Not if you leave tmp/**/chats/** alone. AI Agent Clean protects chats path segments by default.

Automated cleanup with AI Agent Clean

v1.0.1 includes Gemini CLI in AI Agent Cleaner: regenerable cache defaults on; chats require explicit selection and a second safety filter before Trash.

  1. Open AI Agent Clean and expand Gemini CLI.
  2. Confirm chat categories stay unchecked.
  3. Clean selected caches — Trash by default.

See pricing for trial details.

Safety warnings
  • Never wipe all of ~/.gemini in one shot.
  • Do not delete oauth/account files unless you plan to re-authenticate.
  • Do not mass-delete project .gemini/ folders inside git repos.

Related guides and features

Preview Gemini CLI cache sizes locally — no cloud upload.

Try free for 7 days

Start 7-day free trial on the Mac App Store

Scan free. Start a 7-day full-feature trial on the Mac App Store.

Try free for 7 days