Repository navigation
fix(claude-code-memory-plugin): avoid persisting compressor sessions - #5697
Open
anhtahaylove wants to merge 1 commit into
Open
anhtahaylove wants to merge 1 commit into
anhtahaylove wants to merge 1 commit into
Conversation
Run the one-shot recall compressor with --no-session-persistence so successful local compression does not leave a resumable Claude Code transcript.
This was referenced Oct 7, 2026
6 of 7 tasks
This branch has not been deployed
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.
Description
The Claude Code memory plugin can compress recalled context locally with
claude -p. That one-shot compressor child is internal utility work, but Claude Code persists print-mode sessions by default. Each local compression can therefore leave a resumable transcript in the user's Claude Code project history, beginning with “You are a memory relevance compressor utility”.This PR adds
--no-session-persistenceto the compressor's Claude Code invocation. The rest of the existing isolation stays unchanged: OpenViking hooks are disabled in the child environment, and MCP servers are emptied with--strict-mcp-configplus an empty--mcp-config.Behavior:
.jsonltranscript.Human Involvement
Related Issue
N/A. Observed while checking Claude Code session history after enabling local recall compression.
Type of Change
Changes Made
--no-session-persistenceto theclaude -parguments inexamples/claude-code-memory-plugin/scripts/lib/host-compressor.mjs.Testing
Validation on Windows with Claude Code
2.1.291and Nodev26.7.0:createHostCompressor()function, using a temporary state directory and the real local Claude Code installation:OK, and transcript count changed0 -> 1;OK, and transcript count stayed1 -> 1.npm testinexamples/claude-code-memory-plugin: 5/5 passed.node --check examples/claude-code-memory-plugin/scripts/lib/host-compressor.mjs: passed.scripts/*.test.mjsplusscripts/lib/*.test.mjsin this environment.auto-capture.test.mjsproduces the same 6 failures repeatedly with and without this one-file change, so those failures are not introduced here. The same broader run also has 4 marketplace/package failures in my sparse checkout before and after this change; this PR does not touch those files.Checklist
Additional Notes
--no-session-persistenceis available in Claude Code 2.x releases from 2.1.0 onward. I checked published npm packages: it is absent from2.0.30and present in2.1.0,2.1.30,2.1.50,2.1.72, and the locally installed2.1.291. The existing compressor already relies on--effort, which was absent from2.1.30and present from2.1.50, so this flag does not raise the plugin's effective Claude Code requirement.No new automated test is added because this is a single CLI argument whose observable effect depends on the external Claude Code persistence implementation. Mocking the argument list would only test field forwarding; the reproduction above checks the actual filesystem side effect.