[Feature Request] Add support for fish shell integration

Resolved 💬 8 comments Opened Dec 9, 2025 by seahyc Closed Feb 11, 2026

Title: Fish shell support via CLAUDE_CODE_SHELL_PREFIX incompatible with zsh shell snapshots

Description:

When using CLAUDE_CODE_SHELL_PREFIX to run commands in fish shell, all commands fail with syntax errors because Claude Code sources zsh-format shell snapshots that are incompatible with fish syntax.

Steps to Reproduce:

  1. Set fish as system default shell: chsh -s /usr/local/bin/fish (or /opt/homebrew/bin/fish on ARM Mac)
  2. Add to ~/.claude/settings.json:

``json
{
"env": {
"CLAUDE_CODE_SHELL_PREFIX": "/usr/local/bin/fish -c"
}
}
``

  1. Start Claude Code
  2. Run any Bash command (e.g., ls, echo "test")

Expected Behavior:

Commands should execute cleanly in fish shell without errors.

Actual Behavior:

Every command fails with syntax errors:

~/.claude/shell-snapshots/snapshot-zsh-*.sh (line 183): Unexpected '}' found, expecting ')'
source: Error while reading file '~/.claude/shell-snapshots/snapshot-zsh-*.sh'
fish: Unknown command: /var/folders/.../claude-*-cwd

Commands still execute and produce output after the errors, but the error messages make the output noisy and unusable.

Root Cause:

Claude Code creates and sources shell snapshot files in zsh/bash syntax (stored in ~/.claude/shell-snapshots/) before each command execution. These snapshots preserve shell state (functions, aliases, environment variables) across commands.

When CLAUDE_CODE_SHELL_PREFIX is set to fish, the infrastructure still attempts to source existing zsh-format snapshots, causing fish to fail on zsh-specific syntax like:

  • emulate -L zsh
  • setopt extendedglob
  • local -a arrays
  • Bash-style function definitions

Impact:

CLAUDE_CODE_SHELL_PREFIX is completely unusable for fish shell users, forcing them to use zsh/bash instead. Every command produces error output before the actual results, making the tool difficult to use.

Suggested Fix:

One or more of the following:

  1. Shell-aware snapshots: Detect the target shell via CLAUDE_CODE_SHELL_PREFIX and generate shell-specific snapshot formats (fish syntax for fish, zsh syntax for zsh, etc.)
  1. Skip snapshots for fish: Don't source snapshots when using fish shell, or create a minimal fish-compatible snapshot format
  1. Document limitations: Clearly document that only bash/zsh are fully supported, and that CLAUDE_CODE_SHELL_PREFIX should not be used with fish
  1. Native shell setting: Add a first-class shell configuration option in settings.json with proper multi-shell support, rather than relying on the CLAUDE_CODE_SHELL_PREFIX environment variable workaround

Environment:

  • OS: macOS
  • Default shell: fish
  • Claude Code version: 2.0.62

View original on GitHub ↗

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