chore(claude): allow echo in Bash permissions

Split compound commands like `ls ... || echo ...` need `echo*` to match
the right-hand subcommand without approval prompts. Documented in
docs/contributing/tools/agents/claude.md.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
kevinveenbirkenbachandClaude Opus 4.6 committed 2026-04-16 12:28:43 +02:00
1 parent 34ddc4d2d2
commit d6487a7457
2 files changed
+2

No files matched your search

+1
View File
@@ -52,6 +52,7 @@
"Bash(find*)",
"Bash(ls*)",
"Bash(cat*)",
"Bash(echo*)",
"Bash(head*)",
"Bash(tail*)",
"Bash(wc*)",
+1
View File
@@ -98,6 +98,7 @@ Claude Code evaluates each tool call against three ordered lists:
| Permission | When | Why | Security |
|---|---|---|---|
| `grep*`, `find*`, `ls*`, `cat*`, `head*`, `tail*` | Reading and searching file content during any task. | Standard read-only inspection tools. Required for almost every task. | No write side-effects. Safe to allow unconditionally. |
| `echo*` | Emitting literal strings, typically as the right-hand side of shell fallbacks like `ls <path> 2>/dev/null \|\| echo "no dir"`. Such compound commands are split at `\|\|`, `&&`, `;`, `\|`, so each subcommand is matched separately and `echo` needs its own allow entry. | Avoids per-invocation approval prompts for common shell idioms used during inspection and probing. | Writes only to stdout; no file, network, or process side-effects on its own. Dangerous combinations (e.g. `echo ... > file`, `echo ... \| sh`) remain bounded by the sandbox `allowWrite` scope and by `deny` rules on `sudo*` and `rm -rf*`. |
| `wc*`, `sort*`, `jq*` | Counting lines, sorting output, parsing JSON. | Common pipeline utilities used in scripts and make targets. | No write side-effects. Safe to allow unconditionally. |
| `awk*` | Pattern-based text extraction and transformation during inspection, script output parsing, and make target post-processing. | Standard pipeline utility. Narrow per-invocation wildcards proved impractical — every unique command line (pattern + path) would require its own allowlist entry. | Not strictly read-only: awk's `system()` and `"cmd" \| getline` can execute arbitrary shell commands and reach the network, equivalent in risk class to the already-allowed `find -exec` and `tar --checkpoint-action=exec`. The sandbox `allowWrite` scope, `denyRead` credential paths, and the `rm -rf*` / `sudo*` deny rules still bound the blast radius. Review awk scripts before piping untrusted input into them. |
| `tar*` | Archiving files during build or export tasks. | Required by build and packaging scripts. | Can overwrite files when extracting. The sandbox `allowWrite` limits the blast radius to `.` and `/tmp`. |