Skip to content

Per-machine hook-config override (.gnkit/gitnexus-hooks.local.json)#8

Merged
ReidenXerx merged 1 commit into
mainfrom
feat/local-hook-config-override
Jul 16, 2026
Merged

Per-machine hook-config override (.gnkit/gitnexus-hooks.local.json)#8
ReidenXerx merged 1 commit into
mainfrom
feat/local-hook-config-override

Conversation

@ReidenXerx

Copy link
Copy Markdown
Owner

Repo-scoped, per-machine version of the GITNEXUS_CONTEXT_WINDOW override — a gitignored .gnkit/gitnexus-hooks.local.json that overrides the team-shared gitnexus-hooks.json.

Why

The context window is model-specific (your 1M session vs a teammate's 200k), but gitnexus-hooks.json is tracked/shared. Committing 1000000 there mis-fires the task-core nudge for teammates. This gives a repo-scoped override that isn't shared and doesn't need a shell profile (so it works for GUI-launched Cursor/Zed/Claude too).

What

  • loadHookConfig layers config by precedence: defaults < gitnexus-hooks.json < gitnexus-hooks.local.json < GITNEXUS_CONTEXT_WINDOW env.
  • Extracted the file-merge into applyHookConfigFile(), called for both files; a missing/invalid file is a silent no-op, so layering is safe.
  • .gnkit/gitnexus-hooks.local.json added to the managed .gitignore block (verified via a real install).
  • Overrides any knob (window, mode, thresholds) per-dev, not just the window.
// .gnkit/gitnexus-hooks.local.json  (gitignored)
{ "contextWindowTokens": 1000000 }

62/62 tests (precedence + invalid-file + no-throw).

🤖 Generated with Claude Code

…itignored)

Follow-up to the GITNEXUS_CONTEXT_WINDOW env override — same goal (scope a model-specific setting
like the 1M context window per-machine, not committed to a shared repo) but as a first-class,
runtime-agnostic config file rather than a shell/CI env var.

loadHookConfig now layers config by precedence: defaults < gitnexus-hooks.json (team-shared) <
gitnexus-hooks.local.json (gitignored, per-machine) < GITNEXUS_CONTEXT_WINDOW env. Extracted the
file-merge into applyHookConfigFile() and call it for both files (a missing/invalid file is a
no-op, so layering is safe). The local file is added to the managed .gitignore block so it never
gets committed.

Any dev can now override any knob (window, mode, thresholds) locally without touching the shared
config or a shell profile — works for every runtime + GUI-launched IDEs. 62/62 tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ReidenXerx
ReidenXerx merged commit 9a60e31 into main Jul 16, 2026
1 check passed
@ReidenXerx
ReidenXerx deleted the feat/local-hook-config-override branch July 16, 2026 22:43
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.

1 participant