Skip to content

fix(ce-compound, ce-compound-refresh): use injected memory block#569

Merged
tmchow merged 3 commits intomainfrom
tmchow/fix-memory-md-search
Apr 16, 2026
Merged

fix(ce-compound, ce-compound-refresh): use injected memory block#569
tmchow merged 3 commits intomainfrom
tmchow/fix-memory-md-search

Conversation

@tmchow
Copy link
Copy Markdown
Collaborator

@tmchow tmchow commented Apr 15, 2026

Summary

ce-compound and ce-compound-refresh now read auto-memory entries from the "user's auto-memory" block Claude Code injects into the system prompt, instead of reading MEMORY.md from 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 for MEMORY.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.


Compound Engineering
Claude Code

…stead of vague directory reference

Fixes #318

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread plugins/compound-engineering/skills/ce-compound/SKILL.md Outdated
tmchow added 2 commits April 15, 2026 17:37
…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.
@tmchow tmchow changed the title fix(ce-compound, ce-compound-refresh): use explicit MEMORY.md path fix(ce-compound, ce-compound-refresh): use injected memory block Apr 16, 2026
@tmchow tmchow merged commit 0b3d4b2 into main Apr 16, 2026
2 checks passed
@github-actions github-actions Bot mentioned this pull request Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

usage of "MEMORY.md" for capturing relevant details

1 participant