{"version":"2.1.333","anchor":"grepegrepfgrep-glob-escaping-rewrite-is-dark-behind-tengu","canonical_anchor":"grepegrepfgrep-glob-escaping-rewrite-is-dark-behind-tengu","heading":"grep file patterns can be protected from shell expansion (off by default)","tier":"soon","area":"Bash Tool","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.333\/e\/grepegrepfgrep-glob-escaping-rewrite-is-dark-behind-tengu","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.333","markdown":"### grep file patterns can be protected from shell expansion (off by default)\n\nClaude Code can escape unquoted --include and --exclude patterns in grep commands, but only when a remote switch turns it on\n\n**What**\n\nIn a command such as `grep --include=*.py`, the shell may expand `*.py` into a list of files before grep sees it, which changes what grep searches. Claude Code now has code that rewrites unquoted patterns given to these options so the shell leaves them alone:\n\n- `--include`\n\n- `--exclude`\n\n- `--exclude-dir`\n\nThis covers `grep`, `egrep` and `fgrep`. The rewritten command is only used when a switch on Anthropic's side is turned on. It is off unless switched on remotely, and with it off, commands run exactly as written.\n\n**Why**\n\nWhen it is on, grep searches that filter by file pattern behave as intended instead of being silently altered by the shell.\n\n- Flag `tengu_eventual_planet`: Not enough to say (read for one account on one subscription tier against v2.1.333; this account: no value returned, anonymous baseline: no value returned, compiled default: off) These values were read against a different version of Claude Code, so treat them as the nearest reading available instead of one taken on this release.\n- Area: Bash Tool\n- Tier: Nothing to try yet\n- Useful: 3\/5\n- Signal: 3\/5\n- Scope: individual\n- Heads-up: no\n- Present in the build but not switched on"}