{"version":"2.1.273","anchor":"shell-static-analysis-tightened-for-declaretypesetlocal-op","canonical_anchor":"shell-static-analysis-tightened-for-declaretypesetlocal-op","heading":"Stricter safety checks for declare, typeset, local, export, readonly, and unset commands","tier":"notice","area":"Bash Safety","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.273\/e\/shell-static-analysis-tightened-for-declaretypesetlocal-op","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.273","markdown":"### Stricter safety checks for declare, typeset, local, export, readonly, and unset commands\n\nClaude Code now catches more shell commands that could be reinterpreted unsafely by the real shell before running them\n\n**What**\n\nWhen Claude Code decides whether a shell command is simple enough to run without invoking the full shell, it now rejects more edge cases that could behave differently than expected:\n\n- `declare`, `typeset`, and `local` commands are rejected as too complex unless their operand is a plain variable name with a simple, inert value, since the real shell could otherwise treat it as an array subscript, an expanded name, or a compound assignment.\n\n- `export` and `readonly` commands are now also rejected when their operand looks like an array assignment (matching flag patterns the shell would evaluate as a compound array assignment).\n\n- `unset` no longer just checks for a bare variable name; it also allows a second, more permissive pattern under certain conditions, but anything that still doesn't match either pattern is now rejected as too complex, since the shell might expand or evaluate it unexpectedly.\n\n- These rejections are now marked internally with a `differential` flag, replacing a fixed classification that was previously used for these cases.\n\n**Why**\n\nThese checks exist to stop Claude Code from treating a shell command as \"simple\" when the real shell could actually parse or evaluate it in a surprising way (for example, expanding into an array assignment). Tightening them reduces the chance that a command behaves differently than Claude Code's analysis assumed.\n\n- Area: Bash Safety\n- Names: `declare`, `typeset`, `local`\n- Tier: You'll notice\n- Useful: 1\/5\n- Signal: 1\/5"}