claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Claude complains about zsh compinit at startup, and I can't type anything

Open cmf opened this issue 5 months ago • 2 comments

Environment

  • Platform (select one):
    • [X] Anthropic API
    • [ ] AWS Bedrock
    • [ ] Google Vertex AI
    • [ ] Other:
  • Claude CLI version: 1.0.22 (Claude Code)
  • Operating System: macOs 15.5
  • Terminal: iTerm2

Bug Description

I just updated Claude Code. Whenever I run it now, I get output like:

~/d/scraper-benchmark> claude
zsh compinit: insecure directories, run compaudit for list.
Ignore insecure directories and continue [y] or abort compinit [n]? ╭───────────────────────────────────────────────────╮
│ ✻ Welcome to Claude Code!                         │
│                                                   │
│   /help for help, /status for your current setup  │
│                                                   │
│   cwd: /Users/colin/dev/scraper-benchmark         │
╰───────────────────────────────────────────────────╯


 ※ Tip: Run claude --continue or claude --resume to resume a conversation

╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ > Try "refactor <filepath>"                                                                                                                                                                   │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
  ? for shortcuts

Notice the zsh compinit error, which seems to be waiting for input. I'm not using zsh, I'm using fish. I can't seem to enter y or n to make that go away, and I also cannot type anything into Claude. If I type I get some transient input buffer at the bottom of the screen, but I can't use it. Enter also always enters a newline rather than sending my query.

Steps to Reproduce

  1. Just start Claude

Expected Behavior

Claude works.

Actual Behavior

I can't input anything

Additional Context

cmf avatar Jun 12 '25 22:06 cmf

Looks like your zsh configurations are messed up. Check if everything is alright inside your ~/.zshrc file.

RaiAnsar avatar Jun 12 '25 22:06 RaiAnsar

I'm not using zsh, I'm using fish.

cmf avatar Jun 12 '25 22:06 cmf

I am running into the same problem. It does not happen everytime, but once it starts happening I need to restart Terminal.app. Also using fish.

t089 avatar Jul 16 '25 12:07 t089

I'm having a similar issue but what I can tell is that Claude is running things in the background which is call my .zshrc file again. This is giving me issues. This is the closet thread where people are talking about it.

It needs to not call the file again and should be fine but I can't find anything about it or looking in the wrong place.

ghost avatar Jul 28 '25 15:07 ghost

you probably need to add a few lines to your .zshrc file. I had the same problem for a while. This article helped me fix the problem.

Long story short: If you add something along the lines of

for file in $(compaudit); do
  sudo chmod 755 $file
  sudo chmod 755 $(dirname $file)
  sudo chown $(whoami) $file
done

to your .zshrc it should be resolved

michak97 avatar Aug 06 '25 07:08 michak97