zcompdump files should prrobably be stored in $ZSH_CACHE_DIR
Author: evertCreated Nov 1, 2025Updated Sep 16, 2026
LabelsFeature
If the feature request is for a plugin or theme, specify it here.
No response
If the feature solves a problem you have, specify it here.
oh-my-zsh.sh defines a $ZSH_CACHE_DIR that uses XDG_CACHE_HOME (awesome)
# Set ZSH_CACHE_DIR to the path where cache files should be created
# or else we will use the default cache/
if [[ -z "$ZSH_CACHE_DIR" ]]; then
ZSH_CACHE_DIR="$ZSH/cache"
fi
# Make sure $ZSH_CACHE_DIR is writable, otherwise use a directory in $HOME
if [[ ! -w "$ZSH_CACHE_DIR" ]]; then
ZSH_CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/oh-my-zsh"
fi
But then later in this file this is not used by zcompdump (which feels like it fits the definition of cache file)
# Save the location of the current completion dump file.
if [[ -z "$ZSH_COMPDUMP" ]]; then
ZSH_COMPDUMP="${ZDOTDIR:-$HOME}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
fi
Describe the proposed feature.
Cleaning up by home directory
Describe alternatives you've considered
No response
Additional context
No response
Related Issues
No response
Source: ohmyzsh/ohmyzsh