-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Problem
The analyze command generates AGENTS.md and CLAUDE.md context files with a hardcoded base_ref: "main" in the debugging section (line 48 of ai-context.js):
For regressions: gitnexus_detect_changes({scope: "compare", base_ref: "main"}) — see what your branch changed
Many projects use develop, master, or other branch names as their default branch. Every time gitnexus analyze runs, it overwrites any manual fix back to "main" within the <!-- gitnexus:start --> / <!-- gitnexus:end --> markers.
Proposed Solution
1. defaultBranch configuration
Allow users to configure the default branch name, either via:
- A config file (e.g.
.gitnexus/config.jsonor a field inmeta.json):{ "defaultBranch": "develop" } - Auto-detection from
git symbolic-ref refs/remotes/origin/HEADorgit remote show origin | grep 'HEAD branch' - A CLI flag:
gitnexus analyze --default-branch develop
The generated context would then use the configured branch instead of hardcoding "main".
2. Option to skip context file generation
For projects that maintain their own AGENTS.md / CLAUDE.md with custom content, provide a way to skip regeneration:
- CLI flag:
gitnexus analyze --no-contextor--skip-context-files - Config option:
{ "skipContextFiles": true }in the config file
This would still build the knowledge graph index but skip the generateAIContextFiles() call.
3. Option to skip skills installation
Similarly, gitnexus analyze --no-skills or a config option to skip overwriting .claude/skills/gitnexus/.
Context
We're using GitNexus in a monorepo that uses develop as the default branch. The auto-generated context is valuable, but every analyze run resets our base_ref fix. Currently the only workaround is running sed after every analyze.
Environment
- GitNexus CLI (via
npx gitnexus@latest) - macOS / Node.js v22
- Monorepo with ~11,500 symbols