zsh compinit: insecure directories macOS Origin: Platform & cloud OSI layer 7 · Application Last updated 5 Nov 2026

zsh: compinit: insecure directories, run compaudit for list. Ignore insecure directories and continue [y] or abort compinit [n]?

zsh refuses to load completions from directories owned by another user or writable by others.

Exact message you may see zsh compinit: insecure directories, run compaudit for listzsh: compinit: insecure directoriesIgnore insecure directories and continue [y] or abort compinit [n]?[oh-my-zsh] Insecure completion-dependent directories detected
Seen on: macOS

Meaning

Run compaudit to list them, then fix with compaudit | xargs chmod g-w,o-w (and chown if owned by another user). Typical after Homebrew was installed with different ownership. Using compinit -u skips the check but is less secure.

Common causes

  • Homebrew share/zsh directories group-writable
  • Directories owned by root or another user
  • Oh My Zsh folder permissions
  • Shared machine/user switch
  • Restored backups with different owner

⚡ Quick fix

  1. compaudit | xargs chmod g-w,o-w
  2. sudo chown -R $(whoami) $(brew --prefix)/share/zsh
  3. As a last resort compinit -u in .zshrc

Detailed fix by platform

macOS

  1. compaudit lists insecure paths

How to diagnose

  1. Paths — compaudit output?
  2. Owner — Your user?
  3. Perms — Group/other writable?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

Argument list too long — bash: /bin/rm: Argument list too long (Linux)Argument list too longcommand not found — bash: command not found (Linux)command not foundexecutable file not found in $PATH — OCI runtime create failed: exec: "x": executable file not found in $PATH (Docker)executable file not f…Homebrew Cask: It seems there is already an App at — Homebrew: Error: It seems there is already an App at '/Applications/Chrome.app' (macOS)Homebrew Cask: It see…Homebrew: No available formula with the name — Homebrew: Error: No available formula with the name "x". Did you mean ...? (macOS)Homebrew: No availabl…Homebrew: Permission denied @ dir_s_mkdir — Homebrew: Error: Permission denied @ dir_s_mkdir - /usr/local/Cellar / /opt/homebrew is not writable (macOS)Homebrew: Permission …Your Command Line Tools are too outdated — Homebrew: Error: Your Command Line Tools (CLT) are too outdated. Update them from Software Update / Please update to the latest macOS (macOS)Your Command Line Too…zsh: bad CPU type in executable — macOS (Apple Silicon): zsh: bad CPU type in executable: ./tool (macOS)zsh: bad CPU type in …zsh compi…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.