Skip to content

fix(claudecode): install user-level hooks into ~/.claude/settings.json - #842

Merged
zzet merged 2 commits into
zzet:mainfrom
drakeo338:claude/840-fix
Oct 1, 2026
Merged

zzet merged 2 commits into
zzet:mainfrom
drakeo338:claude/840-fix

Conversation

@drakeo338

Copy link
Copy Markdown
Contributor

Fixes #840.

Summary

gortex install wrote the user-level hooks to ~/.claude/settings.local.json, which Claude Code only reads as a project file, so the hooks never ran outside a session rooted at the home directory. They now go to ~/.claude/settings.json. Hooks left in the old file by earlier installs are migrated, and doctor/inspect count settings.json once.

Changes

  • Claude Code adapter writes and inspects user hooks in settings.json; legacy entries are moved over.
  • Docs and the agent-render golden updated.

Testing

  • All tests pass (go test -race ./...) (not run in full; the claudecode adapter tests pass: 129 passed, 0 failed)
  • New tests added for new functionality
  • Benchmarks run if performance-relevant (not performance-relevant)

Checklist

  • Code follows existing patterns in the codebase
  • No unnecessary abstractions added
  • Language extractor includes Meta["methods"] for interfaces (if applicable) (not applicable)
  • Methods have EdgeMemberOf edges to their containing type (if applicable) (not applicable)

Claude Code loads user-scope settings from settings.json;
settings.local.json is only read as a project file, so the hooks that
`gortex install` wrote to ~/.claude/settings.local.json never ran.

Write the user-level hooks (and the dry-run plan) to userSettingsPath,
which also honours the CLAUDE_CONFIG_DIR override, and have doctor
(Inspect) read the same file. Uninstall now strips Gortex hooks from
settings.json and still cleans the settings.local.json left behind by
earlier installs.

Fixes zzet#840
Re-running install now drops Gortex hooks left in
~/.claude/settings.local.json by earlier installs, so a session rooted at
$HOME does not load them next to the new user-level ones.

RemoveGlobal counted settings.json twice (permissions and hooks); it now
counts once. GlobalArtifacts lists settings files only when they hold an
mcp__gortex__ permission or a Gortex hook entry, matching what RemoveGlobal
removes. The dry-run plan reports settings.json as a single action.
@zzet
zzet merged commit 4e8316a into zzet:main Oct 1, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants