From 997bdbf1f96e60d83dafe0b48309d5dd99befe0a Mon Sep 17 00:00:00 2001 From: Peter Grunde Date: Wed, 17 Jun 2026 10:20:29 -0600 Subject: [PATCH] ignore .claude dir --- app/cmd/preview.go | 6 ++++++ app/cmd/preview_test.go | 7 +++++++ fixtures/test-block-auto-config/.claude/notes.md | 4 ++++ 3 files changed, 17 insertions(+) create mode 100644 fixtures/test-block-auto-config/.claude/notes.md diff --git a/app/cmd/preview.go b/app/cmd/preview.go index 5f5d67b..c682c14 100644 --- a/app/cmd/preview.go +++ b/app/cmd/preview.go @@ -169,6 +169,12 @@ func (p *previewBuilder) compressDirectory(zipTarget string) error { filepath.Walk(p.target, func(path string, info os.FileInfo, err error) error { path = filepath.ToSlash(path) + // Skip the .claude directory and all of its contents entirely so it is + // never collected into the preview payload. + if info != nil && info.IsDir() && filepath.Base(path) == ".claude" { + return filepath.SkipDir + } + fileIsIncluded := false for _, p := range p.configYamlPaths { var configPathSplits = strings.Split(p, string(os.PathSeparator)) diff --git a/app/cmd/preview_test.go b/app/cmd/preview_test.go index f78be1a..1f8744e 100644 --- a/app/cmd/preview_test.go +++ b/app/cmd/preview_test.go @@ -107,6 +107,13 @@ func Test_compressDirectory(t *testing.T) { } } + // The .claude directory and its contents should never be included in the payload. + for path := range paths { + if strings.Contains(path, ".claude/") { + t.Errorf("Should not have included file from .claude directory: %s", path) + } + } + os.Remove(tmpZipFile) } diff --git a/fixtures/test-block-auto-config/.claude/notes.md b/fixtures/test-block-auto-config/.claude/notes.md new file mode 100644 index 0000000..d52c89b --- /dev/null +++ b/fixtures/test-block-auto-config/.claude/notes.md @@ -0,0 +1,4 @@ +# Claude Notes + +This markdown file lives inside a `.claude` directory and must never be +included in the preview payload that is zipped and shipped to Learn.