Zsh Sessions

~/.zsh_sessions stores per-session Z shell history and restore data used by Terminal on macOS to track commands across shell sessions.

What is Zsh Sessions?

~/.zsh_sessions is a hidden folder in your home directory that stores Z shell session files on macOS. It is used when Terminal runs zsh and keeps per-session command history and related session state, so commands from separate Terminal windows or tabs can be tracked and merged. Users usually encounter this folder when checking disk usage, cleaning hidden files, or troubleshooting shell history behavior. The contents are not personal documents or app support files for a standalone app; they are shell session records tied to your user account. Removing the folder does not uninstall zsh or Terminal, but it can clear saved shell-session history and the folder may be created again the next time a Terminal zsh session starts.

Review files before deleting with diCleaner

Inspect caches, support files, folders, and related data before deleting items on Mac.

Download diCleaner

Safety overview

Status: Mostly safe

This folder contains shell session history, which can include commands you typed in Terminal and sometimes sensitive command lines. It is user-level data rather than a core system component. Deleting it is generally safe if your goal is to clear old session records, but you may lose per-session history or session restore behavior in Terminal, and macOS can recreate the folder during later zsh sessions.

Recommendation: Keep this folder if you want Terminal and zsh to retain session-level command history across windows or restarts. Remove it if you intentionally want to clear saved shell-session records or fix corrupted session files, knowing that Terminal may recreate the folder and you may lose older command history.

File path

  • ~/.zsh_sessions

Share your experience

Be the first to share your experience.

Share your experience with this file or folder