Skip to content

[bug] install-claude-permissions.sh writes allow rules that mix * with trailing :* — bare script calls still prompt, and every wrapper rule raises a startup warning #780

Closed

Description

@MendixMau

Reported by: a toolkit user, relayed by the maintainer. They could not file it themselves; several other users reported the same. Title as reported: "install-claude-permissions.sh writes allow rules that mix * with trailing :* and never match".

What the installer writes (bin/install-claude-permissions.sh:177-192, the wrappers list):

Bash(./bin/*.sh:*)   Bash(bin/*.sh:*)   Bash(bash bin/*.sh:*)
Bash(~/.mxcli/mxbuild/*/modeler/mx:*)
Bash($TOOLKIT_ROOT/bin/*.sh:*)   Bash(bash $TOOLKIT_ROOT/bin/*.sh:*)   (settings.local.json)

What current Claude Code does with them. Checked against https://code.claude.com/docs/en/permissions ("Wildcard patterns") and https://code.claude.com/docs/en/errors ("Has a wildcard before the rest of the command"), Claude Code 2.1.325:

  1. A bare call still prompts. :* at the end means the same as *. A trailing * matches the bare command only when it is the rule's only wildcard ("Bash(* --help *) matches npm --help x but not npm --help"). Every rule above has a second * in the script name. So ./bin/gate-check.sh with no arguments, bin/status.sh and bin/doctor.sh are not covered and prompt every time. Calls with arguments do match. That explains why it feels like "never matches": the most common calls are the bare ones.
  2. Every one of these rules raises a startup warning. A * before the rest of the command (here, in the program name) triggers ⚠ Allow rule … allows any option at its * · use an exact value (since v2.1.246; shown as a banner row since v2.1.305). Users see a row of warnings at every session start that they did not write and cannot act on.
  3. :* is the legacy form. The permission dialog writes the space form, and the docs present :* as an equivalent spelling. The installer's header comment (:23-24) states the "only wildcard" caveat but then writes rules that break it.

The deny rules (Bash(*file-bugs.sh*--file*), …) are not affected: the warning is for allow rules only, and a deny glob is meant to be broad.

Proposed fix (direct lane):

  • Write one rule per script that actually exists, in the space form, with the * only at the end: Bash(./bin/exec.sh *), Bash(bin/exec.sh *), Bash(bash bin/exec.sh *). That is the docs' own recommendation ("one rule per subcommand"). Each rule then matches both the bare call and the call with arguments, and raises no warning.
  • The script list comes from the project's installed bin/*.sh (shared settings) and from the toolkit's bin/*.sh by absolute path (local settings). The mxbuild mx rule becomes one rule per installed version under ~/.mxcli/mxbuild/ (local settings, since the path is per machine).
  • sync-project.sh / re-install rewrites the list through the existing sidecar, so old wildcard entries this script added are removed, and entries someone else wrote are never touched.
  • Correct the header comment.

Cost: settings.json grows from 9 wrapper rules to about 3 per installed script. Nothing changes per exec.

Field evidence: the reports above. The fix should be proven against a real claude (no warning row, bare call allowed), not only by grep.

Activity

  1. MendixMau commented on Nov 16, 2026

    @MendixMau
    OwnerAuthor

    Maintainer decision: prove this before fixing it. We run one real Claude Code session in normal permission mode on master's rules and call ./bin/status.sh with no arguments. If the rule matches and no prompt appears, the installer stays as it is and this issue is closed with the evidence. A fix lands only if a prompt or denial appears. This work is separate from #775 and does not hold it.


    Generated by Claude Code

  2. MendixMau commented on Nov 16, 2026

    @MendixMau
    OwnerAuthor

    Proven on Claude Code 2.1.325. The test project used master's rules (Bash(./bin/*.sh:*) and the rest), in default permission mode.

    call result
    ./bin/status.sh denied ("This command requires approval")
    ./bin/status.sh --brief also denied

    So the bug is worse than this issue first said: the rules also fail when the call has arguments.

    claude doctor lists each mixed rule under "Permission rules that may not work as written", as "matched as a literal prefix (the * is not expanded)". With Bash(./bin/status.sh *), both calls run.

    Fix PR: #781. It is waiting for an independent review before merge.


    Generated by Claude Code

  3. MendixMau commented on Nov 16, 2026

    @MendixMau
    OwnerAuthor

    Fixed by #781, merged in 1e0c38a. Projects pick it up after sync-project.sh, which warns once until the permissions installer is re-run. Follow-ups are in #782.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions