Skip to content

install: user-level hooks are written to ~/.claude/settings.local.json, which is never loaded as user settings #840

Description

@regisandre

Describe the bug
With hooks enabled (the default), gortex install writes the user-level lifecycle hooks of the default hook host (gortex hook without --agent) into ~/.claude/settings.local.json, the file docs/agents.md lists for user-level hooks. The host does not read that file as user settings: user-scope settings come from ~/.claude/settings.json, and settings.local.json is only read as a project file, <project>/.claude/settings.local.json. So the user-level hooks never run, except in a session whose project root is the home directory.

gortex doctor hides the problem: its install section reports each hook as configured, while its activity section says no hook has ever run.

To Reproduce

  1. gortex install --yes (hooks are on by default), then gortex daemon start --detach.
  2. gortex track <repo>.
  3. Start an agent session in <repo> and let it make a few tool calls, Gortex MCP calls included.
  4. gortex doctor.

Result:

  • install section: ✓ hook SessionStart 1 configured, and the same for UserPromptSubmit, PreToolUse, PostToolUse and Stop;
  • activity section: no ~/.gortex/cache/hook-effectiveness.jsonl, "no hook has ever run on this machine";
  • the session transcript holds no Gortex SessionStart orientation.

Handing the very same hooks block to the host explicitly, through its --settings <file> flag, makes every hook fire: the SessionStart orientation shows up in the transcript. The hook commands work; the target file is the problem.

Expected behavior
The user-level hooks fire in every repository, and doctor reports what actually runs.

Suggested fix
Merge the user-level hooks into ~/.claude/settings.json (keeping the existing config-dir override), leave settings.local.json to the repo-level hooks written by gortex init, and have doctor check the file the host loads, so it cannot show "configured" for hooks that can never run.

Environment:

  • OS: Windows 11 (build 26200), amd64
  • Go version: n/a, release binary (built with go1.27.0)
  • Gortex version: v0.64.5+3310720

Activity

  1. added a commit that references this issue on Oct 2, 2026
    053e8d2
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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions