[BUG] Shell wrapper doesn't quote SSH_AUTH_SOCK — breaks with 1Password agent path containing spaces

Resolved 💬 3 comments Opened Mar 8, 2026 by kierblk Closed Apr 5, 2026

Summary

Claude Code's internal shell command wrapper does not properly quote $SSH_AUTH_SOCK when the resolved symlink target contains spaces. This produces zsh: no such file or directory errors on every Bash tool invocation.

Setup

Standard 1Password SSH agent configuration on macOS — this is the officially recommended setup, not a custom config:

# ~/.zshenv
export SSH_AUTH_SOCK="$HOME/.1password/agent.sock"

The symlink is created by 1Password and resolves to macOS's standard Group Containers path:

~/.1password/agent.sock -> ~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock

The space in Group Containers is from macOS, not user-created.

Symptoms

Every Bash tool invocation produces three error lines before actual output:

zsh:2: no such file or directory: Containers/2BUA8C4S2C.com.1password/t/agent.sock
zsh:4: no such file or directory: Containers/2BUA8C4S2C.com.1password/t/agent.sock
zsh:6: no such file or directory: Containers/2BUA8C4S2C.com.1password/t/agent.sock

Note the path is truncated at the space — only Containers/2BUA8C4S2C.com.1password/... appears, confirming an unquoted variable expansion is splitting on whitespace.

Why this is not a user config issue

  1. All user shell files are properly quoted.zshenv and .zshrc both use export SSH_AUTH_SOCK="$HOME/.1password/agent.sock" (double-quoted)
  2. The error line numbers (zsh:2:, zsh:4:, zsh:6:) don't correspond to any user shell file.zshenv is 5 lines, and line 4 is the SSH_AUTH_SOCK export which is properly quoted. The errors originate from Claude Code's internal wrapper script that runs before the user's command.
  3. The same setup works perfectly in iTerm2, Terminal.app, and VS Code's built-in terminal — no errors in any other shell environment
  4. Deleting ~/.claude/shell-snapshots/ does not fix it — the snapshots don't even contain SSH_AUTH_SOCK. The issue persists across fresh sessions.
  5. SSH and git signing work correctly — the variable is set and functional; only the wrapper's unquoted expansion produces the cosmetic error

Impact

Cosmetic only — all commands execute correctly, but every single Bash invocation has three lines of error noise prepended to the output.

Environment

  • Claude Code v2.1.71 (VS Code extension)
  • macOS Tahoe 26.3 (Darwin 25.3.0)
  • zsh 5.9
  • 1Password SSH agent (official symlink setup)

Suggested Fix

Quote $SSH_AUTH_SOCK wherever it is referenced in the shell wrapper script (lines 2, 4, 6 per the error output).

View original on GitHub ↗

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