Skip to content

fix(claude-sync): skip memory dirs of $TMPDIR-rooted projects - #530

Merged
Data-Wise merged 2 commits into
devfrom
feature/claude-sync-skip-tmp
Sep 23, 2026
Merged

Data-Wise merged 2 commits into
devfrom
feature/claude-sync-skip-tmp

Conversation

@Data-Wise

Copy link
Copy Markdown
Owner

Summary

Test sandboxes and throwaway sessions that run in macOS $TMPDIR (/private/var/folders/...) each leave a ~/.claude/projects/-private-var-folders-*/memory folder, usually holding only an empty .keep. Since #529, claude-sync commits what it adds, so these would now be committed to dotfiles.

  • The list of memory folders to sync now skips */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 .keep file, runs claude-sync, and checks that the normal memory file reaches the remote while nothing under private-var-folders does. 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/projects goes 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 on dev without this change too.

🤖 Generated with Claude Code

Data-Wise and others added 2 commits September 23, 2026 11:49
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
Data-Wise merged commit b568038 into dev Sep 23, 2026
3 checks passed
@Data-Wise
Data-Wise deleted the feature/claude-sync-skip-tmp branch September 23, 2026 18:05
Data-Wise added a commit that referenced this pull request Sep 23, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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.

1 participant