harness-config: interpreter drop pattern flags path-scoped rules auto mode keeps

Open Beginner friendly
#20,937 5 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
shell
Domain
devtools, testing

Research direction

Start with plugins/harness-config/lib/permission-patterns.sh and inspect CCPERM_P1_INTERP_ERE alongside the audit entry-diff and permission-rule-check.sh P1 checks. Add a probe-backed test for a path-scoped interpreter rule such as Bash(bash tools/repo-grep.sh *), then verify the audit flags only patterns that auto mode drops.

Written by the indexing model from the issue text.

Description

Steps to reproduce
  1. Put a path-scoped interpreter rule in a project's .claude/settings.json allow list, for example Bash(bash tools/repo-grep.sh *) or Bash(bash .claude/hooks/*.test.sh *).
  2. Run the harness-config audit (audit-permission-state entry-diff, and audit-permission-grants permission-rule-check.sh P1).
Expected behavior

The audit reports only rules auto mode drops. The docs list "Wildcarded interpreters like Bash(python*)" (permission modes, read 2026-12-03), a wildcard that reaches arbitrary code, not an interpreter fixed to one script path.

Actual behavior

CCPERM_P1_INTERP_ERE in plugins/harness-config/lib/permission-patterns.sh:12 matches an interpreter name followed by any text and then any *, so it flags every rule of the form Bash(bash <path> *). On melodic-software/medley#2533 it flagged 6 entry-diff rows and 3 P1 rows as dropped on entry to auto mode.

A live probe disproved the 6 entry-diff rows: Claude Code 2.1.335, claude --debug-file <scratch> --permission-mode auto -p "Reply with exactly: OK" in a medley worktree. The log confirmed mode=auto, all six rules loaded into projectSettings, and its one Ignoring dangerous permission ... (bypasses classifier) line named a different, user-scope rule (melodic-software/medley#2543 body). The audit's recommended fix, rewriting to bare-script form, would stop those rules matching the bash <script> calls the repository makes.

Severity

Medium

Severity justification

False positives recommend a rewrite that breaks working grants; one repository's owner-decision list carried 9 such rows.

Suggested fix location

plugins/harness-config/lib/permission-patterns.sh (CCPERM_P1_INTERP_ERE), with a probe-backed test case for a path-scoped interpreter rule.

Environment

Claude Code 2.1.335; harness-config 7.3.5 (audit run hc31-20261202T212912Z).

Dominant language
Shell
Stars
22
Forks
2
Avg merge
3h 4m
Merged PRs (30d)
941

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from melodic-software/claude-code-plugins

All issues in melodic-software/claude-code-plugins

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.