fix: add MEMORY additionalDirectories and write permission to v4.0.3 settings#1000
Open
brycemagera wants to merge 1 commit intodanielmiessler:mainfrom
Open
fix: add MEMORY additionalDirectories and write permission to v4.0.3 settings#1000brycemagera wants to merge 1 commit intodanielmiessler:mainfrom
brycemagera wants to merge 1 commit intodanielmiessler:mainfrom
Conversation
Fixes a regression introduced in Claude Code versions after 2.1.77 where the MEMORY directory is no longer accessible across all projects by default. Add `additionalDirectories` pointing to `~/.claude/MEMORY` so the MEMORY context is available in every project session, and add the corresponding `Write(~/.claude/MEMORY/**)` allow permission so PAI hooks can write to it. Tilde paths confirmed working (consistent with existing permission patterns). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Tested — this fix doesn't workWe independently tested this exact approach (tilde-form Full analysis and evidence at anthropics/claude-code#29013 (comment: anthropics/claude-code#29013 (comment)) — covers four different approaches we tried, all of which fail:
This is a Claude Code bug, not a PAI config issue. No settings-level workaround exists until Anthropic fixes the hardcoded protection. |
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.
Problem
A regression introduced in Claude Code versions after 2.1.77 broke the MEMORY directory context injection. Users running newer Claude Code versions find that
~/.claude/MEMORYis no longer accessible across projects, causing PAI's dynamic context (learning signals, session history, Wisdom Frames, etc.) to fail silently.Reported in discussion #992 — reverting to Claude Code 2.1.77 resolves it, but that's not a sustainable fix.
Solution
Two surgical additions to
Releases/v4.0.3/.claude/settings.json:additionalDirectories— registers~/.claude/MEMORYas an additional working directory so Claude Code exposes it across all project sessionsWrite(~/.claude/MEMORY/**)in theallowpermissions — lets PAI hooks write to MEMORY without prompting (required for WorkCompletionLearning, IntegrityCheck, and other session-end hooks)Tilde paths (
~) confirmed working — consistent with existing permission patterns already in this file (e.g.Write(~/.claude/settings.json)).Files Changed
Releases/v4.0.3/.claude/settings.json— 6-line additionTest Plan
🤖 Generated with Claude Code