fix(claude-sync): skip memory dirs of $TMPDIR-rooted projects - #530
Merged
Merged
Conversation
Test sandboxes and throwaway sessions under /private/var/folders leave ~/.claude/projects/-private-var-folders-*/memory dirs. Now that claude-sync commits (#529), those empty .keep dirs would land in dotfiles. 10 such dirs on this machine (68 memory dirs -> 58 synced). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Skipping -private-var-folders-* memory dirs at chezmoi-add time does not stop copies an earlier run already put in the source dir: the commit step's 'git add -A -- dot_claude' would still pick them up. Exclude them in the pathspec too. Dry run against the real dotfiles source: 5 such .keep files staged without the exclude, 0 with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Data-Wise
added a commit
that referenced
this pull request
Sep 23, 2026
Data-Wise
added a commit
that referenced
this pull request
Sep 23, 2026
… projects (#531) #530 skipped every -private-var-folders-* project, but a session whose cwd was $TMPDIR itself (-private-var-folders-...-T) can hold real memory: two such projects here have 5 memory files, one edited 2026-09-21. Narrow both the chezmoi-add filter and the commit-time exclude to *-flow-test-sandbox-*, the mktemp name run-all.sh uses. Real dirs: 71 total, 11 skipped, both real TMPDIR projects kept. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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
Test sandboxes and throwaway sessions that run in macOS
$TMPDIR(/private/var/folders/...) each leave a~/.claude/projects/-private-var-folders-*/memoryfolder, usually holding only an empty.keep. Since #529,claude-synccommits what it adds, so these would now be committed to dotfiles.*/projects/-private-var-folders-*. It's one zsh filter on the existing list.Tests
New case
test_skips_tmpdir_project_memory: it adds a temporary-folder project with a.keepfile, runsclaude-sync, and checks that the normal memory file reaches the remote while nothing underprivate-var-foldersdoes. Before the fix it failed (✗ Expected output NOT to contain 'private-var-folders', 7 of 8 passed). After it,✓ All tests passed: 8/8.The same filter applied to the real
~/.claude/projectsgoes from 68 memory folders to 58, dropping exactly the 10-private-var-folders-*ones.Full suite
./tests/run-all.sh: 86 passed, 3 failed. The failures are the same 3 as on #529 (test-doctor,e2e-em-dispatcher,test-atlas-contract), and they fail ondevwithout this change too.🤖 Generated with Claude Code