clawwork-ai/ClawWork
View on GitHub[Bug] file-index walkDir does not filter hidden files at the top level
Open
#390 opened on Apr 15, 2026
area/artifactgood first issuekind/bug
Repository metrics
- Stars
- (519 stars)
- PR merge metrics
- (PR metrics pending)
Description
Problem
walkDir skips hidden entries only when depth > 0. At the root of a scanned folder, hidden files like .DS_Store, .zsh_history, or .env.local are included in the index. When a user adds ~/ or any dotfile-heavy directory as a context folder, the file index pollutes the UI with noise and potentially exposes sensitive files to assistant context.
Location
File: packages/desktop/src/main/context/file-index.ts:42-43
for (const name of entries) {
if (isHidden(name) && depth > 0) continue;
Fix Approach
- Drop the
&& depth > 0condition soisHiddenapplies at all depths. - Verify the
ALLOWED_DOT_FILESallow-list (.env,.gitignore,.dockerfile) still works — it should, sinceisHiddenalready consults it.
Verification
- Run
pnpm check— must pass. - Unit test: scan a folder containing
.DS_Store,file.ts,.env— expect the result to containfile.tsand.env, but not.DS_Store.
Context
- WG: Artifact & File System
- Priority: Low (good first issue)
- Estimated effort: 10-15 minutes