Skip to content

Prerequisite probe treats plugins a session's --settings file turns off as enabled #16673

Closed

Description

@kyle-sexton

Problem

A session started with a --settings file that turns a plugin off still gets that plugin's SessionStart prerequisite notices, including a /<plugin>:setup suggestion for a plugin the session does not have. Every plugin-profiles profile session starts that way: the session file is passed with --settings.

The readers of rootsFromSettings decide which plugins are enabled from user, user-local, project and project-local settings plus managed settings. None of them reads the session's --settings layer:

  • lib/enabled-plugin-roots.mjs:51-69 (rootsFromSettings, synced into plugins/plugin-diagnostics/lib/ and plugins/harness-ops/lib/) merges enabledPlugins from <config>/settings.json, <config>/settings.local.json, <project>/.claude/settings.json, <project>/.claude/settings.local.json and the managed files.
  • plugins/plugin-diagnostics/hooks/prerequisites-fleet.mjs:133 (the SessionStart row "Checking the enabled plugins' prerequisites...", hooks/hooks.json:35) probes every plugin that list returns. The probe's git-hook check prints driftLine() from each plugin's lib/git-hooks/install.mjs:1396-1401.
  • plugins/harness-ops/skills/prerequisites/scripts/check-prerequisites.mjs:129 and plugins/harness-ops/scripts/session-telemetry-state.mjs:51 read the same list.

Seen in

A session started 2026-11-16 in control-hub with claude --settings <plugin-profiles session file for the build profile> (Claude Code 2.1.326):

  • The session file sets go-format@melodic-software and instruction-placement@melodic-software to false. ~/.claude/settings.json sets both to true, and the project has no .claude/settings*.json.
  • /reload-plugins reported 47 plugins, and neither plugin's hooks appear in the transcript.
  • The prerequisites row still printed go-format: git hook goimports-format missing; run /go-format:setup apply install-git-hooks, and the same for instruction-placement.

Candidate mechanisms (open)

  1. A Claude Code signal. None found as of 2026-11-16: the hooks reference lists no enabled-plugins or settings-path field in the common or SessionStart input, and no such environment variable. Watch for one in a future release.
  2. Read the session file plugin-profiles names. The session file sets PLUGIN_PROFILES_SESSION_FILE in its own env, and env from a --settings file reaches hook processes (probe 2026-11-16, Claude Code 2.1.326: a SessionStart hook in a --settings file printed that file's env value). rootsFromSettings would merge that file's enabledPlugins after the project and local layers and before managed. With the variable unset, behavior stays as today. This makes a hook unit read a file another plugin writes; that coupling is the owner's decision.

Done when

  • A session whose --settings file turns a plugin off gets no prerequisite probe for it, shown by a test and by a live session.
  • The three readers of rootsFromSettings agree on which plugins are enabled for that session.

Refs #16428.

Activity

  1. added
    host-run
    on Nov 17, 2026
  2. added
    needs-triage
    on Nov 17, 2026
  3. github-actions commented on Nov 17, 2026

    @github-actions
    Contributor

    Size: Medium
    Complexity: Medium
    Uncertainty: Knowable
    Flags: intent
    Blocked by: none

    Understood: a session started with a --settings file that disables a plugin still gets that plugin's SessionStart prerequisite notices. rootsFromSettings never reads the session's --settings layer, so the three readers list the plugin as enabled. This is a defect in existing behavior. It is related to #16428. I found no duplicate among the open issues and no merged pull request that already fixes it.

    The issue lists two candidate mechanisms and picks neither. The second one makes a hook unit read a file another plugin writes, and the issue calls that coupling the owner's decision. That is a design choice, so it is held for the owner.

    1. Should rootsFromSettings read the session file named by PLUGIN_PROFILES_SESSION_FILE (mechanism 2), or should this wait for a Claude Code signal (mechanism 1)?
      RECOMMENDED: mechanism 2. The issue found no Claude Code signal as of 2026-11-16, and it probed that env from a --settings file reaches hook processes. With the variable unset, behavior stays as today, so the change is low-risk.
    2. If mechanism 2, is it acceptable that lib/enabled-plugin-roots.mjs (and its synced copies in plugin-diagnostics and harness-ops) depends on the plugin-profiles session-file convention?
      RECOMMENDED: yes, as an optional read that is a no-op when the variable is unset or the file is unreadable. All three readers then share one code path and agree by construction.

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

    **Decision recorded.** <answer>
    

    Automated triage. A maintainer reviews it.

  4. added
    needs-owner-decision
    on Nov 17, 2026
  5. melodic-automation-lanes commented on Nov 17, 2026

    @melodic-automation-lanes
    Contributor

    The triage verdict left this issue at needs-owner-decision:

    • flagged: intent
    • held by needs-owner-decision
    • no lanes App verdict comment shows whether an earlier verdict was flagged

    Reason: intent

  6. melodic-automation-lanes commented on Nov 17, 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: rootsFromSettings merges enabledPlugins from the file named by PLUGIN_PROFILES_SESSION_FILE after project/local layers and before managed, as a no-op when unset or unreadable, so all three readers agree.

    Related work

    Open questions

    1. Should rootsFromSettings read the session file named by PLUGIN_PROFILES_SESSION_FILE (mechanism 2), or should this wait for a Claude Code signal (mechanism 1)?
      RECOMMENDED: Mechanism 2: no Claude Code signal exists as of 2026-11-16, and env from a --settings file reaches hook processes. Basis: judgment
    2. Is it acceptable that lib/enabled-plugin-roots.mjs and its synced copies in plugin-diagnostics and harness-ops depend on the plugin-profiles session-file convention?
      RECOMMENDED: Yes, as an optional read that does nothing when the variable is unset or the file is unreadable, so behavior is unchanged without it. Basis: lib/enabled-plugin-roots.mjs:49-66
    3. Where in the merge order does the session file go, and does its false override a user-level true?
      RECOMMENDED: After project-local and before managed, so a session false beats user true and managed still wins, as the issue states. Basis: lib/enabled-plugin-roots.mjs:50-54
    4. How is the live-session criterion checked unattended, given it needs a real claude --settings session?
      RECOMMENDED: Cover it with a test that sets the env variable to a fixture file, and keep the live check as a host-run step a person performs. Basis: judgment

    Sources read

    • lib/enabled-plugin-roots.mjs:49-79: rootsFromSettings reads only config settings.json, settings.local.json, project .claude settings files and managed files, with no session --settings layer

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

  7. removed
    host-run
    on Nov 17, 2026
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

    needs-owner-decisionneeds-triage

    Type

    Fields

    Work status

    needs-owner-decision

    Priority

    medium

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions