Per-machine hook-config override (.gnkit/gitnexus-hooks.local.json)#8
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Repo-scoped, per-machine version of the
GITNEXUS_CONTEXT_WINDOWoverride — a gitignored.gnkit/gitnexus-hooks.local.jsonthat overrides the team-sharedgitnexus-hooks.json.Why
The context window is model-specific (your 1M session vs a teammate's 200k), but
gitnexus-hooks.jsonis tracked/shared. Committing1000000there 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
loadHookConfiglayers config by precedence: defaults <gitnexus-hooks.json<gitnexus-hooks.local.json<GITNEXUS_CONTEXT_WINDOWenv.applyHookConfigFile(), called for both files; a missing/invalid file is a silent no-op, so layering is safe..gnkit/gitnexus-hooks.local.jsonadded to the managed.gitignoreblock (verified via a real install).62/62 tests (precedence + invalid-file + no-throw).
🤖 Generated with Claude Code