Verbose `which` errors on NixOS at startup
Resolved 💬 2 comments Opened Feb 10, 2026 by pfassina Closed Mar 11, 2026
Description
On NixOS, starting Claude Code prints noisy which errors to the terminal:
which: no code in (/nix/store/...-procps-4.0.4/bin:...)
which: no vi in (/nix/store/...-procps-4.0.4/bin:...)
This happens because NixOS ships GNU which, which prints verbose error messages to stdout/stderr when a binary isn't found. On most other distros, which fails silently (exit code 1, no output).
Claude Code probes for editors (code, vi) at startup using which, and the output leaks to the user's terminal.
Impact
- Cosmetic but noticeable — the errors appear every time Claude Code starts
- Affects all NixOS users who don't have VS Code and/or
viinstalled - Particularly common on NixOS because users often have
nvimbut notvi(neovim doesn't create avisymlink by default), and many NixOS users use terminal-based workflows without VS Code
Suggested fixes
- Redirect stderr/stdout when running
which— e.g.which code >/dev/null 2>&1instead ofwhich code - Use
command -vinstead ofwhich—command -vis POSIX, built into all shells, and always fails silently. It's generally the recommended approach overwhich
Either change would fix this on NixOS and also be more robust on other platforms.
Environment
- NixOS (nixos-unstable)
- Claude Code installed via nixpkgs
claude-codepackage - Shell: Nushell (but the issue is in Claude Code's subprocess, not the user's shell)
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗