`!` (local shell) commands return empty output despite files existing

Resolved 💬 3 comments Opened Feb 22, 2026 by justinmae Closed Mar 22, 2026

Bug

The ! local shell shortcut returns empty output for commands like ls, even though files exist in the directory. The Bash tool works correctly for the same commands.

Steps to Reproduce

  1. Navigate to a directory with files
  2. Launch Claude Code (claude)
  3. Run ! ls — returns no output
  4. Ask Claude to run ls via the Bash tool — correctly lists files
  5. Run ! pwd — works correctly (returns the path)

Expected

! ls should list the directory contents.

Environment

  • Claude Code v2.1.50
  • macOS (Darwin 24.6.0)
  • Shell: zsh

View original on GitHub ↗

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