Gemini CLI disk usage on macOS: the ~/.gemini folder explained and safely cleaned

Gemini CLI (Google's open-source terminal agent) is lightweight by design, but it is not zero-footprint. Everything it persists lands in a single folder — ~/.gemini — and after weeks of daily agent sessions that folder can hold hundreds of megabytes of session artifacts you will never look at again.

What is inside ~/.gemini

EntryWhat it isSafe to delete?
settings.jsonYour configuration (model, theme, sandbox)No
oauth_creds.jsonGoogle login tokenNo — deleting means re-login
tmp/Per-session working data, shell snapshots, tool outputsYes — old session dirs only
install-metadata.json, google_accounts.jsonSmall bookkeeping filesLeave them

Measure it first

du -sh ~/.gemini/* | sort -h

The tmp directory is almost always the biggest line. Each agent run creates a subdirectory with the shell state and captured output; nothing prunes it automatically.

Safe cleanup: keep the last week, drop the rest

find ~/.gemini/tmp -maxdepth 1 -type d -mtime +7 -not -path ~/.gemini/tmp -exec rm -rf {} +

Run it as a dry check first by replacing -exec rm -rf {} + with -print to list what would go. Sessions older than a week lose their resumable context — if you rely on long-running checkpointed sessions, keep 30 days (-mtime +30) instead.

The other grower: the npm install itself

Gemini CLI installs through npm, and npm update -g @google/gemini-cli leaves previous versions behind in the global node_modules. A one-time npm cache clean --force plus checking npm ls -g for stale globals typically reclaims another few hundred MB — details in our npm/npx cache cleanup guide.

Put it on autopilot

The same pattern applies to every terminal AI tool: Claude Code has its own transcript folder, Ollama keeps multi-GB models, Gemini CLI has session tmp. Check the full cleanup hub for the per-tool breakdown — and if you want the whole disk surveyed at once, DaisyDisk's sunburst map remains the fastest way to see where the gigabytes went.