fix(ce-compound, ce-compound-refresh): use injected memory block#569
Merged
fix(ce-compound, ce-compound-refresh): use injected memory block#569
Conversation
…stead of vague directory reference Fixes #318 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab96babd38
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…rompt, not disk
The prior fix pointed the skills at `${CLAUDE_PROJECT_DIR}/memory/MEMORY.md`,
but that path is (a) not substituted inside SKILL.md content and (b) not
where Claude Code stores auto-memory (it lives under
`~/.claude/projects/<encoded-cwd>/memory/`). When the Read failed, Claude
would fall back to Glob/Grep and search the user's filesystem for
MEMORY.md.
Claude Code already inlines MEMORY.md's contents into the system prompt
as a "user's auto-memory" block when it exists. Key off that block
instead, and explicitly forbid filesystem searches when the block is
absent. No path encoding, no env vars, and absence is the natural skip
signal.
…rdrails With the skills keying off the system-prompt-injected auto-memory block instead of a filesystem path, there is no failed Read that would lead the model to fall back on Glob/Grep. The explicit "do not search the filesystem" clauses are defensive against a failure mode that the new mechanism cannot produce, and they slightly prime the model to treat filesystem search as a viable option. Drop them in favor of the simpler "scan the block; if absent, skip" phrasing.
Merged
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.
Summary
ce-compoundandce-compound-refreshnow read auto-memory entries from the "user's auto-memory" block Claude Code injects into the system prompt, instead of readingMEMORY.mdfrom disk.The previous phrasing sent Claude to a filesystem path — first vaguely ("read MEMORY.md from the auto memory directory"), later explicitly (
${CLAUDE_PROJECT_DIR}/memory/MEMORY.md). Neither resolved correctly:${CLAUDE_PROJECT_DIR}is not substituted inside SKILL.md content, and auto-memory lives under~/.claude/projects/<encoded-cwd>/memory/, not the project tree. When the Read failed, Claude would fall back to Glob/Grep and scan the user's filesystem forMEMORY.md— the spurious-search behavior users reported.Keying off the in-context block removes both failure modes: there is no path to resolve, and absence of the block is the natural skip signal, with no failed Read to trigger fallback searches. Non-Claude-Code platforms never see the block and skip automatically.
Fixes #318.