Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/cmd/preview.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
7 changes: 7 additions & 0 deletions app/cmd/preview_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
4 changes: 4 additions & 0 deletions fixtures/test-block-auto-config/.claude/notes.md
Original file line number Diff line number Diff line change
@@ -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.
Loading