Skip to content

Give every hook plugin an on/off setting per the hook-enablement convention #18921

Backlog

Description

@kyle-sexton

Context

The hook-enablement convention (docs/contracts/hook-enablement/README.md, added by the pull request that refs this issue) requires every hook a plugin ships to have its own <name>_enabled on/off setting, at the user layer (userConfig) and the repository layer (docs/conventions/<plugin>.yaml), read by the hook's own script. Claude Code has no per-hook off switch, so without the setting an operator who wants one hook off must disable the whole plugin or every hook.

Of the 31 plugins under plugins/ that ship hooks/hooks.json, these 11 declare no *_enabled option in .claude-plugin/plugin.json:

  • animation
  • context-budget
  • discovery
  • display-redaction
  • explainer-video
  • multi-agent
  • playwright
  • plugin-profiles
  • speech
  • themes
  • toolchain

Count from a script over plugins/*/hooks/hooks.json and each plugin's userConfig keys, run on main at 3b46e0b (2026-11-24).

Proposed work

For each plugin listed, one change per plugin:

  1. Add one boolean <name>_enabled userConfig option per hook it ships, with the default the convention's "The per-hook setting" section describes and the title text plugin-option-naming sets.
  2. Make each hook's script resolve the plugin default, the user layer and the repository layer before doing any work, in the convention's precedence, and exit quietly when the result is off.
  3. Document the key in the plugin's config reference and repository-layer schema.

Acceptance criteria

Precedence follows the owner decision of 2026-11-24 recorded in ADR 0131: the user's explicit value wins for that user, and the repository value is the default for everyone who has not set their own.

  • Each of the 11 plugins declares a <name>_enabled option for every hook in its hooks/hooks.json.
  • With the option set to false at the user layer, each hook does nothing, whatever docs/conventions/<plugin>.yaml says; with the user layer unset and false in docs/conventions/<plugin>.yaml, it does nothing; with the user layer unset and true there, it runs.
  • A test per hook covers those three cases.
  • Rerunning the count script lists no plugin.

References

Activity

  1. added theissue type on Nov 24, 2026
  2. added
    needs-triage
    on Nov 24, 2026
  3. github-actions commented on Nov 24, 2026

    @github-actions
    Contributor

    Size: Large
    Complexity: Medium
    Uncertainty: Known
    Flags: none
    Blocked by: none
    Blast radius: hook scripts, plugin.json userConfig and config docs across about 31 plugins, plus one shared helper and a count-script check; read by every operator who runs those plugins.
    Reversible: yes; each per-plugin change is a separate revert.
    Claims checked:

    1. The convention exists at docs/contracts/hook-enablement/README.md: held, file present.
    2. ADR 0131 exists: held, docs/adr/0131-give-every-hook-its-own-on-off-setting-at-the-user-and-repository-layers.md.
    3. Existing plugins read only the user layer, e.g. bash-format launches via --run-if-unset-or-true BASH_FORMAT_ENABLED: held, plugins/bash-format/hooks/hooks.json:13.
      Open questions: none

    Decision recorded by the owner, and it settles every open question:

    Decision recorded. Split this work into one issue per plugin, with this issue as the tracking parent. Build one shared layer-resolution helper first, and commit the count script as the acceptance check.

    #18921 (comment)

    Per that decision, this issue is the tracking parent. The shared helper and the per-plugin children are filed as separate issues, and this one holds no acceptance criteria of its own.

    Automated triage. A maintainer reviews it.

  4. removed
    needs-triage
    on Nov 24, 2026
  5. melodic-automation-lanes commented on Nov 24, 2026

    @melodic-automation-lanes
    Contributor

    Not admitted to the issue lane: no trusted-human acceptance criteria: a listed human must put the confirmed - [ ] criteria in the body or post them as their own comment, or, on an issue a listed human filed, intake's newest refinement comment must hold them unedited. Admission takes the issue once each of those is met, when intake triages it again (.github/actions/resolve-config/admission-rules.json).

  6. kyle-sexton commented on Nov 24, 2026

    @kyle-sexton
    MemberAuthor

    Scope addition found while writing the contract in #18924: the 20 hook plugins that already have an *_enabled setting read only the user layer, and some exit early on it, so they do not yet follow the contract's rule that the hook resolves every layer before deciding.

    Examples:

    • plugins/bash-format/hooks/hooks.json launches through --run-if-unset-or-true BASH_FORMAT_ENABLED.
    • plugins/session-flow/hooks/observer-arm.sh:33 exits on the environment value alone.

    The retrofit therefore covers two groups: the 11 plugins listed above (no setting at all), and the 20 plugins whose existing setting must also read the repository layer.

  7. melodic-automation-lanes commented on Nov 24, 2026

    @melodic-automation-lanes
    Contributor

    Refinement. A read-only run explored this repository, searched its issues and pull requests, and read the allowed docs to draft what follows. On an issue a listed human filed, it counts as the issue's spec once posted, while unedited; it is still model text, so check it.

    Intended outcome: Each of the 11 plugins gets a per-hook &lt;name>_enabled option, resolved in the hook script across plugin default, user layer and repository layer, documented and tested, once the convention is merged.

    Dependencies

    • The pull request that adds docs/contracts/hook-enablement/README.md must merge first: it defines the defaults, resolution order and title text the work follows.

    Open questions

    1. Has the hook-enablement convention merged? Neither docs/contracts/hook-enablement/ nor any mention of it exists on the checkout, so the default value, the key naming per hook and the layer precedence cannot be checked.
      RECOMMENDED: Hold this issue until the convention pull request merges, then re-run refinement. Basis: docs/contracts/ has no hook-enablement directory (Glob found none)
    2. Should the work be split into one issue per plugin (11 issues)? The issue says one change per plugin and the triage rates it Large.
      RECOMMENDED: Yes, split into 11 per-plugin issues, each with its own task list of criteria, and keep this one as the tracking parent. Basis: judgment
    3. Which function should each hook script use to resolve the three layers, and is there a shared helper? The issue says each script resolves them itself but names no shared code.
      RECOMMENDED: Reuse the existing shared hook helper or config-cascade resolution if one exists, and state it in the convention; otherwise add one shared helper first. Basis: docs/contracts/config-cascade/README.md
    4. How is the count script to be run so the final criterion 'rerunning the count script lists no plugin' can be checked? The script is not in the repository.
      RECOMMENDED: Commit the count script as a check, for example a test that compares plugins/*/hooks/hooks.json hooks with plugin.json userConfig keys, and make it the acceptance check. Basis: judgment

    Sources read

    • docs/contracts/hook-enablement/: absent on the checkout (Glob returned no files)
    • plugins/*/.claude-plugin/plugin.json: Grep for _enabled finds options in 22 plugins, none of the 11 listed ones shown with a match except where listed, so the issue's count is plausible but not re-run
    • docs/contracts/config-cascade/README.md: existing contract for layered config resolution, listed by Glob only, not read

    To answer, post a comment that starts with this line:

    **Decision recorded.** <answer>
    

    Automated refinement by the lanes App. Answer with a comment whose first line is **Decision recorded.**.

  8. kyle-sexton commented on Nov 25, 2026

    @kyle-sexton
    MemberAuthor

    Decision recorded. Split this work into one issue per plugin, with this issue as the tracking parent. Build one shared layer-resolution helper first, and commit the count script as the acceptance check.

    Owner, in session 2026-11-25 ~8:21 AM EST, verbatim: "/session-flow:go-with-recommendations", accepting "(A) split into one issue per plugin under #18921 as tracking parent; one shared layer-resolution helper built first; the count script committed as the acceptance check".

    What this settles from the refinement:

    • Q1 (has the convention merged): yes. docs/contracts/hook-enablement/README.md is on main, so the work no longer waits on it.
    • Q2 (split per plugin): yes. Each plugin the retrofit covers gets its own issue with its own acceptance criteria, linked here. That covers both groups in the scope comment: the 11 plugins with no setting, and the plugins whose existing setting reads only the user layer.
    • Q3 (shared code): one shared helper that resolves the plugin default, the user layer and the repository layer is built first, in its own issue. Every per-plugin issue depends on it.
    • Q4 (count script): the count script is committed as a check, and rerunning it with no plugin listed is the acceptance check for the whole retrofit.

    This issue tracks the children and holds no acceptance criteria of its own.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Work status

    confirmed

    Priority

    medium

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions