Skip to content

doctor: the re-init fix's --no-hooks is decided from the agent's own settings #864

Closed

Description

@LoopGlitch26

tracekit doctor adds --no-hooks to the re-init fix it prints when the Tracekit plugin is enabled, so the plugin's hooks and init's hooks don't both run (#464). It reads "the plugin is enabled" from the agent's own Claude Code settings, which the agent can write. So agent-writable input decides one flag of a command a person runs with sudo, and that flag removes init's hooks.

Scenario (system mode without --managed): the agent adds the Tracekit plugin to enabledPlugins in its own settings without the plugin being installed or running. Doctor's next re-init fix says --no-hooks. A person who follows it re-inits with no hooks, and the agent's calls are no longer decided.

What to do:

  1. Decide --no-hooks only from what Claude Code will actually run: the plugin is installed where the agent's user can't write it, and enabled in managed settings or with hooks that Claude Code loads. Otherwise keep init's hooks and say why in the detail.
  2. A test that fails today: the plugin enabled only in the agent's own settings, not installed, gives a fix without --no-hooks.
  3. Check D-HOOKS-PRESENT's "decided twice" FAIL uses the same rule, so the two never disagree.

Found in the review of #860; it predates it.

Activity

  1. Mr45401 commented on Nov 15, 2026

    @Mr45401
    Contributor

    I'll take this one!

  2. LoopGlitch26 commented on Nov 15, 2026

    @LoopGlitch26
    MemberAuthor

    It's yours, @Mr45401, thanks. The fix belongs where doctor builds the re-init advice: whether to add --no-hooks must come from what init installed (its own record), never from the agent's settings file, which the agent can edit. Add a test where the settings say one thing and init's record another, and show it fails on main.

  3. added 2 commits that reference this issue on Nov 15, 2026
    5f814e0
    706ee1f
  4. added a commit that references this issue on Nov 16, 2026
    387320a
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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions