Skip to content

Make handoff-dir permission rules tolerate trailing args#29

Merged
drabaioli merged 1 commit into
mainfrom
gh_issue_19_handoff_dir_permissions
Jun 18, 2026
Merged

Make handoff-dir permission rules tolerate trailing args#29
drabaioli merged 1 commit into
mainfrom
gh_issue_19_handoff_dir_permissions

Conversation

@drabaioli

Copy link
Copy Markdown
Owner

Summary

Broadens the handoff-directory Bash permission rules in .claude/settings.json (and its template counterpart) so they tolerate trailing arguments on the commands the CDD workflow actually emits.

  • Bash(mkdir -p ~/.claude-handoffs/<dir>)…/<dir>*
  • Bash(ls ~/.claude-handoffs/<dir>/)…/<dir>/*

The old exact-match rules failed to match commands carrying trailing tokens (e.g. ls ~/.claude-handoffs/cdd/ 2>/dev/null emitted by /cdd-next-step). The cdd* vs cdd/* asymmetry is intentional: mkdir targets the directory cdd itself, while ls targets contents under cdd/; both end in * to absorb trailing args. Repo and template are changed in lockstep.

Verification

  • shellcheck (CI invocation) clean
  • bash -n clean across scripts/tools/demo
  • command-set drift: clean
  • template bootstrap E2E smoke + demo seed-overlay smoke: passed

Closes #19

🤖 Generated with Claude Code

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 <-> <PROJECT_DIR>.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@drabaioli drabaioli merged commit cccd35b into main Jun 18, 2026
1 check passed
@drabaioli drabaioli deleted the gh_issue_19_handoff_dir_permissions branch June 18, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve permissions on handoff directory

1 participant