From 99056846132874ae21f1f1ab7a88f2b6517b1ddf Mon Sep 17 00:00:00 2001 From: Diego Andres Rabaioli Date: Thu, 18 Jun 2026 23:19:37 +0200 Subject: [PATCH] Make handoff-dir permission rules tolerate trailing args (#19) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The handoff-directory allow-rules in .claude/settings.json (and the template copy) were brittle exact-match Bash forms. The ยง2 sweep `ls ~/.claude-handoffs/cdd/ 2>/dev/null` failed the exact rule `Bash(ls ~/.claude-handoffs/cdd/)` because the trailing `2>/dev/null` made the command non-exact, forcing a re-prompt on every run. Switch the mkdir/ls rules to no-space trailing `*` globs, which match the bare command, trailing arguments, and trailing redirections alike (`:*`/` *` forms require a space and would miss the bare command). The rm rule already used a `.md`-anchored glob and is left as-is. Rules stay scoped to the project's own handoff dir; no broadening to a shared namespace. Both settings files kept identical except cdd <-> . Co-Authored-By: Claude Opus 4.8 (1M context) --- .claude/settings.json | 4 ++-- template/.claude/settings.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.claude/settings.json b/.claude/settings.json index 96eb61a..6aa52ab 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -2,8 +2,8 @@ "permissions": { "allow": [ "Read(~/.claude-handoffs/cdd/**)", - "Bash(mkdir -p ~/.claude-handoffs/cdd)", - "Bash(ls ~/.claude-handoffs/cdd/)", + "Bash(mkdir -p ~/.claude-handoffs/cdd*)", + "Bash(ls ~/.claude-handoffs/cdd/*)", "Bash(rm ~/.claude-handoffs/cdd/*.md)" ] } diff --git a/template/.claude/settings.json b/template/.claude/settings.json index 1ba4c27..9872202 100644 --- a/template/.claude/settings.json +++ b/template/.claude/settings.json @@ -2,8 +2,8 @@ "permissions": { "allow": [ "Read(~/.claude-handoffs//**)", - "Bash(mkdir -p ~/.claude-handoffs/)", - "Bash(ls ~/.claude-handoffs//)", + "Bash(mkdir -p ~/.claude-handoffs/*)", + "Bash(ls ~/.claude-handoffs//*)", "Bash(rm ~/.claude-handoffs//*.md)" ] }