{"version":"2.1.311","anchor":"bash-tool-parse-results-wrapped-settings-write-detection-re","canonical_anchor":"bash-tool-parse-results-wrapped-settings-write-detection-re","heading":"Bash command analysis: parse cache, stricter declarations and more conservative checks","tier":"notice","area":"Bash Safety","scope":"individual","heads_up":true,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.311\/e\/bash-tool-parse-results-wrapped-settings-write-detection-re","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.311","markdown":"### Bash command analysis: parse cache, stricter declarations and more conservative checks\n\nClaude Code's shell command analysis caches parses, checks declare\/export\/readonly more strictly and treats fewer commands as simple\n\n**What**\n\nBefore Claude Code runs a shell command without asking you, it parses the command to judge whether it is safe. Several parts of that are stricter:\n\n- Parses are now cached by the command text, together with keyword and quoting states.\n\n- Declaration commands (`declare`, `typeset`, `local`, `export`, `readonly`) get stricter checks. They are flagged as too complex for unknown options, repeated `readonly` names, `local` outside a function, and array attributes, with a message that the option is not one bash and zsh are both known to accept. Before, the check was looser.\n\n- Variable assignments now record whether the value is used later (`usesAssignedValue`).\n\n- A new `laterLoopPassesDiffer` result marks commands as uncertain.\n\n- The analyzer now tests the parse result's own kind. Before, it tested a different argument. It also stops treating a command as simple when `usesAssignedValue` or `laterLoopPassesDiffer` is true.\n\n- The parse is wrapped in a helper that can fall back. When it does, the check for commands that write settings files runs again in a different mode.\n\nThe `Bash` tool's description also changed. In the capture taken under this release, its longest of three texts is 10,545 characters. A line that said shell state does not persist between commands now says `cd` carries to the next call only in the main session, if the command succeeds and ends inside the working directories.\n\n**Why**\n\nMore commands, especially those that use declarations, assigned variables or loops, will ask for permission instead of running automatically. Commands that write settings files may be caught more often. Repeated parsing is faster.\n\n- Area: Bash Safety\n- Tier: You'll notice\n- Useful: 1\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: yes"}