Updated to use @include for the steering rules#1083
Open
Drizzt321 wants to merge 1 commit intodanielmiessler:mainfrom
Open
Updated to use @include for the steering rules#1083Drizzt321 wants to merge 1 commit intodanielmiessler:mainfrom
@include for the steering rules#1083Drizzt321 wants to merge 1 commit intodanielmiessler:mainfrom
Conversation
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.
In regards to getting PAI to follow the steering rules and other stuff that we've added, discussions like #945 and others exist which all involve trying to rein in our PAI installations where it starts to lose our instructions as sessions go on.
In doing analysis of Claude Code, and with the recent ability to get an insight into it's inner workings, I found something very interesting. The Operator rules in Claude Code explicitly delegate to
CLAUDE.mdby giving that instruction, tagging the section asclaudeMd, and soCLAUDE.mdeffectively becomes part of the Operator prompt section. This is this:This causes it to be in a special
Memory Filessection of the context, which is also automatically reloaded verbatim to the beginning of the context on any compact event.The existing PAI memory layout comes from SessionStart hook loading, as well as attempts to ensure that they are reloaded via other hooks after a compact event.
However, none of these are part of the special Operator (and thus delegated to
CLAUDE.md)<system-reminder>section. CLAUDE.md content is different: Claude Code re-injects it viaprependUserContext()on every turn as part of the user-context prefetch (context.ts:155, memoized). It survives compaction by design — this is the standard Claude Code expectation for "content the model must always have." The PAI files loaded via the hooks are treated as regular context/conversation history by Claude Code agents.So
CLAUDE.mdalso has the ability to inline other files, path relative fromCLAUDE.md, via@including them. When I changed to includePAI/AISTEERINGRULES.mdandPAI/USER/AISTEERINGRULES.md, I immediately and clearly noticed a HUGE difference, especially in long context sessions. It constantly follows my rules, especially around not jumping ahead and starting to edit/update/change things before we've completed our discussion/determination/etc.I have a gist at https://gist.github.com/Drizzt321/a4c567f0d263701152bf4e13c17855f1 which also describe this in more detail, as well as instructions to manually modify existing installs, but I wanted to PR this to bring it back in this way since I think it makes a HUGE difference in user experience.