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.
| Entry | What it is | Safe to delete? |
|---|---|---|
settings.json | Your configuration (model, theme, sandbox) | No |
oauth_creds.json | Google login token | No — deleting means re-login |
tmp/ | Per-session working data, shell snapshots, tool outputs | Yes — old session dirs only |
install-metadata.json, google_accounts.json | Small bookkeeping files | Leave them |
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.
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.
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.
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.