[Bug] Claude Code does not properly handle zsh shell initialization and environment setup

Resolved 💬 2 comments Opened Feb 25, 2026 by jswright61 Closed Feb 25, 2026

Bug Description
claude is not behaving well with my zsh shell. I spent a lot of time trying to get claude to properly load eval "$(/opt/homebrew/bin/rv shell init zsh)" which is necessary to run the correct Ruby version and access installed gems for that version. I ended up instructing Claude to prepend each shell command with eval "$(/opt/homebrew/bin/rv shell init zsh)" which because of the eval, required explicit permission for each command. When I complained, it wanted me to add lines to .bash_profile, when that didn't work it wanted me to create and add the rv line to .zshenv. There are implications to adding to .zshenv. this whole process should be easier and not leave artifacts that can affect performance elsewhere in my system.

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 2.1.52
  • Feedback ID: 24799fd3-5d33-42f1-8a9a-d80fa49b50b1

Errors

[{"error":"Error: ENOENT: no such file or directory, open '/Library/Application Support/ClaudeCode/managed-settings.json'\n    at openSync (unknown)\n    at readSync (/$bunfs/root/claude:12:1441)\n    at F2 (/$bunfs/root/claude:6412:113)\n    at AO (/$bunfs/root/claude:6414:226)\n    at GP8 (/$bunfs/root/claude:6398:5806)\n    at s90 (/$bunfs/root/claude:6398:5579)\n    at <anonymous> (/$bunfs/root/claude:6398:4272)\n    at async a90 (/$bunfs/root/claude:6398:4654)\n    at async <anonymous> (/$bunfs/root/claude:11966:400)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-02-24T22:53:09.871Z"},{"error":"Error\n    at pj (/$bunfs/root/claude:92:1144)\n    at <anonymous> (/$bunfs/root/claude:93:10067)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:861:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/claude:95:2149)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-02-24T22:53:11.574Z"},{"error":"MaxFileReadTokenExceededError: File content (64299 tokens) exceeds maximum allowed tokens (25000). Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.\n    at _t_ (/$bunfs/root/claude:1897:7740)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-02-24T23:02:07.834Z"},{"error":"Error: File does not exist. Note: your current working directory is /Users/scott/repos/jswright61/python_wordle.\n    at call (/$bunfs/root/claude:1906:6346)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-02-24T23:10:49.461Z"},{"error":"MaxFileReadTokenExceededError: File content (64299 tokens) exceeds maximum allowed tokens (25000). Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.\n    at _t_ (/$bunfs/root/claude:1897:7740)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-02-24T23:10:56.706Z"},{"error":"Error: ENOENT: no such file or directory, open '/Library/Application Support/ClaudeCode/managed-settings.json'\n    at openSync (unknown)\n    at readSync (/$bunfs/root/claude:12:1441)\n    at F2 (/$bunfs/root/claude:6412:113)\n    at AO (/$bunfs/root/claude:6414:226)\n    at GP8 (/$bunfs/root/claude:6398:5806)\n    at s90 (/$bunfs/root/claude:6398:5579)\n    at o90 (/$bunfs/root/claude:6398:4794)\n    at async <anonymous> (/$bunfs/root/claude:6398:8150)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-02-24T23:23:12.027Z"},{"error":"Error: ENOENT: no such file or directory, open '/Library/Application Support/ClaudeCode/managed-settings.json'\n    at openSync (unknown)\n    at readSync (/$bunfs/root/claude:12:1441)\n    at F2 (/$bunfs/root/claude:6412:113)\n    at AO (/$bunfs/root/claude:6414:226)\n    at GP8 (/$bunfs/root/claude:6398:5806)\n    at s90 (/$bunfs/root/claude:6398:5579)\n    at o90 (/$bunfs/root/claude:6398:4794)\n    at async <anonymous> (/$bunfs/root/claude:6398:8150)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-02-24T23:53:12.021Z"},{"error":"Error: File does not exist. Note: your current working directory is /Users/scott/repos/jswright61/python_wordle.\n    at call (/$bunfs/root/claude:1906:6346)\n    at async <anonymous> (/$bunfs/root/claude:6360:1808)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-02-25T00:13:02.856Z"},{"error":"Error: 1P event logging: 4 events failed to export (code=ECONNABORTED, timeout of 10000ms exceeded)\n    at queueFailedEvents (/$bunfs/root/claude:6410:2350)\n    at async doExport (/$bunfs/root/claude:6410:1257)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-02-25T00:17:47.684Z"},{"error":"Error: {\"message\":\"Failed to export 4 events (code=ECONNABORTED, timeout of 10000ms exceeded)\",\"origina…

Note: Content was truncated.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗