feat: support .local.md variants for instruction files#16108
Open
clansty wants to merge 1 commit intoanomalyco:devfrom
Open
feat: support .local.md variants for instruction files#16108clansty wants to merge 1 commit intoanomalyco:devfrom
clansty wants to merge 1 commit intoanomalyco:devfrom
Conversation
Add support for AGENTS.local.md, CLAUDE.local.md, etc. alongside their base counterparts. This allows users to keep personal, machine-specific instructions in .local.md files that can be gitignored, while shared instructions remain in the base files. - .local.md files are loaded additively alongside base files - Having either base or .local variant selects that file family - Works for project-level (findUp), global, and subdirectory injection - Follows same priority rules (AGENTS > CLAUDE > CONTEXT)
1 task
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
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.
Issue for this PR
Closes #16110
Type of change
What does this PR do?
Adds
.local.mdvariant support for instruction files. Users can createAGENTS.local.md(orCLAUDE.local.md) alongside the base file — the local variant is loaded additively and can be gitignored for personal, machine-specific instructions.The change is in
instruction.tsonly:systemPaths(): after finding a base file viafindUp, also searches for its.local.mdvariant. Either file alone is enough to select the file family (AGENTS > CLAUDE > CONTEXT priority preserved).globalFiles(): restructured from flat list to location-based groups so both base and local files at the same location are loaded.find()/resolve():find()now returnsstring[]to include both variants;resolve()iterates over the array.This mirrors the
CLAUDE.local.mdpattern from Claude Code.How did you verify your code works?
Checklist