Repository navigation
Let a project opt out of the memory loop with a .claude/.no-memory-loop marker - #49
Closed
breferrari wants to merge 1 commit into
Closed
breferrari wants to merge 1 commit into
breferrari wants to merge 1 commit into
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.
Adds a way to exclude a single project from a global install: create an empty
.claude/.no-memory-loopfile in the project's root, and the pack's hooks do nothing there.Why
A global sync installs the hooks for every project, and there was no way to leave one out. I have a repo where the memory loop doesn't fit (its knowledge lives elsewhere), and the only workaround was patching the installed hooks after every
mcs sync. That broke when the hooks moved to.mts, so this puts the exclusion in the pack itself.What changes in a project with the marker
memory-loop-activator.shkb-gate.mts(every registration, including thekb-usage.mtscopy).usage.tsvrowssync-memories.mtsThe marker is found with the existing
projectRoot()(the activator repeats the same shell ladder as the launchers), so it resolves exactly the root everything else uses. Only the file's existence matters.What doesn't change
Projects without the marker behave exactly as before. Each hook only adds one
existsSynccheck; the activator also runsgit rev-parseto find the root. Existing tests are untouched and all pass.The memory write and delete gate can't be bypassed through the marker. Since the marker switches that gate off too, kb-gate now denies any agent Write, Edit or Bash call that touches
.no-memory-loop, in any project. Only the user can create or remove it (for example with! touch .claude/.no-memory-loop).Docs
Test plan
check:syncandmcs pack validateare clean.touch .claude/.no-memory-loopin a project → no reminder, no.claude/.kb-gate*, no.claude/.kb-index.Merge danger
Door: two-way. Nothing is migrated or deleted; a revert restores the old behaviour.
Blast radius: projects that carry the marker, and any agent tool call that names it.
Your call
I kept this to the hooks and left these for you to decide:
CLAUDE.mdsection still tells Claude to search the KB first. A one-line exemption would help, but it lands in every user's globalCLAUDE.md, so I didn't add it..kb-indexand.kb-gatefiles, and doctor still checks them. Nothing is deleted.