The short answer
- 01
Careful. The name says tmp, but the chats you can resume live here.
- 02
Gemini CLI writes it into one folder per project, with chats, logs and checkpoints.
- 03
It can get huge. A public issue reports 46 GB, nearly all in tmp, with chat files around 18 MB each.
- 04
Gemini CLI can expire chats itself with general.sessionRetention, 30 days by default per its docs. Older versions lack it.
- 05
Never delete tmp/bin (Gemini's own tools), settings.json or the sign-in files.
See its real size on your Mac. Hoardless measures this folder and previews the delete.Download free trial
What is ~/.gemini/tmp?
It is Gemini CLI's per-project temporary folder. Google's session management docs say sessions are saved in ~/.gemini/tmp/<project_hash>/chats/. In the Gemini CLI source (packages/core/src/config/storage.ts), each project gets a folder tmp/<project id>/ with these parts:
chats: saved chat sessions, one JSON file each.logsandcheckpoints: per-project logs and saved checkpoints.tmp/bin: Gemini's own tools. It is not project data.
Older versions name project folders with a 64-character hash of the project root, newer ones with a short id. Settings and sign-in are not in tmp: they sit directly in ~/.gemini. If GEMINI_CLI_HOME is set, the .gemini folder lives under that instead of your home.
What writes it and why does it grow?
Gemini CLI saves every chat session. The public issue google-gemini/gemini-cli#21652 reports ~/.gemini/tmp at 46 GB, nearly all of a 46 GB ~/.gemini, with many session-*.json files of about 18 MB each. A linked issue says session logs store large inline base64 binary data. The issue is closed as completed, and the page does not say what fixed it.
The docs describe a retention setting, general.sessionRetention, with a default maximum age of 30 days. Hoardless's detector notes it only exists in newer versions, so an older install can keep chats forever.
How big does it get?
It follows how long you have used Gemini CLI and how heavy your chats are. Check yours:
du -sh ~/.gemini/tmp/* | sort -h | tail -10
Shows the ten project folders with the most data. Removes nothing. If you set GEMINI_CLI_HOME, measure that folder's .gemini/tmp instead.
find ~/.gemini/tmp -path '*/chats/*' -size +10M -mtime +30
Lists chat files over 10 MB not written in 30 days. Removes nothing.
Is it safe to delete ~/.gemini/tmp?
| What | Verdict | What you lose |
|---|---|---|
Old files in logs | Safe | Old log history. |
Old chats in chats | Careful | Those chats can no longer be resumed. |
Old files in checkpoints | Careful | Those saved checkpoints. |
| The newest chat in each project | Careful | The chat you most likely resume next. Hoardless always keeps it. |
tmp/bin | Never | Gemini's own tools, which it may need to run. |
Settings, sign-in, GEMINI.md, extensions, commands, skills | Never | These are outside tmp and are your setup. |
How do I clean up ~/.gemini/tmp?
Use Gemini CLI's own tools first. To delete one session, the docs give gemini --delete-session <index or ID>, or open /resume, select the session and press x. To expire old chats automatically, set general.sessionRetention on a version that supports it.
The manual way: quit Gemini CLI, then move old chat files from the check above to the Trash. Deleting by hand skips the CLI's own bookkeeping, so prefer its commands for single sessions.
What Hoardless does: its Gemini CLI detector reads GEMINI_CLI_HOME, else your home, and lists one Confirm row per project holding chats, logs and checkpoints older than 30 days. The newest chat of each project always stays, so it can still be resumed. It skips symlinks. It never touches tmp/bin, settings, sign-in, GEMINI.md files, extensions, commands, skills, per-session plan and task folders, or anything else in a project folder. Everything goes to the Trash with an undo log.
What comes back and when?
Your next session writes a new chat file, so the folder starts growing again. Deleted chats do not come back unless you restore them from the Trash.
Old Gemini CLI chats, the newest of each project kept
Hoardless lists Gemini CLI chats, logs and checkpoints older than 30 days per project (Confirm tier), keeps the newest chat, never touches tmp/bin or your settings, and moves what you pick to the Trash with an undo log.
14-day full trial. macOS 14 or later.
Questions
Where does Gemini CLI save chats?
Gemini CLI's session management docs say sessions are saved in ~/.gemini/tmp/PROJECT_HASH/chats/, where the hash identifies your project's root folder.
Can Gemini CLI delete old chats by itself?
Yes, in versions that have it. The docs describe general.sessionRetention with enabled, maxAge, maxCount and minRetention, and a default maximum age of 30 days. Check that your version supports it.
How do I delete one chat the supported way?
The docs list gemini --delete-session with an index or an ID, or running /resume, selecting the session and pressing x.
Does GEMINI_CLI_HOME change the folder?
Yes. In the Gemini CLI source the home folder is GEMINI_CLI_HOME when set, else your user home, and the tmp folder is under .gemini there.
Does retention run by default, and what does deleting a session remove?
Per the docs, general.sessionRetention.enabled defaults to true, and deleting a session also removes its implementation plans, task trackers, tool outputs and activity logs.
Will deleting tmp sign me out?
No. Settings, sign-in files and GEMINI.md sit directly in ~/.gemini, not in tmp. Do not delete those.
New guides by email
New guides and Hoardless releases, twice a month at most.
Confirm first. Unsubscribe in one click. Privacy.