Skip to content

Plugin hooks fail with fish shell - bun not found in /bin/sh PATH #264

@yungweng

Description

@yungweng

Bug Description

When using fish shell, the plugin hooks fail with bun: command not found even though Bun is properly installed and configured in the fish shell PATH.

Root Cause

The plugin hooks run via /bin/sh, not the user's login shell. Fish shell users have Bun configured in ~/.config/fish/config.fish:

# bun
set --export BUN_INSTALL "$HOME/.bun"
set --export PATH $BUN_INSTALL/bin $PATH

However, /bin/sh doesn't read fish config files, so it can't find bun even though:

  1. Bun is installed at ~/.bun/bin/bun
  2. Bun works perfectly in fish shell
  3. The Bun installer ran successfully

Error Output

SessionStart:startup says: Plugin hook error: /bin/sh: bun: command not found

Workaround

Create a symlink to make bun available system-wide:

sudo ln -sf ~/.bun/bin/bun /usr/local/bin/bun

Suggested Fix

Options to consider:

  1. Use absolute path: Instead of just bun, use $HOME/.bun/bin/bun or detect the bun location
  2. Fall back to npm: If bun isn't found, fall back to npm which is more universally available
  3. Document the workaround: Add fish shell compatibility note to README
  4. Auto-create symlink: During installation, offer to create the /usr/local/bin/bun symlink

Environment

  • claude-mem version: 7.1.3
  • Claude Code version: 2.0.69
  • Shell: fish 3.x
  • Platform: macOS
  • Bun version: 1.3.4 (installed at ~/.bun/bin/bun)

Additional Context

This likely affects any shell that isn't bash/zsh, since /bin/sh typically only reads POSIX-compatible configs. The switch from PM2 to Bun in v7.x introduced this regression for non-bash/zsh users.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions