[DOCS] PowerShell docs omit no-match exit 1 behavior for `git diff`, `git grep`, `egrep`, and `fgrep`

Open 💬 0 comments Opened Jun 29, 2026 by coygeek

Documentation Type

Missing documentation (feature not documented)

Documentation Location

https://code.claude.com/docs/en/permissions

Section/Topic

The "PowerShell" subsection, and the related tool behavior reference for search commands whose no-match result exits 1.

Current Documentation

The PowerShell section documents command matching and compound-command parsing:

"PowerShell permission rules use the same shape as Bash rules. Wildcards with * match at any position, the :* suffix is equivalent to a trailing *, and a bare PowerShell or PowerShell(*) matches every command."
"Claude Code parses the PowerShell AST and checks each command in a compound command independently. Pipeline operators |, statement separators ;, and on PowerShell 7+ the chain operators && and || split a compound command into subcommands."

The docs do not mention that "no matches" exit code 1 from search commands is treated as a normal no-result outcome rather than a failed tool call, matching Bash behavior.

What's Wrong or Missing?

Claude Code v2.1.196 fixed PowerShell git diff/git grep, egrep/fgrep, and quoted search patterns containing | being reported as failures when they exit 1. In these command families, exit 1 can simply mean "no matches" or "no diff", not a command failure. The Bash behavior had already treated these no-match results as non-fatal, but the PowerShell docs only cover permission matching and AST parsing. They do not document the no-match exit-code exception or the parity with Bash.

Suggested Improvement

Add a note under the "PowerShell" section or in the tool behavior reference:

For recognized search commands, a no-match exit code of 1 is treated as a normal no-result outcome, matching Bash behavior. This includes git diff, git grep, egrep, and fgrep, including quoted search patterns that contain |. Other non-zero exit codes are still reported as command failures.

This gives users a place to check why git grep with no matches does not appear as a failed PowerShell tool call.

Impact

Medium - Makes feature difficult to understand

Additional Context

Affected Pages:
| Page | Context |
|------|---------|
| https://code.claude.com/docs/en/permissions | PowerShell permission and parsing behavior |
| https://code.claude.com/docs/en/tools-reference | Tool behavior for shell/search commands |

Total scope: 2 pages affected.

Claude Code v2.1.196 made PowerShell no-match handling match Bash for git diff, git grep, egrep, fgrep, and quoted search patterns containing |.

View original on GitHub ↗